这样的事情之间有什么区别:
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")
???
感谢。
编辑:
我应该使用哪一个?
答案 0 :(得分:4)
我应该使用哪一个?
这取决于你的目标。如果你需要自动化一些测试用例,可以同时使用它们。但是如果你要开始一些大的过程,例如你公司的自动化测试,我建议你使用Webdriver。它会给你更多的便携性,它更现代。顺便说一句,我不确定,Selenium RC是否会进一步发展。
答案 1 :(得分:3)
Selenium Webdriver是Selenium的新版本(旧版本称为Selenium RC)。它不需要外部服务器,并且比Selenium RC具有更好的Web对象支持。
如果您有选择,请使用Webdriver。
答案 2 :(得分:2)
Webdriver是一个独立的api,不需要SeleniumRC所做的服务器组件。
答案 3 :(得分:0)
如果您使用webdriver
,则无需在运行代码之前启动selenium rc服务器。它直接与浏览器对象交互。
如果您需要更多说明,请查看link。