RJX
RJX

Reputation: 383

Unable to locate element on a Dialog in Android

The app in Android has a signin dialog which pops up. I need to test it in Appium ( with Selenium java) When i click on the signin button it will open the dialog but selenium commands are not able to locate the textboxes where I need to enter email and password.

driver.findElement(By.id("login_sign_in_button")).click(); // works fine
driver.findElement(By.id("email_address")).sendKeys("abc@xxx.com");// unable to locate the element**

Upvotes: 1

Views: 2186

Answers (1)

Eugene
Eugene

Reputation: 1895

You probably need add some waiting before the dialog appears. Please try the following code

WebDriverWait driverWait = new WebDriverWait(driver, 30);
driverWait.until(ExpectedConditions.visibilityOfElementLocated(By.Id("email_address")));

before

driver.findElement(By.id("email_address")).sendKeys("abc@xxx.com");

Upvotes: 1

Related Questions