PlayWright test in Chrome with a different Windows user than the one currently logged in?

142 views Asked by At

I have to run some tests through PlayWright and have to run it trough Chrome with a different Windows user than the one I'm currently logged into the system with, for security reasons as I run a virtual machine where one user has access to the DB and another to the apps on the VM. Note: It is not the Chrome user I have to switch, it is the Windows user.

I'm logged into Windows with user 'A123' and when I need to open Chrome I need to use user 'B123'. I've tried successfully to open Chrome as user 'B123' with a shortcut on the desktop with the following destination:

C:\Windows\System32\runas.exe /savecred /user:prod\B123 "C:\Program Files\Google\Chrome\Application\chrome.exe"

However as that is just the sole instance of Chrome opened through the shortcut on my desktop it doesn't transfer that mechanic to VS Code when I try to run the test there.

I've tried to do a similar thing with VS Code, so to open VS code with user 'B123', and by that see if it would force Chrome to open with 'B123' when starting the test, but the system is not allowing me to open VS Code in the same way as it allows me with Chrome.

0

There are 0 answers