Skip to main content

Selenium Capabilities for Version 4 and Above

In addition to the capabilities supported in Selenium version 3, Selenium version 4 introduces the following new capabilities.

Capabilities Reference


Use these capabilities to configure authentication, browser version, platform, and session settings for Selenium 4.

KeyValuesCapability DescriptionDefault ValueAliasValue TypeExamplePossible Errors
useruser: "Username"
Example: YOUR_LAMBDATEST_USERNAME
Find this under your TestMu AI profile. If you are already logged into TestMu AI, the Desired Selenium Capabilities Generator automatically fetches your TestMu AI username under the desired Selenium capabilities class.
capabilities.setCapability("user","YOUR_LAMBDATEST_USERNAME");
MandatoryusernameStringIf you are already logged into TestMu AI then the Desired Selenium Capabilities Generator automatically fetches your TestMu AI username under the desired Selenium capabilities class.
capabilities.setCapability("user","YOUR_LAMBDATEST_USERNAME");
401
Unauthorized
case sensitive
accessKeyaccessKey: "Access Key"
Example: YOUR_LAMBDATEST_ACCESS_KEY
Find this under your TestMu AI profile. If you are already logged into TestMu AI, the Desired Selenium Capabilities Generator automatically fetches your TestMu AI Access Key under the desired Selenium capabilities class.
capabilities.setCapability("accessKey","YOUR_LAMBDATEST_ACCESS_KEY");
MandatorykeyStringcapabilities.setCapability(""accessKey"",""YOUR_LAMBDATEST_ACCESS_KEY"");401
Unauthorized
case sensitive
driver_versionExample: "driver_version" : "99.0"Specifies the driver version of the browser you want to run the test on. Provide a valid driver version corresponding to the browser used.
capabilities.setCapability("driver_version","99.0");
Dynamic map by systemdriverVersion,driverString
browserVersionEx: 101.0 (Beta)Declares the specific browser version on which you want your test automation scripts to run using the Selenium Automation Grid. Provide a valid browser version in your desired Selenium capabilities class.
capabilities.setCapability("browserVersion","79.0");
You can use "latest", "latest-1" and so on to select the latest browser version.
latestversionStringcapabilities.setCapability("browserVersion","91.0");
capabilities.setCapability("browserVersion","latest");
capabilities.setCapability("browserVersion","latest-1");
Case Sensitive
Invalid version error
latest-The latest keyword runs your test cases on the most recent browser version available at TestMu AI.
capabilities.setCapability("version","latest");
latest-Nlatest-5This allows you to execute your test on older browser versions. Here, N represents an integer. To test your website on the 5 most recently released browser versions, use the below capability:
capabilities.setCapability("version","latest-5");
platformNameSupported Windows:
  • Windows 11
  • Windows 10
  • Windows 8.1
  • Windows 8
  • Windows 7
Supported macOS:
  • Monterey
  • Big Sur
  • Catalina
  • Mojave
  • High Sierra
  • Sierra
  • El Capitan
  • Mavericks
  • Yosemite
Specifies the platform on which you want to run your Selenium automation testing. If you do not declare a platform, TestMu AI maps your test to a relevant operating system for the selected browser.
To run Selenium automation testing on Windows 11, add the below line of code in your Desired Selenium Capabilities class:
capabilities.setCapability("platformName", "Windows 11");
For macOS Monterey, add the below line:
capabilities.setCapability("platformName", "macOS Monterey");
Select based on browser.
  • Linux
  • Windows 10
platform,OSStringcapabilities.setCapability("platformName", "Windows 10");Case Sensitive
Invalid Platform Error
selenium_versionExample: "selenium_version", "4.0.0"Defines the Selenium version for the test session.Dynamic map by systemseleniumVersion,seVersionString
idleTimeout-Defines the idle timeout for the session.600 secidle

Test across 3000+ combinations of browsers, real devices & OS.

Book Demo

Help and Support

Related Articles