2

What is the difference between something like this:

from selenium import webdriver

browser = webdriver.Firefox()
browser.get('http://www.ubuntu.com/')

and this:

from selenium import selenium

selenium = selenium("localhost", 4444, "firefox", "http://www.locationary.com/")
selenium.start()

sel = selenium
sel.open("/")
sel.type("inUserName", "email")
sel.type("inUserPass", "password")
sel.click("login@DEFAULT")

???

Thanks.

EDIT:

Which one should I use?

Marcus Johnson
  • 2,505
  • 6
  • 22
  • 27

4 Answers4

4

Which one should I use?

It depends on your goals. If you need to automate some testcases, it's okay to use both of them. But if you are to start some big process, for example testing automation in your company, I would suggest you to use Webdriver. It would give you more portability and it is more modern. By the way, I am not sure, that Selenium RC is to be developed further.

Pavel Daynyak
  • 1,714
  • 1
  • 11
  • 7
3

Selenium Webdriver is the newer version of Selenium (The old version was known as Selenium RC). It doesn't require an external server and has better web object support than Selenium RC.

If you have the choice, go with Webdriver.

CIGuy
  • 5,076
  • 28
  • 37
2

Webdriver is a self-contained api that doesn't require the server component that SeleniumRC does.

Wes
  • 42
  • 5
  • So...how do I know which one I should use?? Because I started out by using SeleniumRC and it always opened my browser...the webdriver didn't... – Marcus Johnson Aug 17 '12 at 23:54
  • 1
    Correcting myself: you still need the browser installed. Not sure if there is a headless option. – Wes Aug 17 '12 at 23:55
  • 2
    and they use different APIs (e.g. commands). Selenium RC is deprecated, which means unless you need to, you should be using WebDriver. – David Aug 17 '12 at 23:57
  • http://stackoverflow.com/questions/3619824/whats-the-relationship-between-selenium-rc-and-webdriver – Wes Aug 17 '12 at 23:57
0

If you use webdriver, there's no need to start selenium rc server before running the code. it interacts directly with browser objects.

If you need more clarification go through this link.

Pierre GM
  • 19,809
  • 3
  • 56
  • 67
Kv.senthilkumar
  • 936
  • 2
  • 16
  • 29