python - Selenium 远程 WebDriver

标签 python linux selenium selenium-webdriver

对于一个项目,我需要使用 Selenium Webdriver 在服务器上运行我的测试用例。我看过 documentation , 但我不知道如何在我的代码中实现它以及如何使用它。

我已经测试过:

driver = webdriver.Remote(command_executor='http://ip_address:4444/wd/hub/static/resource/hub.html',desired_capabilities=DesiredCapabilities.FIREFOX)

但它不起作用。

PS:我用Python做测试,Linux是我服务器的操作系统。

最佳答案

尝试

driver = webdriver.Remote(command_executor='http://ip_address:4444/wd/hub/',desired_capabilities=DesiredCapabilities.FIREFOX)`  

你在代码中使用的 URL 在我看来很糟糕:-/

关于python - Selenium 远程 WebDriver,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31539063/

相关文章:

python - 嵌套方法中的属性错误

python - 一些静态元素的快速排列

linux - 如何在整个目录上运行 dos2unix?

linux - 我的引导加载程序不能用 gcc 4.6 和 4.7 编译...只有 4.5

linux - 使用 RPATH 构建 OpenSSL?

java - 在组运行之前不执行 TestNG @BeforeGroup

python - 以编程方式检查驱动器号是否为共享/网络驱动器

Python Pyramid & Chameleon 模板语言转义 html

python - 无法点击分页中的下一个按钮

java - 使用 selenium webdriver + phantom 时无法加载 https url