Skip to content
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] Firefox does not launch with executablePath set to Firefox inside Applications folder #2623

Closed
mukunduashok opened this issue Jun 18, 2020 · 6 comments
Assignees

Comments

@mukunduashok
Copy link

Context:

  • Playwright Version: 1.1.1
  • Operating System: Mac v10.15.4
  • Node version: 10.20.1
  • Browser: Firefox v77.0.1 / Firefox Developer Edition v78b8
  • Extra: Works with inbuilt Firefox. Fails to resolve only when executablePath is provided with Firefox path inside Applications folder

Code Snippet

const {
    firefox
} = require("playwright");

const browser = firefox.launch({
    headless: false,
    executablePath: "/Applications/Firefox\ Developer\ Edition.app/Contents/MacOS/firefox"
}).then((value) => {
    console.log("Browser context is ", value);
    return value
}).catch((err) => console.log("Browser launch error", err));

Expected Output: The value of browser should resolve to firefox browser instance
Actual Output: Below error is received
Browser launch error { TimeoutError: Timeout 30000ms exceeded during firefox.launch. =================== firefox.launch logs =================== <launching> /Applications/Firefox Developer Edition.app/Contents/MacOS/firefox -no-remote -wait-for-browser -foreground -profile /var/folders/w6/lntvmx0536z_xm541_0d3c_9htfqbf/T/playwright_firefoxdev_profile-8xdVsI -juggler 0 -silent <launched> pid=36633 ============================================================ Note: use DEBUG=pw:api environment variable and rerun to capture Playwright logs. at ProgressController.run (/Users/ashok_mb/Documents/xBP/Learner/playwright_spike/node_modules/playwright/lib/progress.js:72:30) at Object.runAbortableTask (/Users/ashok_mb/Documents/xBP/Learner/playwright_spike/node_modules/playwright/lib/progress.js:24:23) at Firefox.launch (/Users/ashok_mb/Documents/xBP/Learner/playwright_spike/node_modules/playwright/lib/server/browserType.js:61:42) at Object.<anonymous> (/Users/ashok_mb/Documents/xBP/Learner/playwright_spike/src/sample.js:5:25) at Module._compile (internal/modules/cjs/loader.js:778:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10) at Module.load (internal/modules/cjs/loader.js:653:32) at tryModuleLoad (internal/modules/cjs/loader.js:593:12) at Function.Module._load (internal/modules/cjs/loader.js:585:3) at Function.Module.runMain (internal/modules/cjs/loader.js:831:12) name: 'TimeoutError' }

Note:

  1. The browser is launched, but we received the timeout error after 30000ms.
  2. If I remove "executablePath", the inbuilt firefox launches and resolves.

Kindly let me know if I'm doing anything wrong. Thanks

firefox_playwright_bug

@mxschmitt
Copy link
Member

Hi, what is the reason that you want to use your own Firefox for Playwright tests?
The reason why it's not working is because Playwright uses a custom patched Firefox version (which is in the end the same as normal Firefox except newer and slightly modified to include better bindings to automate it).

@mukunduashok
Copy link
Author

mukunduashok commented Jun 18, 2020

@mxschmitt Thanks for the immediate response.

There is no special reason to test with actual released or beta Firefox. We've been using the standards of running the suite against the different versions of Firefox Developer Edition.

I can try out with inbuilt Firefox to start with. Ultimately the expectations would be to run in the actual Firefox. Doesn't playwright support the nightly, beta and released version of Firefox ?

Please help!

@mxschmitt
Copy link
Member

I can try out with inbuilt Firefox to start with. Ultimately the expectations would be to run in actually Firefox. Doesn't playwright support the nightly, beta and released version of Firefox ?

For Chromium/Chrome, you could potentially use the latest Canary version which would work with Playwright. But for WebKit and Firefox not, because these browsers were customised (patched) during the build and contain by that special APIs, so that Playwright can interact and control them better. Normal Firefox / WebKit versions, also the latest beta ones, don't contain them yet.

There are plans to push these changes upstream which are currently already on-going but it will probably take a few months.

@mukunduashok
Copy link
Author

Ok Nice. Got it. Thanks much @mxschmitt

@arjunattam arjunattam self-assigned this Jun 18, 2020
@arjunattam
Copy link
Contributor

Assigning myself to cover this in our docs. Thanks @mukunduashok and @mxschmitt

@Sandeepisebauz
Copy link

Is this feature fixed, I still notice this issue on playwright version 1.22, when I try to use the executable path of the installed firefox path, which is at a higher version (100.0.1) when compared to playwright bundled Firefox version 99.0.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants