Chrome以“数据”打开;与硒 [英] Chrome opens with "Data;" with selenium
本文介绍了Chrome以“数据”打开;与硒的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是Selenium的新手,并试图通过selenium驱动程序从Chrome打开localhost:3000页面。
代码是:
import com.google.common.base.Function;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebDriverException;
import org.openqa.selenium.chrome.ChromeDriver;
导入org.openqa.selenium.firefox.FirefoxDriver;
导入org.openqa.selenium.firefox.FirefoxDriver;
public class SeleniumTests {
public static void main(String [] args){
System.setProperty(webdriver.chrome.driver ,C://chromedriver_win32//chromedriver.exe);
WebDriver driver = new ChromeDriver();
driver.get(localhost:3000);
}
}
但是,这会打开我的Chrome窗口用数据 。
chrome版本是50.0.2661.94
任何想法是什么问题?
http:// localhost:3000来指定您使用的协议,而不是 localhost:3000
。如果这没有帮助,请参阅此处的评论在Chromium问题追踪器上。 I am a newbie to Selenium and trying to open localhost:3000 page from Chrome via selenium driver. The code is :
import com.google.common.base.Function;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebDriverException;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public class SeleniumTests {
public static void main(String[] args) {
System.setProperty("webdriver.chrome.driver", "C://chromedriver_win32//chromedriver.exe");
WebDriver driver = new ChromeDriver();
driver.get("localhost:3000");
}
}
However, this opens my chrome window with a "data;" . The chrome version is 50.0.2661.94
Any idea what is the exact issue?
解决方案
Specify the protocol you are using, so instead of localhost:3000
, use http://localhost:3000
. If that doesn't help, see the comment here on the Chromium issue tracker.
这篇关于Chrome以“数据”打开;与硒的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文