aerokube / cm

Configuration manager for Aerokube products
https://aerokube.com/cm/latest/
Apache License 2.0
119 stars 31 forks source link

Selenoid under Windows 10 fails to launch tests when your username contains a space #136

Closed gototester closed 6 years ago

gototester commented 6 years ago

When I try to run my tests logged in as 'Test User' the tests will not execute because the path to the user cannot be reached. I created a new user called 'tester' and ran the same command and the test worked fine.

npm run test

[11:18:51] I/launcher - Running 1 instances of WebDriver [11:18:51] I/hosted - Using the selenium server at http://localhost:4444/wd/hub [11:18:51] E/launcher - cannot start process [C:\Users\Test User.aerokube\selenoid\chromedriver.exe --whitelisted-ips='' --verbose --port=64371]: exec: "C:\Users\Test": file does not exist [11:18:51] E/launcher - WebDriverError: cannot start process [C:\Users\Test User.aerokube\selenoid\chromedriver.exe --whitelisted-ips='' --verbose --port=64371]: exec: "C:\Users\Test": file does not exist at Object.checkLegacyResponse (C:\Code\e2e-testing-example\node_modules\selenium-webdriver\lib\error.js:546:15) at parseHttpResponse (C:\Code\e2e-testing-example\node_modules\selenium-webdriver\lib\http.js:509:13) at doSend.then.response (C:\Code\e2e-testing-example\node_modules\selenium-webdriver\lib\http.js:441:30) at at process._tickCallback (internal/process/next_tick.js:188:7) From: Task: WebDriver.createSession() at Function.createSession (C:\Code\e2e-testing-example\node_modules\selenium-webdriver\lib\webdriver.js:769:24) at Function.createSession (C:\Code\e2e-testing-example\node_modules\selenium-webdriver\chrome.js:761:15) at createDriver (C:\Code\e2e-testing-example\node_modules\selenium-webdriver\index.js:170:33) at Builder.build (C:\Code\e2e-testing-example\node_modules\selenium-webdriver\index.js:626:16) at Hosted.getNewDriver (C:\Code\e2e-testing-example\node_modules\protractor\built\driverProviders\driverProvider.js:53:33) at Runner.createBrowser (C:\Code\e2e-testing-example\node_modules\protractor\built\runner.js:195:43) at q.then.then (C:\Code\e2e-testing-example\node_modules\protractor\built\runner.js:339:29) at _fulfilled (C:\Code\e2e-testing-example\node_modules\protractor\node_modules\q\q.js:834:54) at self.promiseDispatch.done (C:\Code\e2e-testing-example\node_modules\protractor\node_modules\q\q.js:863:30) at Promise.promise.promiseDispatch (C:\Code\e2e-testing-example\node_modules\protractor\node_modules\q\q.js:796:13) [11:18:51] E/launcher - Process exited with error code 199 error An unexpected error occurred: "Command failed.

vania-pooh commented 6 years ago

@gototester you should escape any spaces in command with \.

gototester commented 6 years ago

Hi @vania-pooh thanks for the quick response.

Looking in the browser.json file I noticed the path was split across two line, This was auto generted from when I ran the cm selenoid start --vnc command for the first time. If I edit the file to fix it, then it works.

Broken: "opera": { "default": "latest", "versions": { "latest": { "image": [ "C:\Users\Test", "User\.aerokube\selenoid\operadriver_win64\operadriver.exe", "--whitelisted-ips=''", "--verbose" ], "port": "", "path": "/" } } }

Working:

"opera": {
    "default": "latest",
    "versions": {
        "latest": {
            "image": [
                "C:\\Users\\Test User\\.aerokube\\selenoid\\operadriver_win64\\operadriver.exe",
                "--whitelisted-ips=''",
                "--verbose"
            ],
            "port": "",
            "path": "/"
        }
    }
} 
vania-pooh commented 6 years ago

@gototester Ok. That's a bug in CM.