I’m creating an API based on Selenium API for our system that is controlled through the web-browser (similar to the way you control routers and switches).
One of the things that happens in this API is checking whether certain elements exist on the page (depending on the setting, they may or may not exit, for example, text box or some status).
I have this line:
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
I had it working just fine until when at one point in time, I ran it, and the driver.findElement(By….); has never timed out (the element was missing from the web-page)… The longest I have waited was somewhere about half-an hour.
I’m running Ubuntu 12.04 x64 as my host, Windows 7 as my guest, and on it I have my Selenium API and the code written in Java that controls out product. When I port the same code to another Windows VM or even to a different work station, it works fine. Not on my particular VM though.
Tried “reinstalling” eclipse, reimported Selenium JARs, pulled the latest working code from the server… Nothing works…
What are your thoughts, fellas?
Will appreciate any response. Thanks.
first of all try using fluentWait to wait for all the AJAX on the page:
Secondly, try using
Thead.sleep(1000);as alternative to