Skip to content

SeleniumHQ: launching MS Visual Studio tests for different browsers

March 13, 2011

Sometimes you need to automate functional tests for application with Web UI. SeleniumHQ is a free tool that is good for this purposes which you can integrate with MS Visual Studio.

You can launch test in different browsers like this:

1. Fire Fox:

[TestInitialize]
public void SetupTest()
 {
 selenium = new DefaultSelenium("localhost", 4444, "*chrome",
"http://sunflower.griddynamics.net/");
 selenium.Start();
 verificationErrors = new StringBuilder();
 }

2. Internet Explorer:

[TestInitialize]
public void SetupTest()
{
selenium = new DefaultSelenium("localhost", 4444,
"*iexplore", "http://sunflower.griddynamics.net/");
selenium.Start();
verificationErrors = new StringBuilder();

}

To avoid code duplication for test it is good to implement test core class and inherit tests for specific browser from it.

Advertisements

From → Selenium

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: