Run Selenium Tests With Jenkins and BrowseEmAll

Post on 13-Apr-2017

134 views 2 download

transcript

Daniel Herkendherken@browseemall.comhttp://www.browseemall.com

Selenium Tests Using Jenkins

Jenkins & Selenium

Today we will cover

1. What is Jenkins?2. What is Selenium?3. Run Selenium Tests on Build4. Using Selenium Grid5. Simpler Selenium Grid Setup

Introduction

What is Jenkins?Jenkins is an open source continuous integration server. It support hundreds of dif-ferent building, deploying and automation types through plugins.

Supported by all major browser vendors:

What is Selenium?

Free and open source browser automation framework.

Run Selenium Tests

A simple Selenium test case:

[Test] public void TestWithFirefox() {                  IWebDriver driver = new FirefoxDriver();      driver.Navigate().GoToUrl(TestUrl);     

Assert.IsFalse(string.IsNullOrEmpty(driver.Title));     

driver.Quit(); }

Run Selenium Tests

Configure Jenkins to run the test (nunit):

• Tests run directly on the Jenkins Server machine• Not suitable for bigger test suites• Testing with different operating systems not possible• Tests can not run in parallel

Run Selenium Tests

Problems with this solution:

Using Selenium Grid

Using Selenium Grid

Simple change to the existing test case:

[TestMethod] public void TestWithFirefox() {      DesiredCapabilities capability = DesiredCapabilities.Firefox();     

IWebDriver driver = new RemoteWebDriver(HubUrl, capability);     

driver.Navigate().GoToUrl(TestUrl);     

Assert.IsFalse(string.IsNullOrEmpty(driver.Title));     

driver.Quit(); }

Using Selenium Test

No change to Jenkins necessary!

• Tests run on distributed machines• Suitable for bigger test suites• Nodes on different operating systems possible• Tests can run in parallel

Using Selenium Grid

Selenium Grid is scalable:

Simpler Selenium Grid Setup

Setup a Selenium Grid in 3 Steps (no requirements)!

1. Install BrowseEmAll Trial2. Select necessary browsers3. Start Grid

Simpler Selenium Grid Setup

Simpler Selenium Grid Setup

Questions?

Q & A