简体   繁体   English

java.net.URISyntaxException:索引7的预期权限:http://

[英]java.net.URISyntaxException: Expected authority at index 7: http://

I am getting error: 我收到错误消息:

Caused by: java.net.URISyntaxException: Expected authority at index 7: http:// 引起原因:java.net.URISyntaxException:索引7的预期授权:http://

For below code: 对于以下代码:

try 
{
    return new RemoteWebDriver(new URL("http://" + username + ":" + authkey +"@hub.crossbrowsertesting.com:80/wd/hub"), caps);
} 
catch (MalformedURLException e) 
{
    // TODO Auto-generated catch block
    e.printStackTrace();
    return null;
 }

Stack trace: 堆栈跟踪:

Driver info: driver.version: RemoteWebDriver at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:622) at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:241) at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:128) at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:155) at abc.testcase.LoginForm2.main(LoginForm2.java:45) Caused by: org.apache.http.client.ClientProtocolException at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:186) at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:71) at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:55) at org.openqa.selenium.remote.internal.ApacheHttpClient.fallBackExecute(ApacheHttpClient.java:142) at org.openqa.selenium.remote.internal.ApacheHttpClient.execute(ApacheHttpClient.java:88) at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake. 驱动程序信息:driver.version:org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:622)上的org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:241)上的RemoteWebDriver org.openqa.selenium.remote.RemoteWebDriver。(RemoteWebDriver.java:155)上的.selenium.remote.RemoteWebDriver。(RemoteWebDriver.java:128),位于abc.testcase.LoginForm2.main(LoginForm2.java:45),原因: org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:186)上的org.apache.http.client.ClientProtocolException org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:71上的org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:186) )(位于org.openqa.selenium.org.openqa.selenium.remote.internal.ApacheHttpClient.fallBackExecute(ApacheHttpClient.java:142)的org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:55)处。 org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake)上的remote.internal.ApacheHttpClient.execute(ApacheHttpClient.java:88)。 java:108) at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:64) at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:141) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:601) ... 4 more Caused by: org.apache.http.HttpException: Cannot convert host to URI: http:// at org.apache.http.impl.conn.SystemDefaultRoutePlanner.determineProxy(SystemDefaultRoutePlanner.java:77) at org.apache.http.impl.conn.DefaultRoutePlanner.determineRoute(DefaultRoutePlanner.java:77) at org.apache.http.impl.client.InternalHttpClient.determineRoute(InternalHttpClient.java:124) at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:183) ... 12 more Caused by: java.net.URISyntaxException: Expected authority at index 7: http:// at java.net.URI$Parser.fail(URI.java:2848) at java.net.URI$Parser.failExpecting(URI.java:2854) at java.net.URI$Parser.parseHierarchical(URI.java:3102) at java.net.URI$Parse java:108)位于org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:64)位于org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:141)位于org.openqa.selenium.remote .RemoteWebDriver.execute(RemoteWebDriver.java:601)...另外4个原因由:org.apache.http.HttpException:无法将主机转换为URI:http://,位于org.apache.http.impl.conn.SystemDefaultRoutePlanner。在org.apache.http.impl.conn.DefaultRoutePlanner.determineRoute(DefaultRoutePlanner.java:77)处的org.apache.http.impl.client.InternalHttpClient.determineRoute(InternalHttpClient.java:124)的确定代理(SystemDefaultRoutePlanner.java:77)在org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:183)...上另外12个原因:java.net.URISyntaxException:索引7的预期授权:java.net上的http://。 URI $ Parser.fail(URI.java:2848)在java.net.URI $ Parser.failExpecting(URI.java:2854)在java.net.URI $ Parser.parseHierarchical(URI.java:3102)在java.net .URI $解析 r.parse(URI.java:3053) at java.net.URI.(URI.java:588) at org.apache.http.impl.conn.SystemDefaultRoutePlanner.determineProxy(SystemDefaultRoutePlanner.java:75) ... 15 more org.apache.http.impl.conn.SystemDefaultRoutePlanner.determineProxy(SystemDefaultRoutePlanner.java:75)的java.net.URI。(URI.java:588)的r.parse(URI.java:3053)...另外15个

Please help! 请帮忙!

仅通过%40编码@即可解决错误

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 java.net.URISyntaxException - java.net.URISyntaxException Jmeter Http 代理服务器抛出 java.net.URISyntaxException: Illegal character in query at index 错误 - Jmeter Http proxy server throws java.net.URISyntaxException: Illegal character in query at index error java.net.URISyntaxException:JMETER 索引处的查询中存在非法字符 - java.net.URISyntaxException: Illegal character in query at index on JMETER java.net.URISyntaxException:索引 177 处的查询中存在非法字符 - java.net.URISyntaxException: Illegal character in query at index 177 JMeter - Java.net.URISyntaxException:索引路径中的非法字符 - JMeter - Java.net.URISyntaxException: Illegal character in path at index Jmeter:HTTP 请求问题返回 java.net.URISyntaxException - Jmeter : Issue with HTTP request returns java.net.URISyntaxException java.net.URISyntaxException:索引75处路径中的非法字符 - java.net.URISyntaxException: Illegal character in path at index 75 JMeter:java.net.URISyntaxException:索引处的格式错误的转义对 - JMeter: java.net.URISyntaxException: Malformed escape pair at index java.net.URISyntaxException:带有jmeter的索引处的路径中的非法字符 - java.net.URISyntaxException: Illegal character in path at index with jmeter 使用DefaultHttpClient下载时出现java.net.URISyntaxException - java.net.URISyntaxException when downloading with DefaultHttpClient
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM