CAPABILITY GENERATOR

LambdaTest DocumentationAutomation Testing ● Selenium Automation Capabilities

Selenium Automation Capabilities


LambdaTest Desired Capabilities Generator autogenerates the capabilities class needed to run your Selenium and Appium automation testing scripts on LambdaTest Selenium Grid. The Capability Generator will provide you with the entire code of capabilities class based on your mouse-interactions from the UI. Also, you will get the code for your selected configurations in all of the six programming languages i.e. Java, PHP, Ruby, JavaScript, C#, and Python.

This document will teach you how to leverage LambdaTest Capability Generator to easily for declaring capabilities for both desktop and mobile browsers.

In this document, we will talk about the following:

The values provided for any capability are both, space-insensitive and case-insensitive. This means that any value you provide as Mac OS X 10.13 or mac os x 10.13 would be correct.

Selenium Capabilities


Key
Values
Capability

browserName

  • Chrome
  • Firefox
  • Safari
  • MS Edge – Microsoft Edge
  • IE – Internet Explorer

This is a mandatory & case-sensitive capability which represents the name of the selected browser.

version

Example: 78.0

This capability is for the version of the browser mentioned above. This version you provide as a desired capability needs to be a valid one.

platform

Supported Windows:

  • Windows 10
  • Windows 8.1
  • Windows 8
  • Windows 7

Supported MacOS:

  • Mojave
  • High Sierra
  • Sierra
  • El Capitan
  • Mavericks
  • Yosemite

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 10 then you need to mention the below line of code in your Desired Capabilities class.

Similarly for macOS, if you wish to perform Selenium automation testing of your web application on macOS Mojave then you need to mention the below line of code in your Desired Capabilities class.

resolution

  • 1024×768
  • 1280×800
  • 1280×1024
  • 1366×768
  • 1440×900
  • 1680×1050
  • 1600×1200
  • 1920×1200
  • 1920×1080
  • 2048×1536

This capability would help you to specify a particular screen resolution for your VM(Virtual Machine). By default, the resolution would be 1024×768.

name

Example: ToDo Sample Test

Represents the name of a test.

build

Example: 5.1

Represent the build number for your test.

Selenium 4 Capabilities


We have introduced a new tab for Selenium 4 Capabilities in our Desired Capabilities Generator. With respect to Selenium 4, there a few changes to observe while declaring the Desired Capabilities class.

Selenium 4 capabilities

Here is a table to represent the capabilities that have been updated or newly introduced for Selenium 4.

Key
Values
Capability

user

Example:
harshitp

Can be found under your LambdaTest profile. If you are already logged into LambdaTest then the Desired Capabilities Generator will automatically fetch your LambdaTest username under the desired capabilities class.

accessKey

Example: 123ABC

Can be found under your LambdaTest profile. If you are already logged into LambdaTest then the Desired Capabilities Generator will automatically fetch your LambdaTest Access Key under the desired capabilities class.

browserVersion

Ex: 79.0

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 capabilities class.

platformName

Supported Windows:

  • Windows 10
  • Windows 8.1
  • Windows 8
  • Windows 7

Supported MacOS:

  • 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 10 then you need to mention the below line of code in your Desired Capabilities class.

Similarly for macOS, if you wish to perform Selenium automation testing of your web application on macOS Mojave then you need to mention the below line of code in your Desired Capabilities class.

Appium Capabilities


We have come up with a new tab for Appium in our Desired Capabilities Generator. Here are the unique capabilities that you may have to keep in mind while executing appium tests using LambdaTest Selenium Grid.

Key
Values
Capability

deviceName

Example:

  • Galaxy S10
  • iPhone XS

This capability allows you to specify the particular device on which you wish to run your appium automation testing.

Similarly for iPhone XS, the capability would be as follow.

platformVersion

Example:

  • Android 9.0
  • iOS 12.1

This capability allows you to specify the particular Android OS version or iOS version, for which you wish to run your appium automation testing.

In case you wish to run your tests on Android version 9.0, then you will get the below capability for Java from our capability generator.

