I have a scenario where I have 29 test cases. All the test cases pop-up new firefox windows and run to completion when run independently. However when I combine the test cases(all 29) into a test suite, I get random errors of “unable to locate element”. If I run the test suite multiple times, I can see different test cases fail at different places, randomly. Note- I am waiting for every elements visibility for around 100 seconds, before clicking on them. Code looks like-
WebElement myDynamicElement = (new WebDriverWait(driver, 100))
.until(new ExpectedCondition<WebElement>() {
@Override
public WebElement apply(WebDriver driver) {
return driver.findElement(element);
}
Could someone advice? Are smaller test suites recommended?
not so far come across with a similar problem type.
IMHO try to use a lil bit more robust wait mechanism
fluentWait:here is documentation on fluent wait
usage be like :
Don’t forget about step by step debug in IDE(IDEA, Eclipse,NetBeans) you work.