Able to locate the elements in default content. but when I try to locate an element in javascript pop up, the webdriver hangs. i tried wait.until(ExpectedConditions)
, but no use. and i tried isDisplayed()
as well. but still can't locate. Here's my coding:
WebElement LoginMbno=driver.findElement(By.xpath(".//*[@id='txtUserMobile']"));
if(LoginMbno.isDisplayed())
{
System.out.println("Avialable");
}
else
{
System.out.println("Not");
}
LoginMbno.sendKeys(new String[]{"9944097094"});
WebElement LoginPwd=driver.findElement(By.xpath(".//*[@id='txtPassword']"));
LoginPwd.sendKeys(new String[]{"123456"});
WebElement LoginBtn=driver.findElement(By.xpath(".//*[@id='btnLogin']"));
LoginBtn.click();