Random exception org.openqa.selenium.NoSuchElementException: No such element

By design Issue #12147236

Details

Author
Anda C.
Created
May 26, 2017
Privacy
This issue is public.
Found in
  • Microsoft Edge
Found in build #
14.14393
Reports
Reported by 1 person

Sign in to watch or report this issue.

Steps to reproduce

For the same test case sometimes I receive
org.openqa.selenium.NoSuchElementException: No such element (WARNING: The server did not provide any stacktrace information).
sometimes no.

I think that there is a reason for what appear this message.

I have implicit wait for my page.

Attachments

Comments and activity

  • Microsoft Edge Team

    Changed Assigned To to “Steven K.”

  • Hi Anda,

    Can you attach your webDriver repro code for this?  I want to run the same code.

    I recommend you try using an explicit wait for the form text box and the login button.

    http://www.seleniumhq.org/docs/04_webdriver_advanced.jsp

    Example in Java:

    public class Main {
        public static void main(String[] args) {
            WebDriver driver = new EdgeDriver();
            driver.get(“https://www.bing.com”);
            WebElement myElement = null;
            int timeOut = 5;
            WebDriverWait wait = new WebDriverWait(driver, timeOut);
            By myBy = By.id(“sb_form_q”);
            try
            {
     wait.until(ExpectedConditions.presenceOfElementLocated(myBy));
            }
            catch (Exception e)
            {
                System.out.println(“Time-out.  WebDriverWait.until”);
            }

    Example in C#:

                    // WebDriverWait from nuGet package OpenQA.SeleniumSupport.UI
                    IWebElement myElement = null;
                    int timeOut = 5;
                    WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(timeOut));
                    By myBy = By.Id(“sb_form_q”);
                    try
                    {
                        wait.Until(ExpectedConditions.ElementExists(myBy));
                    }
                    catch (Exception e)
                    {
                        Console.WriteLine("Time-out.  WebDriverWait.until()–> {0}", e);
                    }

    The MS Edge Team

  • Ok, I will try.

  • One reason for this error could be a redirect of Yahoo Email.
    I noticed that Yahoo redirects to URL that contains the word 'beta’.

  • Nice find.

    Also, using the “Selenium IDE” can make initial test setup easier.

    Steve

  • Microsoft Edge Team

    Changed Status to “By design”

You need to sign in to your Microsoft account to add a comment.

Sign in