Reputation: 1
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
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