2015-07-21 96 views
0

對於一個項目,我需要使用Selenium Webdriver在服務器上運行我的測試用例。我已經看到了documentation,但我不知道如何在我的代碼中實現它以及如何使用它。Selenium遠程WebDriver

我已經與測試:

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

但它不工作。 PS:我使用Python進行測試,Linux是我的服務器的操作系統。

+1

你提的問題是過於寬泛。更具體 –

+0

我已編輯^^' – msommer

+0

請參閱[mcve]。 *「它不起作用」*是什麼意思? – jonrsharpe

回答

1

嘗試

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

的網址,您使用的是在你的代碼中有看上去相當不錯,破我: -/

+0

謝謝,但它是什麼,我把我的代碼... – msommer

+0

但它打開一個窗口,什麼都沒有happennd ... 1min後,它說:Stacktrace:在組織。 openqa ... – msommer

+0

既然這一行本身不會做任何事情,但使用Firefox啓動硒會話,這應該是預期的結果? –