0

我想運行下面的設置:在host_1有沒有辦法在遠程主機上運行Selenium測試?

  • ,執行一些Selenium測試
  • host_2,使用Firefox

(在host_1會有運行測試的一個詹金斯實例和host_2將是一個運行在host_1上的Docker容器,並且Firefox將使用xvfb運行無頭 - 但這應該與該問題無關)

要在同一主機上運行,​​我只想做:

import org.openqa.selenium.WebDriver; 
import org.openqa.selenium.firefox.FirefoxDriver; 

System.setProperty("webdriver.gecko.driver", "/path/to/geckodriver"); 

WebDriver driver = new FirefoxDriver(); 
driver.get("https://google.com/"); 
driver.quit(); 

但我想Selenium測試使用Firefox的實例的另一臺主機上。那可能嗎?

+2

你看過Selenium Grid嗎? https://github.com/SeleniumHQ/selenium/wiki/Grid2 – jonrsharpe

回答

1

使用硒網格。 請查閱link瞭解詳細的文檔。

相關問題