-
Notifications
You must be signed in to change notification settings - Fork 191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Playwright cannot download the browsers automatically #418
Comments
Which Playwright version are you using?
Could it be that you have
First time you launch given version of Playwright you should see lines like this in stdout:
Can you confirm if you see them? If the browsers are not in the cache playwright will try to download them on every launch and if that step failed it would not continue. Your code runs after that step which means that either the browsers were downloaded and then removed while the program was still running or the download step was skipped because of the env variable above. |
Thanks for the response @yury-s I'm using The My first assumption was that maybe the script downloading the drivers doesn't have enough permissions so I tried changing it to download in the context of the server, however still the same result. The issue seems to be located in the In the end I just end up with a folder which should contain the files you mentioned above, but it's just a A few things worth mentioning maybe is that I am using |
This is really odd,
You just add playwright dependency to your pom.xml (i.e. you don't build it from sources), correct? |
Another idea, can you run the following in terminal: mvn exec:java -e -Dexec.mainClass=com.microsoft.playwright.CLI -Dexec.args="install chromium" It should download chromium to the cache folder (it should print something like |
Did that and still the same result. Just the
Exactly
Running the command works and it downloads the browsers. The issue seems to be related to how calling the install process works in a Java Enterprise environment. Is seems that the download fails in the
Using the I validated this assumption by running during debug the following line
thus changing the stderr for the external process which then worked and the browsers were downloaded. The process also created an empty I'm now trying to figure out how to pass from our code to the external process a different stderr path which it can inherit so it works. |
Good finding! Thanks for the detailed explanation too, this is very helpful!
I believe what we can do to work around this is to manually read stderr from the child process into a buffer and then when the process exits dump all the logs using |
@vidi42 can you run with your fix and I've added a new separate thread that pumps messages from the child process manually (see #426). Can you run your test locally with that change applied and see if it helps. If it doesn't help we may redirect stderr to a temp file and read from the file after the process finishes but I'd rather avoid temp files if possible. Could you also tell me how to setup enterprise environment similar to yours so that I could reproduce this locally? |
Closing as the discussion has stalled. |
I'm trying to use Playwright in a Java EE environment with Zulu 11 and I always get this error messaged when launching chromium.
I tried changing the path for browser download using the Environment Variable
PLAYWRIGHT_BROWSERS_PATH
but still the script was unable to download them.Any idea what might be wrong? Or any suggestion how can I debug the download script?
Environment Specifications
OS: Windows 10
JDK: Zulu 11
Server: Payara 5
The text was updated successfully, but these errors were encountered: