15
Daniel Herken [email protected] http://www.browseemall.com Selenium Tests Using Jenkins Jenkins & Selenium

Run Selenium Tests With Jenkins and BrowseEmAll

Embed Size (px)

Citation preview

Page 1: Run Selenium Tests With Jenkins and BrowseEmAll

Daniel [email protected]://www.browseemall.com

Selenium Tests Using Jenkins

Jenkins & Selenium

Page 2: Run Selenium Tests With Jenkins and BrowseEmAll

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

Page 3: Run Selenium Tests With Jenkins and BrowseEmAll

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

Page 4: Run Selenium Tests With Jenkins and BrowseEmAll

Supported by all major browser vendors:

What is Selenium?

Free and open source browser automation framework.

Page 5: Run Selenium Tests With Jenkins and BrowseEmAll

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(); }

Page 6: Run Selenium Tests With Jenkins and BrowseEmAll

Run Selenium Tests

Configure Jenkins to run the test (nunit):

Page 7: Run Selenium Tests With Jenkins and BrowseEmAll

• 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:

Page 8: Run Selenium Tests With Jenkins and BrowseEmAll

Using Selenium Grid

Page 9: Run Selenium Tests With Jenkins and BrowseEmAll

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(); }

Page 10: Run Selenium Tests With Jenkins and BrowseEmAll

Using Selenium Test

No change to Jenkins necessary!

Page 11: Run Selenium Tests With Jenkins and BrowseEmAll

• 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:

Page 12: Run Selenium Tests With Jenkins and BrowseEmAll

Simpler Selenium Grid Setup

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

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

Page 13: Run Selenium Tests With Jenkins and BrowseEmAll

Simpler Selenium Grid Setup

Page 14: Run Selenium Tests With Jenkins and BrowseEmAll

Simpler Selenium Grid Setup

Page 15: Run Selenium Tests With Jenkins and BrowseEmAll

Questions?

Q & A