Skip to content

Files

Latest commit

1a4fa61 · Dec 18, 2024

History

History

lambdatest

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Dec 18, 2024
Jun 26, 2023

README.md

Karate and Lambdatest

Karate supports the W3C WebDriver protocol and can be used to run tests on Lambdatest.

The example in this folder demonstrates how to run a test on Lambdatest using Karate. All you need is a Lambdatest account and values such as the URL, user, key etc.

From your Lambdatest profile, you can get the values you need. The main ones you need are the username and accessKey.

All you need to do in Karate is perform the configure driver step as per the documentation. Note how LT:Options are added to the WebDriver "capabilities":

  * def session = { capabilities: { alwaysMatch: { browserName: 'chrome', browserVersion: 'latest', platformName: 'Windows 11', 'LT:Options': '#(lambdaTestOptions)' } } }
  * configure driver = { type: 'chromedriver', start: false, webDriverSession: '#(session)', webDriverUrl: '#(lambdaTestUrl)' }

Of course you can change the browserVersion and platformName to suit your needs. You will have to ensure that the Karate driver type matches the browserName, for example chromedriver for chrome. Refer to the Karate documentation for all possible types.

Also refer to the documentation of webDriverSession and webDriverUrl for more details.

Note that for a typical test-suite, you will set variables via the karate-config.js so you can switch browsers or between local and remote execution.

Further Reading