import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.interactions.Action;
import org.openqa.selenium.interactions.Actions;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
public class test {
public static WebDriver driver;
public static void main(String[] args) throws InterruptedException {
// TODO Auto-generated method stub
String URL= "
http://divyatad.trials621.orangehrmlive.com";
driver= new FirefoxDriver();
driver.manage().window().maximize();
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
driver.get(URL);
driver.findElement(By.id("txtUsername")).sendKeys("Admin");
driver.findElement(By.id("txtPassword")).sendKeys("ah4Omutr");
driver.findElement(By.id("btnLogin")).click();
Thread.sleep(1000);
WebDriverWait wait= new WebDriverWait(driver,30);
Actions act=new Actions(driver);
WebElement e1=driver.findElement(By.xpath("//*[@id='menu_admin_viewAdminModule']/child::a/span[2]"));
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//*[@id='menu_admin_viewAdminModule']/child::a/span[2]")));
act.moveToElement(e1).click();
act.perform();
/*JavascriptExecutor js = (JavascriptExecutor)driver;
js.executeScript("arguments[0].click();", e1);*/
}
}