Get Started with Web Testing

Run your first Selenium test on webmate by creating an API key, selecting a browser environment, and sending the session to the webmate Selenium hub.

You will learn how to generate the API key required for webmate tests, deploy a device, and interact with the Selenium session.

Generating an API key

We start this article in our General Profile Information view. To get there please look into this article .

Click API key in the left sidebar.

Provide a name for the new API Key to identify it later. Then click Create New Key.

The new API Key will be shown to you.

Please make sure to copy it for use, as it will be shown only once. Do not store it in a location where someone else can access it.

General Setup

Integrating existing Selenium tests with the webmate infrastructure requires replacing the WebDriver endpoint and adding webmate-specific WebDriver capabilities. For the migration path, see Use Existing Tests with webmate .

Use a current W3C-compatible Selenium client, such as Selenium 4. Selenium 3 is no longer supported for new webmate browser sessions.

The complete example at the end of the page includes the full code in one block.

Setting up the browser

First, define the login credentials for webmate, the project ID where the tests should run, and the Selenium URL for webmate.

Specify the browser and standard browser capabilities to create the RemoteWebDriver and seleniumSession.

The browserName can be any of the following: APPIUM, CHROME, FIREFOX, IE, EDGE, SAFARI, OPERA. The platformName is a string of the following format: platformType_platformVersion_suffix. The platformType can be any of the following: Android, iOS, WINDOWS, MACOS, UBUNTU. platformVersion is the version of the operating system (for macOS this is the release name, not the version number. e.g. MACOS_Monterey_xx), and the suffix is for example 64 for an 64 bit OS.

Here you have to check similarly to the OS you deployed that the browser version is available on the device that was deployed in the devices menu of your project. When a device is already deployed, click on Details and switch to machine.browsers to see a list of all browser version available on this device.

webmate installs required browsers dynamically for the selected environment where supported. Do not base new test setup on legacy browser templates; choose the browser, browser version, and platform through capabilities instead.

This small set of capabilities is enough to start a Selenium test with webmate. To organize information in TestLab, add more webmate-specific capabilities.

The first enables the test to automatically take screenshots when the view changes, so you can take a look at the test in the test lab and see exactly what the browser did. To group the tests, you can name them and provide tags to filter them later. For tags and test names, see Organize webmate Tests .

Interacting with the browser

You can visit webpages by calling

All code

Use the complete code below as a copyable starting point. The example is embedded directly from the webmate-sdk-samples (opens in a new tab)

and webmate-sdk-js-samples (opens in a new tab)

repositories, so what you see here is exactly what compiles and runs:

Next steps

This is the basic Selenium setup for the webmate Selenium hub. The webmate SDK provides more features for automated and manual workflows. For SDK workflows, see Using the SDK .