ChromeDriver Error : Unsupported major.minor version 52.0

Came across this error while trying to get Jenkins-Selenium combination running on my machine:-

org/openqa/selenium/chrome/ChromeDriver : Unsupported major.minor version 52.0

Solution: Found out I have given Selenium v3.0.1 in my pom.xml file, which is not a stable selenium version. Reverted back the previous most stable selenium version i.e v2.53.1. This resolved my logjam.

Jenkins ERROR: Failed to parse POMs : remote file operation failed: Caused by: java.lang.NoClassDefFoundError:

Hi all,

I have recently faced a peculiar error with my Jenkins+Selenium Integration.The scripts which were running fine for many weeks suddenly started failing.The scripts would not even get invoked.

Initially before invocation of the scripts I got a failed to parse POM error. How could that happen when I have’nt changed the setup at all myself??

This was the error I saw in the Jenkins console logs :-

parsing pom error-Jenkins

Anyhow after reading a few Stack overflow posts, I got a few clues that it must be somewhere related to the default Maven installations done by Jenkins in the respective slaves.

In the Jenkins slave default path I saw there are few jars/ packages that Jenkins configures/copied on to the slave :-

Temp Maven Files copied on to Jenkins Slave

The tools folder contains the following Maven Package :-

Temp Maven Files copied on to Jenkins Slave- inside Tools Folder

I deleted the 3 jars(maven3-interceptor-commons.jar, maven31-agent.jar, maven31-interceptor.jar) and the complete ‘tools’ folder and once again re-run my automation job.

And… Voila!! The scripts were invoked fine once again! 🙂 All those files were again copied fresh to the Jenkins Slave once again.

So it looks like maybe one of the Maven jars got corrupted for some reason and were breaking the execution. The reason this could have happened is still hazy to me. But atleast we have a solution for it :).

Let me know if you come across such an error and if you were able to resolve it with this post.



Steps to get Safari Webdriver running on Mac OSX

Since this topic has not been well documented on the net and I struggled myself to get Selenium tests running on Safari browser, here are the complete set of steps to get Selenium tests up and running on Safari browsers. :-

Creating “Safari Extension” Developer Certificate

  1. Create an Apple developer account.
  • Go to
  • Click on “Member Center” on top panel.
  • Select “Create Apple ID”.
  • Go through the sign up forms and provide valid fields for a succesful sign up

2.  Login to created Apple account.

3.  Sign up for “Safari Extensions” developer

  • Click on “Certificates, Identifiers & Profiles”
  • In the “Safari Extensions’ section, click on “Join Now”
  • Go through the following steps and provide valid fields to successfully sign up for the “Safari Extensions” program

4.  Create “Developer Certificate”

  • Now inside “Certificates, Identifiers & Profiles” > “Click on Create/Add Safari Certificate”
  • You will see the following page – “About Creating a Certificate Signing Request (CSR)” Screen Shot 2015-04-15 at 1.40.24 pm
  • Click on “Continue”

You will see the following page :-Screen Shot 2015-04-15 at 1.40.42 pm

  • Upload the CSR file and Click on ‘Generate’ to generate the certificate
  • Now download the certificate once it is generated.

5. Download the certificate and install in the machine

  • Download the certificate in the download tab.
  • The certificate is downloaded as “safari_extension.cer”.
  • Double-click on the file to install the certificate in the Mac client/OSX.

6.  We have installed the safari extensions certificate for developers. Now we need to install the Safari Webdriver extension for the Safari Browser.

 Installing the Safari Webdriver extension in the Safari Browser

  1. Download latest Selenium Safari extension.

2.  Install the Safari Extension

  • Double-click on the “SafariDriver.safariextz” file.
  • You will get a prompt asking “Are you sure you want to install the extension “WebDriver”?“.
  • Click on “Install”

3.  Provide the default setting for the Selenium Webdriver Extension.

  • Click on “Safari” > “Preferences” > “Extensions” > You will find Selenium extension
  • Select “Enable Webdriver”

Now all the settings are done and now we should be able to launch our Selenium scripts using Safari Webdriver.

Launching Safari Webdriver

Webdriver driver = new SafariDriver();                

driver.get(” );

builder = new Actions(driver);

This should launch your safari browser with the Safari Webdriver Extension 🙂

Hope this article comes of use to you all.

UPDATE (18th June,2015): With the latest update of Yosemite 10.10.3 & Safari 8.0.6, the execution on Safari Browsers has become unstable & unreliable.

Selenium Scripts work best on 10.10.2 , Safari 8.0.3 & Selenium 2.45.0 combination.

So if OSX prompts you for updates, please DO NOT install them if you want to run automation on Safari Browser



Decreasing False Positives in Automated Testing

Hey all,

I attended a webinar last night on “Decreasing False Positives in Automated Testing”. This event was conducted by Sauce Labs and webinar presented by Anand Ramakrishnan, QA Director, QASource

