What is the difference between Selenium's Remote Control vs WebDriver?
Asked Answered
D

2

20

I'm not sure I quite understand the difference. WebDriver API also directly controls the browser of choice. When should you use selenium remote control (selenium RC) instead ?

Right now, my current situation is I am testing a web application by writing a suite with Selenium WebDriver API and letting it run on my computer. The tests are taking longer and longer to complete, so I have been searching for ways to run the tests on a Linux server.

If I use Selenium Remote Control, does this mean I have to rewrite everything I wrote with WebDriver API?

I am getting confused with Selenium Grid, Hudson, Selenium RC. I found a Selenium Grid plugin for Hudson, but not sure if this includes Selenium RC.

Am I taking the correct route? I envision the following architecture:

  • Hudson running on few Ubuntu dedicated servers.
  • Hudson running with Xvnc & Selenium Grid plugin. (Do I need to install Firefox separately ?)
  • Selenium grid running selenium RC test suites.

I think this is far more time efficient than running test on my current working desktop computer with WebDriver API.

Diuretic answered 24/10, 2010 at 10:11 Comment(1)
Exact duplicate of what's the relationship between selenium rc and webdriver?Sos
M
3

As far as I understand, Webdriver implementation started little later than Selenium RC. From my point of view, WebDriver is more flexible solution, which fixed some annoying problems of SeleniumRC.

WebDriver provides standard interface for testing web GUI. There are several implementations of this interface (HTTP, browser-specific and based on Selenium). Since you already have some WebDriver tests, you must be familiar with basic docs like this

The tests are getting longer and longer to complete, so I have been searching for ways to run the tests on a linux server.

Did you try to find actual bottlenecks? I'm not sure, that elimination of WebDriver layer will help. I think, most time is spent on Selenium commands sending and HTTP requests to system-under-test.

If I use sleneium remote control, does this mean I have to rewrite everything I wrote with WebDriver API ?

Generally, yes. If you did not implement some additional layer between tests code and WebDriver.

As for Selenium Grid: You may start several Selenium RC instances on several different [virtual] nodes, then register them in Selenium Grid. Your tests connect to Selenium Grid, and it redirects all commands to SeleniumRC instances, coordinating them in accordance with required browsers.

For details of hudson plugin you may find more info here

Melonie answered 24/10, 2010 at 10:55 Comment(0)
C
14

WebDriver is now Selenium 2. The Selenium and WebDriver code bases are being merged. WebDriver gets over a number of issues that Selenium has and Selenium gets over a number of issues that Webdriver has.

If you have written your tests in Selenium one you don't have to rewrite them to work with Selenium 2. We, the core developers, have written it so that you create a browser instance and inject that into Selenium and your Selenium 1 tests will work in Selenium 2. I have put an example below for you.

// You may use any WebDriver implementation. Firefox is used here as an example
WebDriver driver = new FirefoxDriver();

// A "base url", used by selenium to resolve relative URLs
String baseUrl = "http://www.google.com";

// Create the Selenium implementation
Selenium selenium = new WebDriverBackedSelenium(driver, baseUrl);

// Perform actions with selenium
selenium.open("http://www.google.com");
selenium.type("name=q", "cheese");
selenium.click("name=btnG");

Selenium 2 unfortunately has not been put into Selenium 2 but it shouldn't be too long until it has been added since we are hoping to reach beta in the next couple of months.

Conjuncture answered 24/10, 2010 at 11:43 Comment(3)
+1 .. this helped me get my code fixed. Switching from the IDE to WebDriver has been the most annoying thing. Selenium's documentation is horrible. I keep having to figure out exception after exception. Do you happen to know any documentation that helps with the conversion? I've gotten around the user extensions part. Now I'm trying to figure out why locators aren't working (like LinkText or XPath). Seems like the Format conversion in the IDE doesn't really work well.Investigator
Still a bit confused about how Selenium RC fits into the picture based on that answer. When you say the "Selenium and WebDriver codes bases are being merged" are you referring to Selenium RC as Selenium?Eloiseloisa
@EinDoofusyes, in this context Selenium is Selenium RC (or also known as Selenium 1.0) and WebDriver is, well... WebDriver. Together they were merged to Selenium WebDriver (aka Selenium 2.0)Promiscuous
M
3

As far as I understand, Webdriver implementation started little later than Selenium RC. From my point of view, WebDriver is more flexible solution, which fixed some annoying problems of SeleniumRC.

WebDriver provides standard interface for testing web GUI. There are several implementations of this interface (HTTP, browser-specific and based on Selenium). Since you already have some WebDriver tests, you must be familiar with basic docs like this

The tests are getting longer and longer to complete, so I have been searching for ways to run the tests on a linux server.

Did you try to find actual bottlenecks? I'm not sure, that elimination of WebDriver layer will help. I think, most time is spent on Selenium commands sending and HTTP requests to system-under-test.

If I use sleneium remote control, does this mean I have to rewrite everything I wrote with WebDriver API ?

Generally, yes. If you did not implement some additional layer between tests code and WebDriver.

As for Selenium Grid: You may start several Selenium RC instances on several different [virtual] nodes, then register them in Selenium Grid. Your tests connect to Selenium Grid, and it redirects all commands to SeleniumRC instances, coordinating them in accordance with required browsers.

For details of hudson plugin you may find more info here

Melonie answered 24/10, 2010 at 10:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.