Home > Software design >  Using Opera, Safari, Brave with playwright
Using Opera, Safari, Brave with playwright

Time:12-15

I'm trying to use various browsers for my tests, as long as I know, playwright has a browser called webkit which could be the equivalent to Safari and Opera but, is there a way to actually run Safari and other browsers instead of webkit?

For Chrome and Edge I only had to add chanel="msedge"(or chrome) in the line browser = playwrights.chromium.launch(channel='msedge', headless=False) for it to open edge, is there something similar for Opera, Safari, etc.? Or there is another way to use those browsers for the test? I can't find the answer in their documentation.

CodePudding user response:

Playwright will work with proprietary Chromium-based browsers (including Opera, Edge, Chrome etc.), you can install the browser independently from Playwright and then pass path to its executable via execuable_path launch option:

browser = playwrights.chromium.launch(executable_path='/opt/path_to_opera_bin')

For automating WebKit and Firefox Playwright currently requires remote debugging protocol which is only available in the custom builds.

  • Related