There was very good learning in it and I would like to share in brief various things which were discussed.

All attendees of the meeting were initially asked to fill a small survey question…

Q. In your organization, what is the primary objective of using automation?

Options: A. Save money

                B. Save time/ release faster –>This option got the maximum no. of votes 

                C.More QA coverage

My vote too was for the same option. Looks like the industry on the whole is facing a similar challenge of meeting faster release times.

Moving on to the topic…

 Q.What are False Positives?

Ans. Tests that are marked as failure, when in reality they should have passed. In other words, they are false alarms.

 We had another survey question just then :-

  1. What is the percentage of false positives within your respective automation tests?

Options: A. <5%

                B. 5-15

                C.15-25%        –> This option got the maximum no. of vote

                D. >25%

My vote was for option B. Though we are on the better side of things, we still need to further reduce these false positives.

Reasons why tests encounter false positives : –

  1. Flawed automation approach
  2. Choosing the wrong framework
  3. Inadequate time to accommodate a test plan/design.
  4. Hard-coded waits/delays
  5. Less modularity of code
  6. Relying on co-ordinates & xpath of objects
  7. Change in UI element id, classname etc
  8. Shared environment for QA as well as automation.
  9. Slow performance of application, or particular environment
  10. Manual intervention prior to execution of automation scripts
  11. Browser incompatibilities.

Impact of False Positives :-

  • Frustration within engineering team
  • Sooner or later, test failures are ignored by stakeholders
  • Risk of overlooking potential bug
  • Babysitting of automation tests
  • Maintenance cost of automation increases

Now the most important part of the discussion.

Ways to Reduce False Positives :-

  • Deploy application on optimal configurations, for automation
  • Keep tests short and simple. Avoid trying to do too many things in a single test case.
  • Keep tests independent. No sequencing of tests
  • Provide unique identifiers while developing application itself.
  • Using right locators i.e in decreasing priority of id>classname>css locator
  • Tear-down approach. Bringing test machine to base state before/after every testcase
  • Dynamic object synchronisations. No hard-coded waits
  • Re-execution capability of test framework. In case test fails, re-execute test and if it passes to ignore the previous failure.


Benefits of Eliminating False Positives:-

  • Will not miss potential bugs
  • Certainty of application health
  • Increase in productivity
  • Save time not babysitting
  • Decrease cost of automation

Summary: It was an awesome webinar and also brings perspective on how critical automation is to meet current day SDLC challenges and how to make it more effective.

Your feedback both good & bad are always welcome.



Jenkins + Selenium Error: org.openqa.selenium.firefox.NotConnectedException

Hi all,

A small background : I run my automation suite using Jenkins on a nightly basis. The suite is maintained as a Maven Project. I run ‘mvn site’ to execute the test suite.

I encountered the following error when Latest Firefox version 36 was released and I had to upgrade my selenium jars to the latest version i.e from 2.44.0 to 2.45.0. :-


The error seen is

org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host

I had promptly downloaded the latest selenium standalone jar 2.45.0 and configured the build path with the latest jar. The scripts were executing successfully while being run individually but while running as a test suite using the ‘mvn site’ command, my execution was failing.

 Solution: Initially I thought that the execution was failing due to some configuration on Jenkins. But later after some debugging I realised that I had not updated pom.xml with the latest selenium version.






Next time Selenium releases a new version, I know what to do now! 😀



Selenium Error: StaleElementReferenceException

Most automation tools depend on the concept of the page has finished loading. With AJAX and Web 2.0 this has become a grey area. META tags can refresh the page and Javascript can update the DOM at regular intervals.

For Selenium this means that StaleElementException can occur. StaleElementException occurs if I find an element, the DOM gets updated then I try to interact with the element.

Actions like:


are not atomic. Just because it was all entered on one line, the code generated is no different than:

By fooID ="foo");
WebElement foo = driver.findElement(fooID);;

If Javascript updates the page between the findElement call and the click call then I’ll get a StaleElementException. It is not uncommon for this to occur on modern web pages. It will not happen consistently however. The timing has to be just right for this bug to occur.

Generally speaking, if you know the page has Javascript which automatically updates the DOM, you should assume a StaleElementException will occur. It might not occur when you are writing the test or running it on your local machine but it will happen. Often it will happen after you have 5000 test cases and haven’t touched this code for over a year. Like most developers, if it worked yesterday and stopped working today you’ll look at what you changed recently and never find this bug.

So how do I handle it? I use the following click method:

