TA的每日心情 | 擦汗 6 小时前 |
---|
签到天数: 527 天 连续签到: 4 天 [LV.9]测试副司令
|
1测试积点
自学基于Java的webdriver 照着网上找的一些入门教程写了一段简短的代码,但运行时发生异常,求教各位大神如何解决此问题。
代码为:
- package org.coderinfo.demo;
- import org.openqa.selenium.WebDriver;
- import org.openqa.selenium.firefox.FirefoxDriver;
- public class TestEnv {
- public static void main(String[] args) {
- System.setProperty("webdriver.firefox.bin", "D:\\Program Files\\Mozilla Firefox\\firefox.exe" );
- WebDriver driver = new FirefoxDriver();
- driver.get("http://www.baidu.com");
- System.out.println("page title is:"+driver.getTitle());
- }
- }
复制代码 报错信息为:
- Exception in thread "main" org.openqa.selenium.WebDriverException: Unable to bind to locking port 7054 within 45000 ms
- Build info: version: '2.7.0', revision: '13926', time: '2011-09-23 13:24:59'
- System info: os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_131'
- Driver info: driver.version: FirefoxDriver
- at org.openqa.selenium.internal.SocketLock.lock(SocketLock.java:95)
- at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:70)
- at org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:149)
- at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:72)
- at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:128)
- at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:79)
- at org.coderinfo.demo.TestEnv.main(TestEnv.java:11)
复制代码
还有图片
|
|