1

I am trying to execute karate script through playwright . I started the playwright server by running node server.js in cmd as below

C:\Documents\playwright>node server.js

using port: 4444 browser: chromium headless: false

ws://127.0.0.1:4444/c9e3265076caf23f548ddddbc66ac160

And gave the websocket url generated in the karate driver config as below .

  • configure driver = { type: 'playwright', start: false, playwrightUrl: 'ws://127.0.0.1:4444/c9e3265076caf23f548ddddbc66ac160' }.

When i execute the karate script , its neither throwing any error nor executing it , it standstill and does not stop the execution at all . But if i mention incorrect playwrightUrl value then its throwing

" karate.io.netty.handler.codec.http.websocketx.WebSocketClientHandshakeException: Invalid handshake response getStatus: 400 Bad Request"

Please let me know if i missing something here and kindly help me to execute the karate script through playwright!Thanks

1 Answers1

0

The Playwright support is considered experimental and may need some code-contributions or research, maybe you can help ?

Peter Thomas
  • 54,465
  • 21
  • 84
  • 248
  • If playwright is experimental, what is the other option for cross browser test execution currently that is working ? Can i able to test in different cross browsers using docker container apart from the two existing chrome containers . Does any other docker containers works for karate ? – SUBRAMANIA SIVA Jul 22 '21 at 22:43
  • @SUBRAMANIASIVA you can use any webdriver compatible server: https://stackoverflow.com/q/65631114/143475 - but yes you should evaluate karate - or feel free to choose other options if you can't contribute – Peter Thomas Jul 23 '21 at 02:07
  • @SUBRAMANIASIVA just an update, karate 1.1.0 was just released that should fix some of the playwright problems you faced – Peter Thomas Aug 05 '21 at 14:13
  • 1
    Thanks for letting me know , I updated pom file with the latest version 1.1.0 and ran the karate script with driver config as playwright . It worked fine with chrome ,edge, firefox but not with webkit(Safari) . It launches the webkit(safari) browser with a blank screen and its not loading any page , throwing playwright error: "Timeout was reached navigating to url" . I will also evaluate the same with playwright docker container and let you know ! Thanks . – SUBRAMANIA SIVA Aug 06 '21 at 20:48