Skip to main content

Selenium Capabilities for version >= 4

In addition to the capabilities supported in selenium version 3, there are some new capabilities that are introduced in theSelenium version >= 4.

KeyValuesCapability DescriptionDefault ValueAliasValue TypeExamplePossible Errors
useruser: "Username"
Example: harshitp
Can be found under your LambdaTest profile. If you are already logged into LambdaTest, then the Desired Selenium Capabilities Generator will automatically fetch your LambdaTest username under the desired Selenium capabilities class.
capabilities.setCapability("user","harshitp");
MandatoryusernameStringIf you are already logged into LambdaTest then the Desired Selenium Capabilities Generator will automatically fetch your LambdaTest username under the desired Selenium capabilities class.
capabilities.setCapability("user","harshitp");
401
Unauthorized
case sensitive
accessKeyaccessKey: "Access Key"
Example: 123ABC
Can be found under your LambdaTest profile. If you are already logged into LambdaTest, then the Desired Selenium Capabilities Generator will automatically fetch your LambdaTest Access Key under the desired Selenium capabilities class.
capabilities.setCapability("accessKey","123ABC");
MandatorykeyStringcapabilities.setCapability(""accessKey"",""123ABC"");401
Unauthorized
case sensitive
driver_versionExample: "driver_version" : "99.0"Used to specify the driver version of the browser you want to run the test on. Make sure to 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)This capability is used to declare the specific browser version on which you want your test automation scripts to be executed using our Selenium Automation Grid. Make sure to provide a valid browser version in your desired Selenium capabilities class.
capabilities.setCapability("browserVersion","79.0");
You can use "latest", "lates-1" and so-on to select latest browser version
latestversionStringcapabilities.setCapability("browserVersion","91.0");
capabilities.setCapability("browserVersion","latest");
capabilities.setCapability("browserVersion","latest-1");
Case Sensitive
Invalid version error
latestThe latest keyword will help you run your test cases over the most recent browser version available at LambdaTest.
capabilities.setCapability("version","latest");
latest-Nlatest-5This would allow you to execute your test over the older browser versions. Here, N represents an integer. So if you wish to test your website over the 5 most recently released browser versions. You can do so using 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
This capability is used to specify the platform on which you wish to run your Selenium automation testing. If a platform for testing is not declared then LambdaTest will map your test to a relevant operating system for the selected browser.
So, if you wish to perform Selenium automation testing of your web application on Windows 11 then you need to mention the below line of code in your Desired Selenium Capabilities class.
capabilities.setCapability("platformName", "Windows 11");
Similarly for macOS, if you wish to perform Selenium automation testing of your web application on macOS Monterey then you need to mention the below line of code in your Desired Capabilities class.
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"To define Selenium version for test session.Dynamic map by systemseleniumVersion,seVersionString
idleTimeout-To define idle Timeout.600 secidle

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

Book Demo

Help and Support

Related Articles