Q: Should you use Selenium 3? A: Probably. I have.

TLDR; moving between Selenium 2.53.1 and 3.0.1 takes very little effort. You should probably try it.

Wow, so Selenium 3.0.0 and then Selenium 3.0.1 in just a few days. Should you use it?

I have a fairly small set of tests that I use on my Selenium WebDriver Online Course and I’ve run these against pretty much every version of Selenium WebDriver and browser version released.

I spent time last week and this week running them against:

  • Selenium 2.53.1
  • Selenium 3.0.0
  • Selenium 3.0.1

To be honest, I wasn’t expecting Selenium 3 to move out of Beta so fast. I wasn’t expecting this extra work so soon. But having a stable version is all the better because now I don’t have to answer questions about beta software.

The most obvious difference between Selenium 3.0.1 and Selenium 3.0.0, for me, was that HTMLUnit (v 2.23) works in Selenium 3.0.1. So I wouldn’t use Selenium 3.0.0.

Now my choice is between 2.53.1 or 3.0.1

Getting Started

Creating instructions to help people get started with WebDriver is a painful job when the version keeps changing and drivers keep changing names so I’m happy for some stability

I’ve updated my Start Using Selenium WebDriver project:

https://github.com/eviltester/startUsingSeleniumWebDriver

  • to use 3.0.1 in the pom.xml
  • updated the speedrun install notes

I’ve left instructions for 2.53.1 in there, but I’ll phase those out after a few point releases of Selenium 3.

I recommend that people starting to learn Selenium WebDriver use Selenium 3.0.1 and use ChromeDriver as their default browser.

  • you’ll be up to date
  • you’re more likely to receive support rather than “upgrade to Selenium 3.0.1”

Why ChromeDriver?

Because it is much more mature than GeckoDriver, and if you do want to drop back to Selenium 2.53.1 you won’t have to make any changes.

WebDriver in CI locally and with Cloud vendors

I have a simple CI project on github

I run this locally on a bunch of browsers through Jenkins, and on travis-ci, and against SauceLabs and BrowserStack.

I had to make minor code changes when starting Firefox to upgrade to Selenium 3 and I found no obvious issues.

So I have upgraded my wdci project to use Selenium 3.0.1

  • SauceLabs:
    • Windows 10 – Edge v 14.14393
    • Windows 10 – Chrome v 53.0
    • Windows 10 – IE v 11.103
    • Windows 10 – FIREFOX v 49.0
    • Apple Mac – OS X 10.11, Safari 9.0
  • BrowserStack:
    • Windows 10 – Edge v 13
    • Windows 10 – Chrome v 53.0
    • Windows 10 – IE v 11
    • Windows 10 – FIREFOX v 49.0
    • Apple Mac – “El Capitan”, Safari 9.1
  • Locally
    • Windows 10 – Edge v 13
    • Windows 10 – Chrome v 53.0
    • Windows 10 – IE v 11
    • Windows 10 – FIREFOX v 49.0
    • Windows 10 – HTMLUnit v 2.23
  • Travis-ci
    • Linux HTMLUnit v 2.23
    • Linux Firefox v 47.1

All I had to change was how I started Firefox browser. Now this isn’t a particularly large set of tests, or even complicated tests. So it might not be enough to convince you.

What about Grid?

I normally try and use remote grids and they worked fine.

I did try on a local grid and the only thing I had to change was the version number in the file name of the selenium jar. Everything else worked for me.

Admittedly I don’t ‘do’ much with the local grid. But for basic usage I found no issues.

In fact, GeckoDriver v 0.11.1 worked better from a grid node, than it did from calling directly.

What about bigger code bases?

I haven’t found any issues with ‘Selenium’ in my main code.

My issues tend to be cross-browser or ‘cross-driver’ related, rather than Selenium related. And mainly relate to synchronisation – the bane of cross-platform execution.

i.e. Moving from Selenium 2.53.1 to 3.0.1 made no obvious difference to Edge, IE, Chrome, Safari

For Firefox, clearly we have to change how we instantiate the driver, and GeckoDriver is still a work in progress. But the legacy Firefox driver in Selenium 3.0.1 works just as well as the one in 2.53.1 so if you’re still using the FirefoxDriver rather than GeckoDriver I don’t think you’ll notice a difference during execution.

Issue Conflation

The problem I found was my tendency to conflate ‘driver’ issues with ‘Selenium’ issues.

It is easy to do that since we tend to upgrade driver versions at the same time as Selenium, and – in the case of HTMLUnit, I had to update the driver when I updated selenium.

But by moving to Selenium 3, we will hopefully have less of that confusion since the separation between driver and Selenium becomes much cleaner.

Summary

  • I have updated all my teaching projects to Selenium 3.0.1
  • It doesn’t take much to upgrade to Selenium 3. Hopefully for most projects it is a small tweak to the driver abstraction layer and you’ll be up and running quickly.
  • And you can continue using FirefoxDriver in legacy mode if that is still your default browser and driver.
  • Remember not to conflate ‘driver’ issues with Selenium 3 ‘issues’.

Since it is so easy to upgrade, and drop back to 2.53.1 if you need to. I think it is worth trying.

 

NOTE: 20161020 – updated to say that local grid worked fine when I tried it too.

This entry was posted in Selenium Simplified Blog, WebDriver. Bookmark the permalink.

