Daniel Herken
dherken@browseemall.com
http://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 Build
4. Using Selenium Grid
5. Simpler Selenium Grid Setup
Introduction
What is Jenkins?
Jenkins is an open source continuous integration server. It support hundreds of
different 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 Trial
2. Select necessary browsers
3. Start Grid
Simpler Selenium Grid Setup
Simpler Selenium Grid Setup
Questions?
Q & A

Run Selenium Tests With Jenkins and BrowseEmAll

  • 1.
  • 2.
    Today we willcover 1. What is Jenkins? 2. What is Selenium? 3. Run Selenium Tests on Build 4. Using Selenium Grid 5. Simpler Selenium Grid Setup Introduction
  • 3.
    What is Jenkins? Jenkinsis an open source continuous integration server. It support hundreds of different building, deploying and automation types through plugins.
  • 4.
    Supported by allmajor browser vendors: What is Selenium? Free and open source browser automation framework.
  • 5.
    Run Selenium Tests Asimple Selenium test case: [Test] public void TestWithFirefox() { IWebDriver driver = new FirefoxDriver(); driver.Navigate().GoToUrl(TestUrl); Assert.IsFalse(string.IsNullOrEmpty(driver.Title)); driver.Quit(); }
  • 6.
    Run Selenium Tests ConfigureJenkins to run the test (nunit):
  • 7.
    • Tests rundirectly 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:
  • 8.
  • 9.
    Using Selenium Grid Simplechange 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(); }
  • 10.
    Using Selenium Test Nochange to Jenkins necessary!
  • 11.
    • Tests runon 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:
  • 12.
    Simpler Selenium GridSetup Setup a Selenium Grid in 3 Steps (no requirements)! 1. Install BrowseEmAll Trial 2. Select necessary browsers 3. Start Grid
  • 13.
  • 14.
  • 15.