I have a large number of selenium test scripts that work on IE, Chrome and Firefox. I now need to run them on Microsoft Edge, however, I am having a lot of issues. The main issue is that the scripts executing too quickly and not allowing the pages to load fully before moving on to the next step of the scrip. Because of this, most of my scripts are failing as they cannot find the elements. I have tried waits (explicit and implicit) but they do not seem to work - the script keeps going and don't wait for an element to be displayed. The following is a sample of the wait code that I am using:

WebDriverWait wait = new WebDriverWait(driver, 30);
wait.until(ExpectedConditions.visibilityOf(driver.findElement(By.xpath("//div/p[contains(text(), '" + menu_HeaderPortfolio+ "')]"))));

Any idea why that might be? Or how I can get edge to wait for the page to load completely before moving on with the script? Or is this a limitation with Edge?

I am using Selenium 2.53, and Edge WebDriver version 10586

2 Answers 2


One known problem might be mixing implicit and explicit waits. Experts suggest using explicit wait only.

Another problem might be locating by XPATH. So many people complain about selenium not working, and their code example shows XPATH (like yours), so I usually don't even bother answering questions with XPATH (I made an personal exemption for you :-) ).

I try to use ID and NAME (and ask developers to add those for me). If I cannot, I found that with CSS_SELECTOR can locate all I needed. CSS has to be reliable across browsers for styles to work. XPATH - not so much.

  • Thanks Peter - guess I better go back and rewrite my test scripts to remove xpath :(
    – Debbie
    Oct 5, 2016 at 19:39
  • I hope it will help. If it does, please let us know. Even write an answer, you might earn some upvotes for it :-) Oct 5, 2016 at 19:56

We have experimented with Edge Driver too, and the main thing is that Edge Driver is riddled with bugs.

For example, what you are mentioning sounds awfully similar to Setting URL doesn't wait to return before full navigation and switch has happened.

And users have reported other issues with Edge Driver Waits, such as ImplicitWait should wait the designated time before attempting to interact with the element or Edge WebDriver does not wait for "document.readyState == 'complete'"

Our conclusion: Edge Driver is not ready to be used in serious tests.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.