24 Responses to Q: Should you use Selenium 3? A: Probably. I have.

  1. shivani says:

    Does Selenium 3.0 is supported by window 8.1 as i getting error like
    ????? ??, ???? ?:??:?? ??????? org.openqa.selenium.remote.ProtocolHandshake createSession
    INFO: Attempting bi-dialect session, assuming Postel’s Law holds true on the remote end

    while using gecko driver with Firefox version 50.

  2. Waheed Ahmed says:

    I have selenium 3 and mozilla firefox version 50.1.0 and seeing the below error please help

    org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
    d}.xpi”,”installDate”:1483019453938,”updateDate”:1483019453938,”applyBackgroundUpdates”:1,”skinnable”:true,”size”:21152,”sourceURI”:null,”releaseNotesURI”:null,”softDisabled”:false,”foreignInstall”:false,”hasBinaryComponents”:false,”strictCompatibility”:true,”locales”:[],”targetApplications”:[{“id”:”{ec8030f7-c20a-464f-9b0e-13a3a9e97384}”,”minVersion”:”50.1.0″,”maxVersion”:”50.1.0″}],”targetPlatforms”:[],”seen”:true}
    1484372043508 addons.xpi DEBUG getModTime: Recursive scan of {972ce4c6-7e08-4474-a285-3208198ce6fd}

    • Alan says:

      You don’t mention what version of GeckoDriver you are using, make sure that it is up to date.

      Check ChromeDriver works – just to make sure that your machine config isn’t giving you any issues.

    • usman says:

      same issue here

      • Alan says:

        What versions are you using? Do other drivers like ChromeDriver work?

        • Jan says:

          Hi Alan

          I’m encountering similar issue as they are. I’ve also tried running other drivers (e.g. ChromeDriver), it was working fine. I’m using Selenium 3.0.1, GeckoDriver v0.14.0 and Firefox 51.0.1.

          • Alan says:

            Are you running with Java 1.8?

            I have never been able to replicate this issue, you might have to ask in Selenium forums.

            or Google “org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host” and see if any of the answers help your situation.

  3. Deva says:

    Hi,
    I am using Firefox 51.0.1. I have installed Firebug and Firepath. I could see Firebug icon on the browser.I do not see Firepath icon. Is there a bug in Firefox 51.0.1?

    Please advise.

  4. Raghu says:

    I m currently using Selenium 2.53.1 with Firefox version 34.1 which works fine. But now i want Selenium scripts to be executed in Firefox Versions 47 and above till recent version. So my concern is Do i need Gecko driver for this OR Selenium 3 alone can do the job ?

  5. Oleg Gontar says:

    With chrome it is working fine. I can open a firefox instance but than I am unable to do anything with that, not even moving to another url. IE seems to be not synchronous, Chorme seems to send browser loaded etc messages and selenium waits for that, in IE it tries to get the elements immediately and failing (unlike in chrome). I have all latest drivers, latest selenium 3.3.0 c#, i have 1.8 java, still not working 🙁

  6. pramila says:

    Hi,

    I am using selenium 3.3 version, firefox 52, and geckodriver-0.15.
    In my case,sendkeys are not working.Is there any issue with sendkeys?
    So if i want to use selnium 2.5 and firefox older version.which firefox version i have to use ?

    Do i have to uninstall new firefox version and have to download old version?

    Can you please suggest
    Thanks,
    Pramila

    • Alan says:

      I have encountered no issues with sendkeys – for older versions of firefox I’d recommend using portable firefox – see other posts on this site for details.

  7. ARJUN says:

    Selenium 3.0 not working accordingly in the below program

    import java.util.Iterator;
    import java.util.Set;
    import org.openqa.selenium.By;
    import org.openqa.selenium.Keys;
    import org.openqa.selenium.WebDriver;
    import org.openqa.selenium.WebElement;
    import org.openqa.selenium.firefox.FirefoxDriver;
    import org.openqa.selenium.interactions.Actions;

    public class xx
    {

    public static void main(String[] args) throws InterruptedException {
    WebDriver driver=new FirefoxDriver();

    driver.get(“https://accounts.google.com/signup”);

    WebElement txtFName=driver.findElement(By.name(“FirstName”));
    WebElement txtLName=driver.findElement(By.name(“LastName”));
    //Type “webdriver” in First Name
    txtFName.sendKeys(“webdriver”);
    //Create an object for Actions Class

    Actions a = new Actions(driver);
    //select the value which is typed in FirstName field
    a.sendKeys(txtFName, Keys.chord(Keys.CONTROL,”a”)).perform();

    //Performing copy action using CTRl+C
    a.sendKeys(Keys.chord(Keys.CONTROL,”c”)).perform();

    //Performing paste action using CTRL+V in LastName field
    a.sendKeys(txtLName, Keys.chord(Keys.CONTROL,”v”)).perform();
    Thread.sleep(2000);
    }
    }

    • Alan says:

      Does’t work in what way?

      – What error do you see?
      – What were you expecting to happen that does not happen?
      – Which version of Selenium 3 are you using?
      – Which version of Firefox?
      – Which version of GeckoDriver?
      – Which operating system?
      – Does it only fail on Firefox or does it also fail on Chrome?
      – Did you try it on Edge?
      – Did the code work on Selenium 2 and therefore is only an issue after you switched to Selenium 3?

  8. Avinaash says:

    I have installed jdk 1.8
    eclipse Mars 1
    selenium 3.4
    chromeDriver 2.53
    I have windows 7 ultimate
    When running selenium code
    its gives error IllegalStateException
    but java programs works fine in eclipse
    can you suggest me a solution to this
    Thanks in advance

    • Alan says:

      Make sure you are using the most up to date version of Selenium (3.6.0) and ChromeDriver (2.33). You seem to be assuming the problem is related to an interaction of Selenium with Eclipse – if you run your code from the command line and receive the same error then you know that Eclipse is not the problem. I don’t know what your code is doing at the point it throws an illegalStateException.

Leave a Reply

Your email address will not be published. Required fields are marked *