Selenium script execution into Continuous Integration Process


                 Most of the people end up saying of integrating the Selenium Test suite with any one of the Continuous Integration server (Jenkins, Bamboo,..etc) to trigger the execution after build deployment. The suite may be Sanity, Smoke or Regression Test suite.

But here challenging part is the CI tools mostly run on Linux box and we may not have expected browser installed in it.

I have listed some solutions for CI,

1) Change the Selenium test suite browser configuration and execute it using HtmlUnitdriver or PhantomJSDriver ( Headless execution)
     
 The importance of having “headless” tests is:
    a) The majority of Linux server and Windows Core Servers deployments doesn’t have GUI at all
    b) To avoid opening the browser in the foreground during the build agent is being used for desktop applications testing which require focus

 Execute the Automation Test suite using HtmlUnitdriver by making a simple change in the test    script browser configuration and compare its test results with Chrome browser test execution result to see test coverage using HtmlUnitdriver.

Limitations of HtmlUnitdriver:
     • JavaScript interaction may not execute properly
     • It cannot emulate other browsers JavaScript behavior
     • Action like Keypress, tab navigation will not support

Other solution to achieve Headless Automation is,
  
          PhantomJS (ghost driver) is a headless browser with JavaScript API. It is an optimal solution for Headless Website Testing, access and manipulate webpages & comes with the standard DOM API.

2) By using Selenium Grid and RemoteWebdriver concept, we can initiate the selenium test execution in the Linux box and send the execution commands to another system which has required browser configured

Steps,
     a) Get the dedicated the system with required browser installed
     b) Start the Selenium Grid hub and node in the same machine
     c) Change the Selenium test suite browser configuration and execute it using RemoteWebdriver with local system host name

3) Using Sauce Labs (Cloud system) which provides N number of Operating systems and Browser configurations support. Its plugin let us to configure with Jenkins. It is like outsourcing the infrastructure to Sauce Labs which run tests quickly on over 800 browser/OS combinations, without disrupting our CI process and without installing and maintaining browsers locally

other common Cloud systems are Seetest, Perfecto, etc



Popular posts from this blog

Selenium Webdriver Interview Questions with Answer

Selenium IDE Interview Questions with Answer

DLL to Jar file conversion