我想運行下面的設置:在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的實例的另一臺主機上。那可能嗎?
你看過Selenium Grid嗎? https://github.com/SeleniumHQ/selenium/wiki/Grid2 – jonrsharpe