- mandeep
- Posts : 1
Join date : 2011-11-28
implicitwait and explicitwait not solving the issue in selenium webdriver
Mon Nov 28, 2011 7:56 pm
Hi friends,
I've been testing an application involving multiple ajax calls ,so I required wait condition so that elements are present/visible once the ajax call is made. I used both methods implicitwait and explicitwait but none of them seem to be working for me as one or the other exceptions are generated as follows:
1.Unable to locate element
2.Element is disabled and so may not be used for actions
Implicitwait used as follows:
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
WebElement we = driver.findElement(By.name("q"));
PROBLEM:
When I test this code, after browser opens, it throws exception in 2 seconds.
Result:Exception generated
ExplicitWait
WebDriverWait wait = new WebDriverWait(driver, /*seconds=*/3);
WebElement element = wait.until(presenceOfElementLocated(By.name("q"));
PROBLEM:
When I test this code, after browser opens, it throws exception in 2 seconds, so what is really going on?
Result:Exception generated.
Also used visibilityOfElementLocated but it does not work for me.
****************
Has anybody faced this issue or anybody has a solution for this??
I've been testing an application involving multiple ajax calls ,so I required wait condition so that elements are present/visible once the ajax call is made. I used both methods implicitwait and explicitwait but none of them seem to be working for me as one or the other exceptions are generated as follows:
1.Unable to locate element
2.Element is disabled and so may not be used for actions
Implicitwait used as follows:
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
WebElement we = driver.findElement(By.name("q"));
PROBLEM:
When I test this code, after browser opens, it throws exception in 2 seconds.
Result:Exception generated
ExplicitWait
WebDriverWait wait = new WebDriverWait(driver, /*seconds=*/3);
WebElement element = wait.until(presenceOfElementLocated(By.name("q"));
PROBLEM:
When I test this code, after browser opens, it throws exception in 2 seconds, so what is really going on?
Result:Exception generated.
Also used visibilityOfElementLocated but it does not work for me.
****************
Has anybody faced this issue or anybody has a solution for this??
Permissions in this forum:
You cannot reply to topics in this forum