Able to find xpath, but trying to click button throws exception
I tried to click on an element using the code below but it is throwing Exception: No Such Element Selections
and while finding xpath it gave the 1\1 matching.
morde last edited by
If you're 100% sure that the XPath selector is correct the problem can have at least 2 possible causes:
Element hasn't been fully loaded yet, it might appear later than
completeas it might be added later as the result of an AJAX call execution. If this is the case - consider using an Explicit Wait to ensure that the element is there prior to attempting interacting with it.
WebDriverWait wait = new WebDriverWait(driver, 10); wait.until(ExpectedConditions.elementToBeClickable(By.xpath(PageUtility.OPEN_LOCATION_POPUP_XPATH)));