MavenでFirefoxDriverを使って簡単な自動テストを作成する必要があります。MavenでFirefoxでSelenium WebDriverテストケースを実行するには?
のpom.xmlからの抜粋:
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.53.1</version>
</dependency>
テスト・ケース:
:@BeforeTest public void StartBrowser_NavURL() { capability = DesiredCapabilities.firefox(); capability.setCapability("platform", Platform.ANY); capability.setCapability("binary", "C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe"); driver = new FirefoxDriver(capability); driver.manage().window().maximize(); } @AfterTest public void CloseBrowser() { driver.quit(); } @Test public void testToCompareDoubles() { driver.get("http://www.google.com"); }
とコマンドの実行テストを実行した後、私は次の例外を受け取り
mvn -test
org.openqa.selenium.WebDriverException:ポート7055のバイナリFirefoxBinary(C:\ Program Files(x86)\ Mozilla Firefox \ firefox.exe)に接続できませんでした。プロセス出力は次のようになります。LightweightThemeManagerのシャットダウンブロッカを起動します。
Mozilla Firefox version: 49.0.1
(Selenium Webdriverと互換性があります)。 "hosts"ファイルは空です。 Windowsのファイアウォールが無効になって
ご意見はありますか?問題を解決するにはどうすればよいですか?