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 browsers on Window that are installed only for a current user #1688

Closed
AlexanderMoskovkin opened this issue Aug 11, 2017 · 22 comments
Assignees
Labels
STATE: Auto-locked An issue has been automatically locked by the Lock bot. SYSTEM: browser natives TYPE: bug The described behavior is considered as wrong (bug).
Milestone

Comments

@AlexanderMoskovkin
Copy link
Contributor

See DevExpress/testcafe-browser-tools#128

@AlexanderMoskovkin AlexanderMoskovkin added SYSTEM: browser natives TYPE: bug The described behavior is considered as wrong (bug). labels Aug 11, 2017
@AlexanderMoskovkin AlexanderMoskovkin added this to the Sprint #9 milestone Aug 11, 2017
@AlexanderMoskovkin AlexanderMoskovkin self-assigned this Aug 11, 2017
@Master244
Copy link

Master244 commented Aug 11, 2017

+1 it doens't matter what I do reinstall add chrome to my path ( I can start it with chrome from terminal ),

The testcafe package globally or locally installed will never see any listed browsers running testcafe -b

Installed Firefox didn't pop up on -b reinstalled testcafe still no luck and your documentation really lacks on this issue or how to force a default browser.

@AlexanderMoskovkin
Copy link
Contributor Author

We've found the cause of the problem and we're going to fix it soon.
As a temporary workaround you can pass a path to the installed browser to TestCafe (See Portable Browsers).

@Master244
Copy link

I tried with portableChrome but no matter what browser I use it keeps saying unable to find browser. Even if I install the browser in my user folder

@AlexanderMoskovkin
Copy link
Contributor Author

do you mean the approach like testcafe path:d:\chromeportable\chromeportable.exe tests/sample-fixture.js doesn't work on your side?

@Master244
Copy link

Nope, but it might be a problem with my work computer as well, regarding permissions, I will try and install firefox in my user Folder and try again.

@Master244
Copy link

but should it work with portable chrome'? Because that I tried and that also didn't work

@AlexanderMoskovkin
Copy link
Contributor Author

but should it work with portable chrome'? Because that I tried and that also didn't work

what the error do you see in the report?

@Master244
Copy link

Master244 commented Aug 14, 2017

testcafe path "/c/Users/barrybadpak/chrome/GoogleChromePortable" tests/**/*test.js -r list -S -s report/screenshots/ -e --selector-timeout 500000 --assertion-timeout 10000
Using locally installed version of TestCafe.
ERROR Was unable to open the browser "path:" due to error.

