0
セレンでクローム(または他のブラウザ)を起動できません。 私の家庭のパソコンから同じコードを実行します。だから私はそれがファイアウォールとセキュリティが設定されていると考えている。クロムがセレンで起動していません。3.2
セレンのバージョンは3.2、Chromeのドライバのバージョンは2.28です。私はまた2.25(同じエラー)を試しました。使用コード:
System.setProperty("webdriver.chrome.driver", "K://browserdriver//chromedriver.exe");
WebDriver driver = new ChromeDriver();
driver.get("http://google.com");
エラーメッセージ:
Starting ChromeDriver 2.28.455520 (cc17746adff54984afff480136733114c6b3704b) on port 12121
Only local connections are allowed.
[0.023][SEVERE]: CreatePlatformSocket() returned an error: An invalid argument was supplied. (0x2726)
[0.023][SEVERE]: CreatePlatformSocket() returned an error: An invalid argument was supplied. (0x2726)
Port not available. Exiting...
Mar 11, 2017 9:13:06 PM org.openqa.selenium.os.UnixProcess checkForError
SEVERE: org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
FAILED CONFIGURATION: @BeforeTest beforeTest
org.openqa.selenium.WebDriverException: Timed out waiting for driver server to start.
Build info: version: '3.2.0', revision: '8c03df6b79', time: '2017-02-23 10:51:31 +0000'
System info: host: 'a1', ip: '', os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.8.0_77'
Driver info: driver.version: ChromeDriver
\t at org.openqa.selenium.remote.service.DriverService.waitUntilAvailable(DriverService.java:180)
\t at org.openqa.selenium.remote.service.DriverService.start(DriverService.java:168)
\t at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:78)
\t at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:604)
\t at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:244)
\t at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:131)
\t at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:144)
\t at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:178)
\t at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:167)
\t at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:124)
\t at browesertest.NewTest.beforeTest(NewTest.java:23)
\t at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
\t at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
\t at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
\t at java.lang.reflect.Method.invoke(Unknown Source)
\t at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80)
\t at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:564)
\t at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:213)
\t at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:138)
\t at org.testng.TestRunner.beforeRun(TestRunner.java:641)
\t at org.testng.TestRunner.run(TestRunner.java:609)
\t at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
\t at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
\t at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
\t at org.testng.SuiteRunner.run(SuiteRunner.java:240)
\t at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
\t at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
\t at org.testng.TestNG.runSuitesSequentially(TestNG.java:1198)
\t at org.testng.TestNG.runSuitesLocally(TestNG.java:1123)
\t at org.testng.TestNG.run(TestNG.java:1031)
\t at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:132)
\t at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:236)
\t at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:81)
Caused by: org.openqa.selenium.net.UrlChecker$TimeoutException: Timed out waiting for [http://localhost:24144/status] to be available after 20001 ms
\t at org.openqa.selenium.net.UrlChecker.waitUntilAvailable(UrlChecker.java:107)
\t at org.openqa.selenium.remote.service.DriverService.waitUntilAvailable(DriverService.java:177)
\t ... 32 more
Caused by: com.google.common.util.concurrent.UncheckedTimeoutException: java.util.concurrent.TimeoutException
\t at com.google.common.util.concurrent.SimpleTimeLimiter.callWithTimeout(SimpleTimeLimiter.java:140)
\t at org.openqa.selenium.net.UrlChecker.waitUntilAvailable(UrlChecker.java:80)
\t ... 33 more
Caused by: java.util.concurrent.TimeoutException
\t at java.util.concurrent.FutureTask.get(Unknown Source)
\t at com.google.common.util.c