Executing WebUI Feature Files Against Multiple Browsers with Parallel Runner or Distributed Testing
In Karate, executing WebUI feature files against multiple browsers using the parallel runner or distributed testing requires specific strategies.
Parallel Execution with Scenario Outline:
Use a Scenario Outline with an Examples table to specify multiple browser configurations. Karate will execute each row of the table in parallel. However, the driver configuration must be moved into the Feature itself:
Scenario Outline: <type> * def webUrlBase = karate.properties['web.url.base'] * configure driver = { type: '#(type)', showDriverLog: true } * driver webUrlBase + '/page-01' * match text('#placeholder') == 'Before' * click('{}Click Me') * match text('#placeholder') == 'After' Examples: | type | | chrome | | geckodriver |
Parallel Execution with Special Feature:
Create a separate "special" feature that calls the main feature with different driver configurations in a Scenario Outline:
Scenario Outline: <config> * configure driver = config * call read('main.feature') Examples: | config! | | { type: 'chromedriver' } | | { type: 'geckodriver' } | | { type: 'safaridriver' } |
Additional Tips:
The above is the detailed content of How to Execute WebUI Feature Files Against Multiple Browsers Using Parallel Runner or Distributed Testing in Karate?. For more information, please follow other related articles on the PHP Chinese website!