2017-01-02 70 views
2

我量角器配置为:酱实验室用量角器,畸形URI

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'] 
    } 
}, 
} 

当我尝试启动我得到以下错误测试:运行测试时

[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 

任何人都遇到过这个问题吗? 这对我来说是一个非常奇怪的行为... 不幸的是没有找到任何示例。

+0

无论是http://www.onet.pl和http进行了说明: //ondemand.saucelabs.com:80/wd/hub是有效的URL,由'url'节点模块(由selenium-webdriver使用)解析,没有任何问题。你确定你使用这个配置来运行测试吗? – alecxe

+0

如果以directConnect模式和/或本地(不是在saucelabs上)运行它,会发生什么情况? – alecxe

回答

0

我能够通过在sauceUsersauceKey中错误地编码字符来复制您的错误。你能检查你的配置中是否有这样的字符?

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

错误堆栈:

[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) 

此问题已的NodeJS在这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