jeudi 9 mars 2017

Why is Selenium web driver crashing when attempting a navigation?

Situation :

To run integration tests on our ASP.NET MVC application, we chose Selenium's Web Driver.

Problem :

When running the tests from VS2015 using Internet Explorer Driver, the console displays an error message (see screenshot below). Simultaneously, the browser opens and closes. The console freezes. Then, Visual Studio displays a StackOverflow exception message :

Selenium console test crash screenshot

Diagnostic :

  • The test crashes as soon as the driver attempts a navigate action in the app.

    [Test]
    public void PerformNavigation()
    {
        Driver.Navigate().GoToUrl(GetAbsoluteUrl("/")); // <-- The test crashes here
    }
    
    

    However an external url works.

    [Test]
    public void PerformNavigation()
    {
        Driver.Navigate().GoToUrl("http://google.com"); // <-- This works
    }
    
    
  • It seems that the web driver is redirected forever until a stackoverflow exception occurs (HTTP 302).

  • In debug mode, I can not find the main project's assembly (the one we are testing) in the modules window. It seems that the test project has some trouble loading this specific assembly : all other assemblies are here. I did not find any reason why an assembly couldn't be loaded.

Question :

I could not find any help on Google or SO. Our problem is very specific and may be a combination of issues.

So how can I make these integration tests work ?

Or at least : how can I perform a more precise diagnostic on this issue ?

Aucun commentaire:

Enregistrer un commentaire