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

TestCafe can't find browser when executing concurrently #2035

Closed
ameyagholkar opened this issue Jan 5, 2018 · 13 comments
Closed

TestCafe can't find browser when executing concurrently #2035

ameyagholkar opened this issue Jan 5, 2018 · 13 comments
Labels
!IMPORTANT! OS: Mac STATE: Auto-locked An issue has been automatically locked by the Lock bot. TYPE: bug The described behavior is considered as wrong (bug).
Milestone

Comments

@ameyagholkar
Copy link

Are you requesting a feature or reporting a bug?

Maybe, a bug.

What is the current behavior?

Our setup

We're running testCafe in Visual Studio Team Services as a part of our build infrastructure. We're using VM's running Mac OS X 10.12.6. We're installing Chrome (latest stable), Firefox (57.0.3) via brew.

We run testCafe via our npm script. The npm script ferries our cmd arguments to testcafe.
We also use a custom js file to execute testCafe via it's programming interface.
We run tests on chrome in headless mode.

Issue

When we run the tests in concurrency mode on our build infrastructure, for some reason, we're seeing the error:

Error: Unable to run the browser. The file at /Applications/Chrome.app does not exist or is not executable.

We've verified that --

  • The browser exists
  • chrome is listed by testCafe as one of the installed browsers (via testcafe -b)
  • We tried removing all our npm scripts, the custom js file and just run the tests by directly targeting the testcafe.js in node_modules - but we see the same result when executing the test in concurrency mode.

The interesting observation is that the tests run fine on the same VMs with the same setup with the same commands without concurrency mode.

How would you reproduce the current behavior (if this is a bug)?

We couldn't get a repro locally. We tried installing chrome via brew and could still run tests concurrently.

Do you guys have any ideas on how to debug/solve this? Have you guys seen this happen before or have any ideas on what could be the possible issue?

  • operating system: Mac OS X 10.12.6
  • testcafe version: [email protected]
  • node.js version: node/v6.12.2 darwin x64
@lukaszblasz
Copy link

I have the same error message, when trying to run testcafe using jenkins build on my mac.
In my jenkins bash file im calling:
npm install testcafe testcafe-reporter-xunit node_modules/.bin/testcafe chrome e2e/ -r xunit:res.xml
I was trying solutions from other posts, like:
-renaming Goole Chrome.app to Chrome.app
-changing Chrome properties to have Read&Write permissions for all the users

Unfortunalety without success. testcafe -b is giving me 2 browsers: chrome and safari

When trying to run tests in safari i am getting similar error:

ERROR Was unable to open the browser "locally-installed:safari" due to error. Error: Unable to run the browser. The file at /Users/Shared/Jenkins/Home/workspace/test/node_modules/testcafe-browser-tools/bin/mac/open.scpt does not exist or is not executable.

@AndreyBelym
Copy link
Contributor

Hello @ameyagholkar, thank you for feedback. I've reproduced the problem. Could you please try to use :userProfile advanced Chrome Mode as a workaround? E.g.
testcafe chrome:userProfile --concurrency 4 test.js

@lukaszblasz, it can be a problem with your Jenkins setup. A user that runs Jenkins service needs Administrator privileges. Check this gist for instructions. Also, the user should be logged in through the Mac's Login Screen.

@AlexanderMoskovkin AlexanderMoskovkin added this to the Sprint #10 milestone Jan 9, 2018
@AlexanderMoskovkin AlexanderMoskovkin added TYPE: bug The described behavior is considered as wrong (bug). !IMPORTANT! OS: Mac labels Jan 9, 2018
@ameyagholkar
Copy link
Author

👋 @AndreyBelym Thanks for your reply!

I'm not sure if I made it explicit, but we're using chrome:headless in our scripts.

I ran testcafe chrome:headless:userProfile --concurrency 3 <my-files> but I get the same error.

Since I'm using headless mode, is that above browser name correct?

@AndreyBelym
Copy link
Contributor

Unfortunately. userProfile can't be used together with headless.

@ameyagholkar
Copy link
Author

@AndreyBelym i see. Is there any other way to solve this for our case? Any suggestions?
Should the commit referenced above solve this issue even for headless mode?

@AndreyBelym
Copy link
Contributor

@ameyagholkar, yes, it's intended to solve the issue for the headless mode.

@ameyagholkar
Copy link
Author

@AndreyBelym I should mention that this happens on Firefox headless as well. Sorry didn't write that up in the original issue description.

@ameyagholkar
Copy link
Author

Just making sure you guys read that ☝️ cc/ @AndreyBelym

@AndreyBelym
Copy link
Contributor

Yep, I got it.

@ameyagholkar
Copy link
Author

Any specific release (stable or dev) we can test this out on?

cc/ @AndreyBelym @AlexanderMoskovkin

@AlexanderMoskovkin
Copy link
Contributor

Hi @ameyagholkar, we are going to release a dev version with the fix tomorrow

@mpham-r7
Copy link

mpham-r7 commented Mar 6, 2018

@ameyagholkar i see the fix is specific to chrome... i am having the same issue with firefox/firefox:headless as well... will there be a fix for those browsers?

AndreyBelym added a commit to AndreyBelym/testcafe that referenced this issue Mar 16, 2018
…#2180)

Avoid password saving bubble in Firefox
Fix concurrently mode for Firefox on macOS
miherlosev pushed a commit that referenced this issue Mar 16, 2018
* Fix some issues in Firefox (closes #2035, closes #2180)

Avoid password saving bubble in Firefox
Fix concurrently mode for Firefox on macOS

* Fix missing await
@lock
Copy link

lock bot commented Mar 28, 2019

This thread has been automatically locked since it is closed and there has not been any recent activity. Please open a new issue for related bugs or feature requests. We recommend you ask TestCafe API, usage and configuration inquiries on StackOverflow.

@lock lock bot added the STATE: Auto-locked An issue has been automatically locked by the Lock bot. label Mar 28, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Mar 28, 2019
kirovboris pushed a commit to kirovboris/testcafe-phoenix that referenced this issue Dec 18, 2019
…#2180) (DevExpress#2224)

* Fix some issues in Firefox (closes DevExpress#2035, closes DevExpress#2180)

Avoid password saving bubble in Firefox
Fix concurrently mode for Firefox on macOS

* Fix missing await
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
!IMPORTANT! OS: Mac STATE: Auto-locked An issue has been automatically locked by the Lock bot. TYPE: bug The described behavior is considered as wrong (bug).
Projects
None yet
Development

No branches or pull requests

5 participants