TypeError: Cannot read property 'trim' of undefined
at Object.callee$0$0$ (C:\Users\barrybadpak\WORK\end-to-end-test\node_modules\testcafe-browser-tools\lib\api\get-browser-info.js:54:41)
at tryCatch (C:\Users\barrybadpak\WORK\end-to-end-test\node_modules\testcafe-browser-tools\node_modules\babel-runtime\regenerator\runtime.js:72:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (C:\Users\barrybadpak\WORK\end-to-end-test\node_modules\testcafe-browser-tools\node_modules\babel-runtime\regenerator\runtime.js:334:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (C:\Users\barrybadpak\WORK\end-to-end-test\node_modules\testcafe-browser-tools\node_modules\babel-runtime\regenerator\runtime.js:105:21)
at tryCatch (C:\Users\barrybadpak\WORK\end-to-end-test\node_modules\testcafe-browser-tools\node_modules\babel-runtime\regenerator\runtime.js:72:40)
at invoke (C:\Users\barrybadpak\WORK\end-to-end-test\node_modules\testcafe-browser-tools\node_modules\babel-runtime\regenerator\runtime.js:146:20)
at C:\Users\barrybadpak\WORK\end-to-end-test\node_modules\testcafe-browser-tools\node_modules\babel-runtime\regenerator\runtime.js:154:13

@Master244
Copy link

also tried with adding the executable, /c/Users/barrybadpak/chrome/GoogleChromePortable/chrome.exe

@AlexanderMoskovkin
Copy link
Contributor Author

testcafe path "/c/Users/barrybadpak/chrome/GoogleChromePortable" tests/**/*test.js

Your syntax is not quite correct. It should be like this:

testcafe "path:`C:\Program Files (x86)\Google\Chrome\Application\chrome.exe`" d:\temp\gh-1679.js

Note, it necessary to pass a path to a Chrome executable file.

@Master244
Copy link

Master244 commented Aug 14, 2017

I already noticed that and tried that same error ( see previous message ) , then I got it to work with the nightmare browser. But then I took the trouble of getting a new computer here at work with full root acces, that one does run with chrome and all my test pass. On my own computer not with root acces ( work laptop ) they all fail with nightmare. Any ideas?

@AlexanderMoskovkin
Copy link
Contributor Author

Have you tried exactly the same syntax as in my example?

testcafe "path:`C:\Users\barrybadpak\chrome\GoogleChromePortable\chrome.exe`" tests/**/*test.js

It should be a : symbol after the path part and the path should be started with C:\.
If this command run is failed too please provide me.

On my own computer not with root acces ( work laptop ) they all fail with nightmare. Any ideas?

Do you mean you are able to run tests in nightmare but they are failed? If yes please let me know what the errors do you see?

@Master244
Copy link

ryx/testcafe-browser-provider-nightmare#7 In nightmare I googled my errors and I think it has something to do with the fact that the window size is too small and the buttons don't appear properly ( our site is not so responsive yet ) but preferable I will try your command. Because during devloping seeing the test is way better :) ( the screenshots don't tell me a lot )

@Master244
Copy link

1

@Master244
Copy link

testcafe "path:C:\Users\barrybadpak\chrome\GoogleChromePortable\chrome.exe" tests/**/*test.js

I tried this too but it says same error:

testcafe "path:C:\Users\barrybadpak\chrome\GoogleChromePortable\chrome.exe" tests/**/*test.js
bash: C:UsersbarrybadpakchromeGoogleChromePortablechrome.exe: command not found
Using locally installed version of TestCafe.
ERROR Was unable to open the browser "path:" due to error.

TypeError: Cannot read property 'trim' of undefined
at Object.callee$0$0$ (C:\Users\barrybadpak\WORK\end-to-end-test\node_modules\testcafe-browser-tools\lib\api\get-browser-info.js:54:41)
at tryCatch (C:\Users\barrybadpak\WORK\end-to-end-test\node_modules\testcafe-browser-tools\node_modules\babel-runtime\regenerator\runtime.js:72:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (C:\Users\barrybadpak\WORK\end-to-end-test\node_modules\testcafe-browser-tools\node_modules\babel-runtime\regenerator\runtime.js:334:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (C:\Users\barrybadpak\WORK\end-to-end-test\node_modules\testcafe-browser-tools\node_modules\babel-runtime\regenerator\runtime.js:105:21)
at tryCatch (C:\Users\barrybadpak\WORK\end-to-end-test\node_modules\testcafe-browser-tools\node_modules\babel-runtime\regenerator\runtime.js:72:40)
at invoke (C:\Users\barrybadpak\WORK\end-to-end-test\node_modules\testcafe-browser-tools\node_modules\babel-runtime\regenerator\runtime.js:146:20)
at C:\Users\barrybadpak\WORK\end-to-end-test\node_modules\testcafe-browser-tools\node_modules\babel-runtime\regenerator\runtime.js:154:13

@Master244
Copy link

but using the path with a CD command does work

@AndreyBelym
Copy link
Contributor

That's because you should escape backslashes in Bash: http://wiki.bash-hackers.org/syntax/quoting. e.g. C:\\Users\\barrybadpak\\chrome\\GoogleChromePortable\\chrome.exe. Or use regular slashes: C:/Users/barrybadpak/chrome/GoogleChromePortable/chrome.exe

@Master244
Copy link

@AndreyBelym That worked! Though it started up the browser nothing seems to be happening. The full command im using now is

testcafe "path:/c//Users//barrybadpak//chrome//GoogleChromePortable//chrome.exe" -r list -S -s report/screenshots/ -e --selector-timeout 500000 --assertion-timeout 10000

@Master244
Copy link

Master244 commented Aug 14, 2017

Just stating that this all works perfectly fine on a exactly the same machine thus with root access and the build in chrome browser

@Master244
Copy link

A workarround for this if your user does not have access to program files, copy paste the chrome folder somewhere within your user folder and specify the path.

"test": "testcafe path:C:\Users\barrybadpak\chrome\GoogleChromePortable\chrome.exe tests/**/*test.js -r list -S -s report/screenshots/ -e --selector-timeout 500000 --assertion-timeout 10000"

don't use ``

@AlexanderMoskovkin
Copy link
Contributor Author

don't use ``

It's necessary if you have spaces in the path to the browser executable

@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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
STATE: Auto-locked An issue has been automatically locked by the Lock bot. SYSTEM: browser natives TYPE: bug The described behavior is considered as wrong (bug).
Projects
None yet
Development

No branches or pull requests

3 participants