Test case execution hangs. No exception is thrown even when xpath for an element shows No matching n

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Test case execution hangs. No exception is thrown even when xpath for an element shows No matching n

Akash Deep

I have a drop-down which should display a list of items. Somehow, the drop-down fails to appear and provide me with options. When I run my test case, the drop-down does not appear. I have used and tried different methods to get rid of this issue, such as. waitUntil, isDisplayed, waitUntilExcpectedConditions, isEnabled also with various locators from the time it was working as expected like XPath,CSS etc.No luck though. Ideally, these methods should throw a NoSuchElementException if it cannot find the given element by using locators or when the timeout gets exhausted in case of wait. Nothing seems to work, can anyone help me with this issue.

selenium version : 2.28.0 Chrome Driver version : 2.37.543654 Chrome version : 65.0.3325.162



Enter code here...

public void waitUntilElementIsPresentByCss(String cssSelector)
{

    WebDriverWait wait = getWebDriverWaitInstance();
    wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector(cssSelector)));
    logger.info("retuned waitUntilElementIsPresent ");
}
 
Enter code here...
public void waitUntilElementIsPresentByXpath(String xpath)
{

    WebDriverWait wait = getWebDriverWaitInstance();
    wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(xpath)));
    logger.info("retuned waitUntilElementIsPresent ");
}
Enter code here...
public WebDriverWait getWebDriverWaitInstance() {
   if (wait == null) 
{ 
wait = new WebDriverWait(selenium, Integer.parseInt(localProperties.getProperty("timeOut")));
 } 
return wait;
 }



--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/5f8ab90b-d15d-4206-ab1e-4f333028f2ed%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.