Selenium - url中的登录名和密码生成错误

时间:2018-04-15 06:22:08

标签: java internet-explorer selenium-webdriver

我需要帮助解决 selenium-webdriver

的以下问题

我有一个这样的网址:

http://my-web-site/index-app

我需要在该网址中发送我的用户名和密码。

user: CAB\AB70123
pass: C2018+

然后,我有最后的网址:

http://CAB\AB70123:C2018+@my-web-site/index-app

但是当我执行我的java应用程序时

System.setProperty("webdriver.ie.driver", "C:\\selenium-drivers\\IEDriverServer.exe");
WebDriver webDriver = new InternetExplorerDriver();
webDriver.get("http://CAB\AB70123:C2018+@my-web-site/index-app");

我有以下错误跟踪:

Build info: version: '3.11.0', revision: 'e59cfb3', time: '2018-03-11T20:26:55.152Z'
System info: host: 'SOME-PC', ip: '172.25.128.1', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_161'
Driver info: org.openqa.selenium.ie.InternetExplorerDriver
Capabilities {acceptInsecureCerts: false, browserName: internet explorer, browserVersion: 11, javascriptEnabled: true, pageLoadStrategy: normal, platform: WINDOWS, platformName: WINDOWS, proxy: Proxy(), se:ieOptions: {browserAttachTimeout: 0, elementScrollBehavior: 0, enablePersistentHover: true, ie.browserCommandLineSwitches: , ie.ensureCleanSession: false, ie.fileUploadDialogTimeout: 3000, ie.forceCreateProcessApi: false, ignoreProtectedModeSettings: false, ignoreZoomSetting: false, initialBrowserUrl: http://localhost:29950/, nativeEvents: true, requireWindowFocus: false}, setWindowRect: true, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}}
Session ID: 907a8bc9-a3a8-4e3d-93e7-fb05b3744ba2
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:187)
    at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:122)
    at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:49)
    at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:158)
    at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:545)
    at org.openqa.selenium.remote.RemoteWebDriver.get(RemoteWebDriver.java:273)
    at com.occoa.selenium.App.main(App.java:16)

更新

我已经改为selenium-ie-driver v2.21.0并且已经看不到错误但是当我在url中执行时看到以下内容

http://cab/AB70123:C2018+@my-web-site/index-app

0 个答案:

没有答案