Getting Started - Selenium Remote Test
You can use the Testable platform as a remote Selenium grid. Each Selenium session will run on a Testable test runner according to the options you provide in your capabilities. This includes support for all Cloud providers, in your account or ours, as well as self-hosted test runners.
This guide provides a simple example to get you started using Selenium Java. This can easily adapted to other Selenium bindings. Read our Selenium remote testing guide for the full set of capabilities and commands we support.
Testable Cloud’s Selenium grid is accessible at:
https://[user]:[api-key]@agents.testable.io/wd/hub
user
can be anything you want for audit purpose. api-key
should be a valid API key for your account found after logging in under Org Management => API Keys.
Once you have your API key, you are ready to run your first test. Make sure you have your favorite Selenium bindings installed on your machine. This example uses Selenium Java:
import org.openqa.selenium.MutableCapabilities;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeOptions;
import org.openqa.selenium.remote.RemoteWebDriver;
public class Example {
public static void main(String[] args) throws Exception {
MutableCapabilities testableOpts = new MutableCapabilities();
testableOpts.setCapability("browserVersion", "Latest");
ChromeOptions options = new ChromeOptions();
options.setCapability("testable:options", testableOpts);
WebDriver driver = new RemoteWebDriver(new URL("https://remote:[api-key]@agents.testable.io/wd/hub"), options);
driver.get("https://www.google.com");
driver.quit();
}
}
This very simple example loads google.com
in the latest version of Chrome.
After running your test, you should be able to login to Testable and see your session under Recent Test Runs
.
Click the magnifying glass to view the full test report including a video recording, metrics, Selenium logs, etc.
That’s it! Go ahead and try these same steps with your own scripts and feel free to contact us with any questions.