Sauce Labs with protractor, malformed URI

298 views Asked by At

My protractor config is:

exports.config = {
baseUrl: 'http://www.onet.pl',
directConnect: false,
sauceUser: 'myuser',
sauceKey: 'mypassword',

 capabilities: {
    'browserName': 'chrome',
    'chromeOptions': {
        'args': ['show-fps-counter=true', '--allow-running-insecure-content']
    }
},
}

When I try to launch the tests I get the following Error:

    [12:57:56] I/sauce - Using SauceLabs selenium server at   http://ondemand.saucelabs.com:80/wd/hub
 [12:57:56] I/launcher - Running 1 instances of WebDriver
[12:57:56] E/launcher - URI malformed
[12:57:56] E/launcher - URIError: URI malformed
    at decodeURIComponent (native)
    at Url.parse (url.js:275:19)
    at Object.urlParse [as parse] (url.js:81:5)
    at new HttpClient (C:\Users\gwk736\Gitlab\Inform\e2e\node_modules\selenium-webdriver\http\index.js:221:25)
    at C:\Users\gwk736\Gitlab\Inform\e2e\node_modules\selenium-webdriver\executors.js:47:18
    at ManagedPromise.invokeCallback_ (C:\Users\gwk736\Gitlab\Inform\e2e\node_modules\selenium-webdriver\lib\promise.js:1379:14)
    at TaskQueue.execute_ (C:\Users\gwk736\Gitlab\Inform\e2e\node_modules\selenium-webdriver\lib\promise.js:2913:14)
    at TaskQueue.executeNext_ (C:\Users\gwk736\Gitlab\Inform\e2e\node_modules\selenium-webdriver\lib\promise.js:2896:21)
    at asyncRun (C:\Users\gwk736\Gitlab\Inform\e2e\node_modules\selenium-webdriver\lib\promise.js:2820:25)
    at C:\Users\gwk736\Gitlab\Inform\e2e\node_modules\selenium-webdriver\lib\promise.js:639:7
[12:57:56] E/launcher - Process exited with error code 199

Anyone encountered this problem when running tests ? This is a very strange behaviour to me... Unfortunately no examples can be found.

1

There are 1 answers

0
AdityaReddy On

I was able to replicate your error by having incorrectly encoded characters in either sauceUser or sauceKey. Can you check if you have any such characters in your config?

sauceUser: 'myuser',
sauceKey: 'password%EA',

Error Stack:

[14:41:46] I/sauce - Using SauceLabs selenium server at http://ondemand.saucelabs.com:80/wd/hub
[14:41:46] I/launcher - Running 1 instances of WebDriver
[14:41:46] E/launcher - URI malformed
[14:41:46] E/launcher - URIError: URI malformed
    at decodeURIComponent (native)
    at Url.parse (url.js:195:19)
    at Object.urlParse [as parse] (url.js:84:5)

This issue in nodeJs has been explained in this nodejs git issue

I just ran into this error when a client encoded 'ê' as '%EA' and an 'é' as "%E9" and then sent them to my node server. Attempting to decode either of them result in the uri malformed error:

decodeURIComponent("%EA"); URIError: URI malformed at decodeURIComponent (native) at repl:1:1