user479288
user479288

Reputation:

Is there a way to run Selenium tests on a remote host?

I would like to run the following setup:

(On host_1 there would be a Jenkins instance running the tests and host_2 would be a Docker container running on host_1, and Firefox would run headless, using xvfb - but this shouldn't be relevant for the question)

To run on the same host, I would just do:

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();

But I would like the Selenium tests to use the Firefox instance on the other host. Is that possible?

Upvotes: 2

Views: 12004

Answers (2)

Shubhasmit Gupta
Shubhasmit Gupta

Reputation: 416

Use Selenium Grid. Check this link for detailed documentation.

Upvotes: 1

Master Azazel
Master Azazel

Reputation: 600

Selenium Standalone Server

The Selenium Server is needed in order to run Remote Selenium WebDriver.

Upvotes: 0

Related Questions