Browser library

Hello community, I have a problem with the browser library, this library is also installed with Playwright, the problem is that my test cases run a Jenkins pipeline and every time my tests are run, this library is installed from 0 with the latest version of playwright the problem here is that playwright tries to search for the latest version of the browsers for example %USERPROFILE%\pw-browsers\chromium-1105\chrome-win\chrome.exe
But I have the browsers pre-downloaded on this machine and the path is something like %USERPROFILE%\pw-browsers\chromium-1090\chrome-win\chrome.exe Does anyone know how I can tell playwrigth to run the same version of the browser? I already tried to change environment variables.
SET PLAYWRIGHT_BROWSERS_PATH=%USERPROFILE%\pw-browsers
I tried to use something like this in my %USERPROFILE%\pw-browsers${my_browser_version} environment variable but this didn’t work. Could someone help me with this?

Hi @alvarocascante12,

You might need to change your approach;
Rather than telling Browser Library (or rather the underlying Playwright instance) “user this browser version”,
Find out which version of Browser Library did use that browser version you want and tell your Jenkins runner only install that version of Browser Library, then when It goes to download the browser hopefully it’ll see the file already there and use it.

If I remember correctly the browser version is controlled and pinned with each release of Browser Library so there are no unexpected issues with web drivers, otherwise Browser Library would have the web driver update nightmares that SeleniumLibrary had. I’m just not sure if it’s Browser Library controlling this or Playwright controlling this.

Hope that works for you,

Dave.

2 Likes