1

Does anyone have a simple example of launching a browser window in a Karate .feature file using Playwright?

Preferable where the Playwright server is already started. I'm especially not clear on what parameters need to be included in the * configure driver = line.

tomdwp
  • 119
  • 8

1 Answers1

2

Instructions are here: https://github.com/karatelabs/karate/tree/master/karate-core#playwright

If already started, you do need to know what the server URL is. Then the driver config would be something like this:

* configure driver = { type: 'playwright', start: false, playwrightUrl: '<change me>' }

It seems that newer versions of Playwright do allow you to set the server URL value to a "known" value when you start the server, see wsPath here: https://playwright.dev/docs/api/class-browsertype#browser-type-launch-server

Playwright support in Karate is still a bit experimental, so if you can report your findings here, that will help others.

Peter Thomas
  • 54,465
  • 21
  • 84
  • 248