2
votes

Good morning, I have this simple fragment of code:

driver.Navigate().GoToUrl("https://www.mysecretwesite.com/");
            wait = new WebDriverWait(driver, TimeSpan.FromSeconds(300));
            element = wait.Until(ExpectedConditions.ElementToBeClickable(By.PartialLinkText("partial link text")));

The timespan is high because the website requires authentication. This worked fine with Firefox 52 and Selenium 3.0.1, however, after having updated to Firefox 57 and Selenium 3.8.1, the wait.until call throws an exception. Furthermore, the exception is thrown immediately, without waiting the 300 seconds as set in the wait variable. I could not find the code for the authentication form, here is how it looks like: enter image description here I am using Win 7.

1
What is the exception in English? - Equalsk
It does not have any text, the exception message is blank. - Andrea Filippig

1 Answers

0
votes

While Automating a process it won't be a good practice to skip the Windows Basic Authentication through your Automation Script

In your code as you invoke :

driver.Navigate().GoToUrl("https://www.mysecretwesite.com/");

On reaching 'document.readyState' == "complete" the WebDriver is looking out for the PartialLinkText("partial link text") within the HTML DOM while you were trying to manually fill up the credentials through Windows Basic Authentication. So absence of the "partial link text" you see the exception

How ever, an english version of the exception you are seeing would have given us some more insight about the way to handle it.

As per best practice, we should try to handle the Windows Basic Authentication through the WebDriver only as follows :

driver.Navigate().GoToUrl("http://admin:[email protected]/basic_auth");

You can find some detailed discussion on Windows Basic Authentication Selenium - Other way to basic authenticate than via url and Python Selenium Alert — Prompt username and password is not working.