Active Element - W4D1-1
Active Element - W4D1-1 ~30 mins

Active Element

    package week4.day1;

import java.time.Duration;
import org.testng.annotations.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver.TargetLocator;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
import org.openqa.selenium.support.ui.WebDriverWait;
import io.github.bonigarcia.wdm.WebDriverManager;

public class FindActiveElement {

public static void main(String[] args) {

// Steps to launch driver, app,maximize, set timeout
WebDriverManager.chromedriver().setup();
ChromeDriver driver = new ChromeDriver();
driver.get("http://leaftaps.com/opentaps/control/main");
driver.manage().window().maximize();
driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(30));

driver.findElement(By.id("username")).sendKeys(Keys.TAB, Keys.TAB);
WebElement which = driver.switchTo().activeElement();
System.out.println(which.getAttribute("class"));

}
}