Selenium efficiency with .NET and Jenkins - how to profile and improve it?

I have an ASP.NET website that I want to test with Selenium. I want to configure a Jenkins instance on an "intermediate" virtual machine to run tests automatically.

The problem is that the tests run very slowly - several times slower than on my development machine. One simple test can take more than 2-3 minutes.

I would like to know whether to expect this if there are any obvious errors for such a test setup as mine, and if something I can do to profile and improve the performance of the test suite.

Information:

Tests are performed on a 2.7 GHz Ram RAM virtual machine with Windows 7 64 bit. My Dev machine is similar, but with a 32-bit installation of Win.

Jenkins does the following:

  • The website accesses the original control and is configured using custom web.config. The main differences are that it is compiled in release mode and connects to the database on another computer (also a virtual machine on the same server).
  • IIS monitors the website directory and automatically reloads the changes.
  • The following command is executed (sanitized directories): nunit-console Selenium-Project-Dir / labels
  • Tests are performed on the Chrome web server.

The selenium project uses NUnit and WebRunner. Driver instances are created once - before all tests in the [SetUp] attribute inside the [SetUpFixture] class. They are deleted once in the class [TearDown] attribute.

An example test is as follows:

[Test, Combinatorial]
public void AnExistingUserCanLogin(
    [ValueSource(typeof(Drivers), "Good")] 
    IWebDriver driver)
{
    // This function clicks on some buttons and fills in some forms.
    LoginUser(driver); 

    // Make sure the user is now logged in
    Assert.IsTrue(driver.ElementIsPresent(By.ClassName("imgUserAvatar")));
    Assert.IsTrue(driver.ElementIsPresent(By.CssSelector("a.my-profile")));
    Assert.IsTrue(driver.ElementIsPresent(By.CssSelector("a.logout")));
}

( "" lazily- webdriver FF, IE, Chrome. , "" )

+5
1

, , , , . ? Windows (- ). Vista, Windows 7 Server 2003.

, , , 64- , 32- . , - , , , . duh, , , . , , .

, , , . IE8 IE9 selenium . , , , . , ​​ Chrome (, , , -).

, . , , .

, , , , . , . , , . , , , VM .

!

0

All Articles