-
-
Notifications
You must be signed in to change notification settings - Fork 513
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have never opened the URL http://:-1/json/version through the api, in fact I opened the baidu.com but as soon as I run the test, it will automatically open the http://:-1/json/version URL and then it will report an error, the following is the code, can I ask for your help? #3274
Comments
Request DefaultHttpRequest(decodeResult: success, version: HTTP/1.1) Response DefaultHttpResponse(decodeResult: success, version: HTTP/1.1) 21:57:29.630 [AsyncHttpClient-1-2] DEBUG org.asynchttpclient.netty.channel.ChannelManager - Adding key: http://localhost:58025 for channel [id: 0x58d30f79, L:/127.0.0.1:53597 - R:localhost/127.0.0.1:58025] java.lang.IllegalArgumentException: http://:-1/json/version could not be parsed into a proper Uri, missing host
|
|
try { |
System.setProperty("webdriver.chrome.driver","D:\1\chromedriver_win32\chromedriver.exe");
//引入谷歌驱动
ChromeOptions options = new ChromeOptions();
//允许所有请求
options.addArguments("--remote-allow-origins=");
WebDriver webDriver = new ChromeDriver(options);
//启动需要打开的网页
webDriver.get("https://www.baidu.com");
// 利用id定位元素:百度输入框,并在输入框中输入:软件测试
webDriver.findElement(By.id("kw")).sendKeys("软件测试");
//通过name来定位
webDriver.findElement(By.name("wd")).sendKeys("软件测试");
//通过css选择器来定位
webDriver.findElement(By.xpath("//[@id="kw"]")).sendKeys("软件测试");
//通过Xpath来定位
webDriver.findElement(By.cssSelector("#kw")).sendKeys("软件测试");
The text was updated successfully, but these errors were encountered: