yogan naik
yogan naik

Reputation: 1

Selenium clicking on a different element on two different machine

I have this below code to locate an element on a page.

driver.findElement(By.xpath("//div[text()='Add']")).click();

The above code works perfectly on

Machine 1: Windows 7 64 bit, Firefox Browser, selenium-java-2.45.0

but click's on another web element when run on

Machine 2: Windows 7 64 bit Firefox Browser, selenium-2.53.0

Note: There is only one Add Element on the page

Upvotes: 0

Views: 167

Answers (1)

MikeJRamsey56
MikeJRamsey56

Reputation: 2819

I would try this:

WebDriverWait wait = new WebDriverWait(driver, 60);
WebElement addElement = wait.until(
  ExpectedConditions.elementToBeClickable(By.xpath("//div[text()='Add']")));
addElement.click();

Upvotes: 0

Related Questions