Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
+1 vote
2 views
in DevOps and Agile by (19.7k points)

By design, Selenium makes a new copy of your Firefox profile each time a new test is run. I find this copy time is a considerable bottleneck, especially when running 100s of tests. (5-15 seconds to copy the profile a new).

Does anyone know of any overridden behaviour for this? I'd prefer my Selenium server to just reuse the same firefox profile. I know this violates the "cleanly set up your test fixtures" philosophy, but it's a shortcut I'm willing to take, as my tests don't materially alter my firefox profile enough to jeopardize future tests.

1 Answer

0 votes
by (62.9k points)

It's merely a matter of moving the code below outside of your test setup and into the fixture setup and keeping a global of selenium instance (code assumes NUnit.)

[TestFixtureSetUp()] public void FixtureSetup() {

selenium = New DefaultSelenium("localhost", 4444, "*firefox", "http://localhost/");

selenium.Start();

selenium.SetTimeout("30000");

selenium.Open("/");

}

Your test setup should then look something like this:

[SetUp()] public void SetUpTest() { selenium.Open("default.aspx"); selenium.WaitForPageToLoad("30000"); }

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...