2

像这样的东西有什么区别:

from selenium import webdriver

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

和这个:

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")

???

谢谢。

编辑:

我应该使用哪一个?

4

4 回答 4

4

我应该使用哪一个?

这取决于你的目标。如果您需要自动化一些测试用例,可以同时使用它们。但是如果你要开始一些大的过程,例如在你的公司测试自动化,我建议你使用 Webdriver。它会给你更多的便携性,它更现代。顺便说一句,我不确定 Selenium RC 是否会进一步开发。

于 2012-11-08T20:37:34.997 回答
3

Selenium Webdriver 是 Selenium 的较新版本(旧版本称为 Selenium RC)。它不需要外部服务器,并且比 Selenium RC 具有更好的 Web 对象支持。

如果您有选择,请使用 Webdriver。

于 2012-08-17T23:56:02.767 回答
2

Webdriver 是一个独立的 api,不需要 SeleniumRC 所做的服务器组件。

于 2012-08-17T23:52:50.097 回答
0

如果使用webdriver,则无需在运行代码之前启动 selenium rc 服务器。它直接与浏览器对象交互。

如果您需要更多说明,请通过此链接

于 2012-09-25T06:33:44.810 回答