'when click on element through automation using diff. click methods its gives undefined could not be loaded but if clicked manually it's working
In selenium script when click on particular element through automation using diff. click methods its gives "undefined could not be loaded" error message pop-up but if clicked manually it's working. After closing the error pop-up if clicked again through automation won't work but manually its working. tried by:
- increasing wait
- checked element visibility and is the element is clickable before click method
- Actions class click method
- refreshed the browser before click
Please suggest.
Solution 1:[1]
You never find elements in Selenium and start clicking on them. In Selenium there is an an object called WebDriverWait that waits for specific conditions like element is clickable, visible or part of the DOM.
// set wait timeout to a maximum of 10 seconds
WebDriverWait wait = new WebDriverWait(driver, 10);
WebElement we = wait.until(ExpectedConditions.
elementToBeClickable("By.Css or By.Xpath");
we.click();
If that doesn't work - try again with the child or parent element of the element you are trying to click on. Or, maybe just close the pop-up via the automation before you click.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Tal Angel |
