Skip to main content

Capabilities for Playwright Testing

The LambdaTest Capability Generator allows you to automatically create the capabilities class needed to run your Playwright automation scripts on LambdaTest. Here are a few capabilities that you can configure to run your Playwright tests.

KeyExpected ValuesDescriptionCapability
browserNameChrome, Microsoft Edge

Playwright Bundled Browsers: pw-chromium, pw-webkit, and pw-firefox
Specify the browser to test onconst capability = {"browserName": "pw-webkit"}
browserVersionChrome 83 & above, Edge 83 & aboveSpecify the browser version to test onconst capability = {"browserVersion": "latest"}
platformWindows: 11, 10, 8, 8.1, 7

macOS: Monterey, Big Sur, Catiline, Mojave
Specify the platform nameconst capability = { "LT:Options": {"platform": "Windows 10",}}
buildPlaywright Sample BuildRepresent the build number for your testconst capability = {"LT:Options": {"build": "<build_name>",}}
namePlaywright Sample TestRepresents the name of a testconst capability = {"LT:Options": {"name": "<test_name>",}}
projectNamePlaywright Sample ProjectRepresents the name of a projectconst capability = {"LT:Options": {"projectName": "<project_name>",}}
tags["tag1", "tag2", "tag3"]Group your Playwright testsconst capability = {"LT:Options": { "tags": ["tag1", "tag2", "tag3"], }}
buildTags["build1", "build2","build3"]Group your Playwright buildsconst capability = {"LT:Options": { "buildTags": ["build1", "build2", "build3"] }}
resolutionString, Default value: 1920x1080

Windows 11 & 10: 1024x768, 1280x800, 1280x1024, 1366x768, 1440x900, 1680x1050, 1600x1200, 1920x1200, 1920x1080 and 2048x1536

macOS: 1024x768, 1280x960, 1280x1024, 1600x1200 and 1920x1080
Specifying your desktop resolution before initiating the testconst capabilities = { "LT:Options": {"resolution": "2048x1536",}}
projectNameMy TestRepresent the name of your projectconst capability = { "LT:Options": {"projectName": "<project_name>",}}
networktrue/falseEnable network logsconst capability = { "LT:Options": {"network": true,}}
consoletrue/falseEnable browser console logsconst capabilities = { "LT:Options": {"console": true,}}
videotrue/falseEnable video recording of the entire screenconst capability = { "LT:Options": {"video": true,}}
visualtrue/falseCaptures screenshot for every commandconst capability = { "LT:Options": {"visual": true,}}
tunneltrue/falseEnable tunnel for local testingconst capability = { "LT:Options": {"tunnel": true,}}
tunnelNametrue /falseSpecify tunnel nameconst capability = { "LT:Options": {"tunnelName": "<tunnel_name>",}}
geoLocationAR (Argentina)Specify country codeconst capability = { "LT:Options": {"geoLocation": "AR",}}
idleTimeoutnumberSpecifies the timeout of the commands in seconds.

Default value: 300

Max value: 1800

If a value greater than 1800 is added, idleTimeout will be set to 1800.
const capability = { "LT:Options": {"idleTimeout": "<number>",}}
lambdaMaskCommandsarray sendType or sendFill Masks the type method of the ElementHandle and Locator class.

sendPress Masks the press method of the ElementHandle and Locator class.

setHTTPCredentials Masks the HTTP credentials parameter in the newContext and newPage method of the browser class.

setStorageState Masks the storage state parameter in the newContext and newPage method of the browser class

setGeolocation Masks the Geolocation parameter in the newContext and newPage method of the browser class.
const capability = { "LT:Options": {'lambdaMaskCommands': ["sendType", "sendFill", "sendPress", "setHTTPCredentials", "setStorageState", "setGeolocation"]}}

useSpecificBundleVersionBooleanIf set true: LambdaTest will select the playwright server version as per the browser version you have passed in the capabilities. Check the supported browser version list.

If the value set in the browser version capability is supported by multiple Playwright versions, LambdaTest checks your Playwright client version and sets the Playwright version accordingly.


If set false : LambdaTest will run your playwright tests with the same version as setup in your local system and the browser version will also be used the compatible one as per the supported browser version list and not your defined one.
const capability = { "LT:Options": {"useSpecificBundleVersion": true,}}
lambdaSetBrowserPositionThe lambdaSetBrowserPosition function is designed to arrange two browser windows on the screen, ensuring each occupies exactly half of the available screen space. This layout facilitates side-by-side browser comparisons or multitasking workflows.

OS Supported - Windows

Browsers supported : Chrome, Microsoft Edge , pw-chroium, pw-webkit & pw-firefox
const capability = {action: 'lambdaSetBrowserPosition',}

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

Book Demo

Help and Support

Related Articles