Unanswered question

Selenium int - how can I wait an element (or the entire page) is loaded

Hi
I am using this code to see if my element is fully loaded

driver.get(\"history.html\");
WebDriverWait wait = new WebDriverWait(driver, 30);
WebElement element = wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(\"//button[@class=\\\"o-B o-BIntro\\\"]\")));
driver.stopTransaction();

With the classi driver it waits that the element is loaded, but not with NL driver

Any idea/Workaround ?
Thanks and regards
Laurent

Laurent G.
Laurent G.

Laurent G.

Level
1
197 / 750
points

Answers

Alexis N.
Alexis N.

Alexis N.

Level
2
1255 / 2000
points
Team

Hi Laurent,
I had the good URL from your support case and I tried your condition. I got the same result with and without NL driver.
A button with css class o-B o-BIntro is present in the DOM when the page start loading so it does not wait that the page is fully loaded. Are you sure you sure you get a different behaviour without NL driver? Maybe it's because a different version version of Selenium is used when you use the NL driver. In my test I am using Selenium version 3.8.1.

Laurent G.
Laurent G.

Laurent G.

Level
1
197 / 750
points

Hi Alexis,

May be I was too fast yesterday, I am not able to get it working with Selenium Chrome Driver today
It's probably due to JS. Any idea to solve it ?
Thanks
Laurent

Alexis N.
Alexis N.

Alexis N.

Level
2
1255 / 2000
points
Team

I think you should try to find another condition or maybe update the Selenium version. Since it's not an issue with NL driver but with Selenium Chrome Driver I can't help you further.
Regards.