[英]java.net.URISyntaxException: Expected authority at index 7: http://
我收到錯誤消息:
引起原因:java.net.URISyntaxException:索引7的預期授權:http://
對於以下代碼:
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;
}
堆棧跟蹤:
驅動程序信息: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)位於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 $解析 org.apache.http.impl.conn.SystemDefaultRoutePlanner.determineProxy(SystemDefaultRoutePlanner.java:75)的java.net.URI。(URI.java:588)的r.parse(URI.java:3053)...另外15個
請幫忙!
僅通過%40編碼@即可解決錯誤
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.