Could not start selenium browser session because browserurl does not include “http”

I was helping a friend out last weekend, and he was getting an error

java.lang.RuntimeException: Could not start Selenium session: Failed to start new browser session: Error while launching browser

at com.thoughtworks.selenium.DefaultSelenium.start(DefaultSelenium.java:89)

This was strange because looking at his code everything seem to be properly set up, i did some debugging and I discovered that the session in the selenium object was null, this suggested that we weren’t initializing the selenium object properly.

In the constructor code, my friend had put

DefaultSelenium selenium = new DefaultSelenium(“localhost”, 4444, “*firefox”, “www.yahoo.com”);

That looked okay to me until i saw that the browserurl was missing the “http://” part.

So i changed this to

DefaultSelenium selenium = new DefaultSelenium(“localhost”, 4444, “*firefox”, “http://www.yahoo.com”);

And we had the test running again.

I am not sure if this is a selenium bug or if it is a user error, i have always specified “http://” when i initialise my tests. Anyway there you go …….

Advertisements
This entry was posted in Software Testing and tagged , . Bookmark the permalink.

5 Responses to Could not start selenium browser session because browserurl does not include “http”

  1. alienintheheights says:

    This post provided the clue I needed. I had the same DefaultSelenium error, the cause of which ended up being a typo similar to the one above. I wish their logging provided a bit more insight for problems like that. Anyway, thanks.

  2. softfree says:

    Thank you..really informative!!

  3. Karan says:

    Thanks a lot! That helped.

  4. Swetha says:

    Thanks a lot.. It solved my issue 🙂

  5. Bessie says:

    I wanted to thank you for this very good read!! I definitely loved every bit of it.

    I’ve got you book marked to check out new stuff you post…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s