Similarly if you wish to run for iOS version 12.1, you may get the below capability from our Desired capabilities generator.

To check the entire list of devices available, along with operating systems for different desktop and mobile browsers, visit our list of browsers.

Selenium Automation Testing From Different GeoLocations


We have come up with a new Capability drop down that would allow you to run your test from different geographies across the world.

Key
Values
Capability

geoLocation

Example: US

This capability helps you to perform Selenium automation testing from different countries.

You can perform Selenium automation testing from the below listed countries.

  • Argentina
  • Australia
  • Austria
  • Belgium
  • Brazil
  • Bulgaria
  • Canada
  • Chile
  • China
  • Colombia
  • Croatia
  • Czech Republic
  • Denmark
  • Egypt
  • Finland
  • France
  • Germany
  • Greece
  • Hong Kong
  • Hungary
  • Iceland
  • India
  • Indonesia
  • Ireland
  • Israel
  • Italy
  • Japan
  • Jordan
  • Malaysia
  • Mexico
  • Morocco
  • Netherlands
  • New Zealand
  • Nigeria
  • Norway
  • Philippines
  • Poland
  • Portugal
  • Russia
  • Singapore
  • South Africa
  • South Korea
  • Spain
  • Sweden
  • Switzerland
  • Taiwan
  • Thailand
  • Turkey
  • Ukraine
  • United Kingdom
  • United States
  • Venezuela
  • Vietnam

Important Note: You cannot perform Geolocation testing with locally hosted web applications using Lambda Tunnel in a single test case. If you wish to perform both then you can leverage parallel testing to run two tests simultaneously, one for Geolocation and the other for Lambda Tunnel.

LambdaTest Advanced Capabilities


In this table, LambdaTest advanced capabilities key,values and capabilities are listed.

Key
Values
Capability

video

true, false

By default, the video is set as true. This capability helps in video recording of the complete screen while the test gets executed. You can record maximum up to 10 minutes. In case you need to turn off the video recording, you can do so by turning off the button on our Desired Capabilities Generator.

If you turn the video flag off, then for Java, it may provide the below piece of code in the capabilities class.

visual

true, false

Command by command screenshots will be recorded at each test step. By default the flag is set as off.
Note: test execution time will increase if it’s set as ‘true’.

network

true, false

Captures a recording for network packets while the test gets executed. By default, the network flag is set as false.

Note: test execution time will increase if it’s set as ‘true’.

console

true, false

Javascript logs will be recorded for the test. By default, it is set as false.

Note: test execution time will increase if it’s set as ‘true’.

tunnel

true, false

To test your locally hosted web application with Lambda Tunnel which establishes an SSH(Secure Shell) connection between your system and our cloud servers. By default, the tunnel flag, will be set as false.

Find more about Lambda Tunnel from our documentation to test on locally hosted web applications.

timezone

Example: UTC-05:00

Represents the custom timezone you select for executing a test.

Default Selenium Capabilities


Key
Values
Capability
javascriptEnabled true, false Based on the user provided input, this capability helps to enable the support for JavaScript execution.
databaseEnabled true, false Decides if a session could communicate with the database.
locationContextEnabled true, false Decides if a session can use the features with respect to different geographic locations.
applicationCacheEnabled true, false Decides if a session is able to utilize the application cache.
browserConnectionEnabled true, false Determines the browser connectivity with respect to the query involved in the session. Also checks whether the session can be disabled if required by the end user.
webStorageEnabled true, false Decides if a session is able to connect with storage objects.
acceptSslCerts true, false Decides if a session by default should accept all SSL certificates.
unexpectedAlertBehaviour accept, dismiss, ignore Determines the action of a browser for handling alerts, prior to pointing the UnhandledAlertException.
elementScrollBehavior integer Determines the scrolling behavior according to the user provided input. The user can decide if the elements should be aligned to top(0) or bottom(1) with respect to the elements scroll-ability inside the viewport. By default the value is set to 1, aligning the scroll behavior to top. This is compatible in IE and Firefox (since 2.36)