Skip to content

Latest commit

 

History

History
30 lines (15 loc) · 2.01 KB

README.md

File metadata and controls

30 lines (15 loc) · 2.01 KB

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