Monday, April 27, 2015

Traceability Matrix using TestLink/github and Jenkins/Hudson

               At my current work place we were using TestLink (We have moved to SuiTest now) for writing TestCases and my boss asked me to see if all the Stories have Test Cases or not. I have written this simple program and integrated with Jenkins to get a nice graph showing Test Case traceability like below



In the above graph red line shows total Stories in a sprint, green line shows Stories which have at least one Test Case and blue line shows stories which have at least one automated test case.

To achieve this we have followed below rules as a Team.


  1. Test Suite in TestLink has same name as Story ID in JIRA
  2. Test Suite Name in Java/Script in github has same as Story ID in JIRA
This traceability program takes stories in a Sprint as input and do following things
  1. Connects to TestLink and searches for Test Suites corresponding to Stories, also creates statistics 
  2. Connects to github and searches for Test Suites corresponding to Stories, also creates statistics
A Jenkins job is created with configuration as follows









The code uses org.eclipse.egit.github.core and testlink-java-api to connect with github and TestLink respectively




 

Github Connector is as follows


TestLink Connector is as follows



Above program will also list down stories which needs test cases.



Now you are ready to trace which stories have Test case and which doesn't have. :)

~Yagnanarayana Dande


Automated Testing of Multi Browser Support using SauceLabs and Jenkins/Hudson


               Its not an easy task to run automated tests on multiple browsers and gather results back to a single location. Its not a good option to have your own setup of all Operating System + Browser combinations in a lab if you don't have a dedicated operations team.

             We can use cloud solutions like Saucelabs for this purpose. Saucelabs provides on demand instance of Operating System + Browser. It uses Remove Webdriver concept to run Selenium Tests on these instances.

             You can use following code to start a remote Run


Now create a Jenkins job with configuration as







Now you are ready for your Multi Browser tests. Start a build and test will execute on Saucelabs. 

Once you launch your tests, logon to saucelabs.com and watch the live steaming on how tests are being executed or wait till end to see TestNG report on Jenkins


~Yagnanarayana Dande

Running Selenium Tests on a headless Jenkins Server

                            QA needs to execute their daily Sanity Tests on Jenkins. To run Selenium Tests we need a machine connected to monitor. And if we don't have such an arrangement then we can follow the steps below to run Selenium Tests on a headless Jenkins Server.

Never run daily runs on tools like Saucelabs.com or browserstack as its a costly affair.

1. Install Xvfb on Jenkins Server


yum install xorg-x11-server-Xvfb

2. Install Firefox on Jenkins Server

yum install firefox
3. Install https://wiki.jenkins-ci.org/display/JENKINS/Xvfb+Plugin on Jenkins


4. In you Job, configure as follows


5. When you run the Job, it will create a screen and execute tests on that screen with GUI


Enjoy your daily runs now :)

~ Yagnanarayana Dande