public boolean retryingFindClick(By by) {
        boolean result = false;
        int attempts = 0;
        while(attempts < 2) {
            try {
                result = true;
            } catch(StaleElementReferenceException e) {
        return result;

This will attempt to find and click the element. If the DOM changes between the find and click, it will try again. The idea is that if it failed and I try again immediately the second attempt will succeed. If the DOM changes are very rapid then this will not work. At that point you need to get development to slow down the DOM change so this works or you need to make a custom solution for that particular project.

The method takes as input a locator for the element you want to click. If it is successful it will return true. Otherwise it returns false. If it makes it past theclick call, it will return true. All other failures will return false.

Personally, I would argue this should always work. If the developers are refreshing the page too quickly then it will be overloading the browser on the client machine.


Migration from Selenium RC to Webdriver – Executing Javascript APIs

Executing Javascript Doesn’t Return Anything

WebDriver’s JavascriptExecutor will wrap all JS and evaluate it as an anonymous expression. This means that you need to use the “return” keyword:

String title = selenium.getEval("browserbot.getCurrentWindow().document.title");


((JavascriptExecutor) driver).executeScript("return document.title;");

Including TestNG Reports within the Jenkins Email Notifications.

Hi All,

This post mainly is for those who have Selenium scripts running as part of their Jenkins Jobs & want to include these results within the main body of the Jenkins Emailable Notification.


1.For the Post Build Actions > Select Editable Email Notifications

2.If this option is not there as part of post build actions, the email-ext-plugin is needed to be installed on Jenkins. Go to

3.Select Content Type as HTML(text/plain)

4.In the Default Content section : remove $DEFAULT_CONTENT.Place the following code to inject your html report into the default content :-

${FILE,path=”relative path to html file”}

Eg: ${FILE,path=”MyWorkspace/MyProj/test-output/emailable-report.html”}

This will place the emailable-report.html content in your email body.

5.You can further choose the various trigger points to include the test report i.e on success, test failures (any) , unstable etc.

Hope this is of use to someone struggling out there and landed up here!



Creating Jenkins Nodes dedicated for running Selenium Automation Scripts

If you are having problems running your Selenium Test-Suite on a remote node from Jenkins, you probably need this blog the most! After encountering a lot of wierd jenkins errors like :-

Headless Exception Error:-

I got this error when I was trying to execute my Selenium Scripts on a remote node using a SSH connection.


2.Another error saying ‘Channel stopped’ on Mac when node was communicated using SSH:-


3.Error when Jenkins node used as a service on Win:-

COM method IWebBrowser2::Navigate(2) failed

I observed this error in my stacktrace while trying to execute my Selenium script on Internet Explorer browser.

A lot of searching & googling, I finally come up with my solution!! Eureka!… hehe…

Setting up a Jenkins node dedicated for Automation Executions:-

1.Go to Jenkins > Manage Jenkins > Manage Node > New node

2.Enter node name , select dumb slave

3.Give remote working directory for your node.

4.Select ‘Launch Slave Agents via Java Web Start’ in Launch Method.This is very important for machines which run Selenium Automation Scripts.

5.I have 2 dedicated nodes i.e 1 Win Machine & 1 Mac Machine for running my automation test-suite. This method is the way to go for hassle-free execution.

Note:I previously tried running these scripts using SSH & as a windows service(for Win OS only) on my remote nodes , and the Automation Scripts would fail as Selenium webdrivers do not support automation processes which run as a Windows Service or a headless execution(in case of SSH).

Mapping a node for a particular job(for beginners):-

Enter the node name in the “Restrict where the project can be run” field in your Jenkins job and you are good to go!



Selenium Scripts Integration with Jenkins

So this is my first tech blog!….haha…. Fingers crossed…. Here we go!


There are many ways to trigger Selenium automation scripts which are collated into a test-suite. The method I have employed is as follows :-

1.’Mavenise the Project’ – I created a new Maven Project in my eclipse setup and copied all my automation scripts into the src/test/java/.

2.I create a ‘testng.xml‘ file which consists of the various tests I want to run as part of the test suite.

3.I resolve all the dependencies on my Maven Project using ‘mvn dependency:tree’.

4.In the pom.xml file , I give the name of this xml file.

5.I also enter various plugins needed for execution,report generation etc in the pom.xml file.

6.One such plugin is the maven-site-plugin. For more info goto

7.Another plugin I use is the maven-surefire-plugin.  For more info goto

8.Finally to run the test-suite I run the ‘mvn site’ command from the folder root directory.

9.The test-suite gets executed and the surefire report is generated in **/target/site/surefire-report.html

There are other ways of running test-suites as well like ant scripts etc, but I personally find this the easiest way to trigger a test automation suite and get a nice meaning report at the end of it! The surefire-report.html generated in the target/site folder is awesome!

Now if you want to run this test-suite as a part of a Continous Integration process using Jenkins you can do the following :-

1.Create a new Jenkins job (Select Maven Project).

2.Give the destination of the pom.xml file ( relative to the node root).

3.In the goals section enter ‘site’.

4.On building the project, you have your automation scripts running.

5.Next step is to append the surefire-report into the main Jenkins notification email.

All the best with whatever IT is that you are doing ( which redirected you here 🙂 )