1

Win7Pro マシンで Selenium 2.53.1 を実行すると、以下のエラーが発生します。Firefox のバグであることがわかりました。しかし、バージョン 49.0.2 を使用しているため、このエラーは解決されたため、予期していませんでした。

どうすればこれを解決できますか?

オプション #1: 以前のバージョン (48.0.2) をインストールしたことを思い出しました。FF のすべてのバージョンを削除し、最新バージョンをインストールしました。残念ながら、これは私の問題を解決しませんでした。

オプション #2: URL を変更したとき、テストではなく受け入れ環境のために、値を入力してテストケースを処理することができました。SSL証明書かもしれません???

注: 私の評判はここで質問するには不十分だったので、新しい質問で質問する必要がありました。

また、さらに情報が必要な場合は、追加します。

2016-11-08 11:22:07,316 - INFO  nl.spp.BrowserController       - Configuring firefox
2016-11-08 11:22:07,434 - INFO  nl.spp.BrowserController       - Starting firefox
1478600528072   geckodriver INFO    Listening on 127.0.0.1:44190
1478600528098   mozprofile::profile INFO    Using profile path C:\Users\AD529~1.DIA\AppData\Local\Temp\rust_mozprofile.wOU06Xtrmvik
1478600528101   geckodriver::marionette INFO    Starting browser C:\Program Files (x86)\Mozilla Firefox\firefox.exe
1478600528113   geckodriver::marionette INFO    Connecting to Marionette on localhost:51363
1478600530286   Marionette  INFO    Listening on port 51363
1478600532338   Marionette  INFO    startBrowser 521e1fd8-3c94-4c4e-a244-cfbf62c951d8
2016-11-08 11:22:12,841 - INFO  nl.spp.BrowserController       - Firefox loaded.
2016-11-08 11:22:12,862 - DEBUG nl.spp.Controller              - Loading: https://cimlamp12/login
2016-11-08 11:22:13,287 - DEBUG nl.spp.FrameWork               - Error loading page (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 407 milliseconds
Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:32:46'
System info: host: 'Computer0139', ip: '10.3.0.204', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_102'
Driver info: org.openqa.selenium.firefox.MarionetteDriver
Capabilities [{rotatable=false, raisesAccessibilityExceptions=false, marionette=true, appBuildId=20161019084923, version=, platform=XP, proxy={}, command_id=1, specificationLevel=0, acceptSslCerts=false, processId=4600, binary=C:\Program Files (x86)\Mozilla Firefox\firefox.exe, browserVersion=49.0.2, platformVersion=6.1, XULappId={ec8030f7-c20a-464f-9b0e-13a3a9e97384}, browserName=firefox, takesScreenshot=true, takesElementScreenshot=true, platformName=windows_nt, device=desktop, firefox_profile=UEsDBBQACAgIAMNaaEkAAAAAAAAAA...}]
Session ID: 521e1fd8-3c94-4c4e-a244-cfbf62c951d8
2016-11-08 11:22:13,289 - ERROR TestResultsLogger              - Error loading page (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 407 milliseconds
Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:32:46'
System info: host: 'Computer0139', ip: '10.3.0.204', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_102'
Driver info: org.openqa.selenium.firefox.MarionetteDriver
Capabilities [{rotatable=false, raisesAccessibilityExceptions=false, marionette=true, appBuildId=20161019084923, version=, platform=XP, proxy={}, command_id=1, specificationLevel=0, acceptSslCerts=false, processId=4600, binary=C:\Program Files (x86)\Mozilla Firefox\firefox.exe, browserVersion=49.0.2, platformVersion=6.1, XULappId={ec8030f7-c20a-464f-9b0e-13a3a9e97384}, browserName=firefox, takesScreenshot=true, takesElementScreenshot=true, platformName=windows_nt, device=desktop, firefox_profile=UEsDBBQACAgIAMNaaEkAAAAAAAAAA...}]
Session ID: 521e1fd8-3c94-4c4e-a244-cfbf62c951d8
2016-11-08 11:22:13,305 - ERROR TestResultsLogger              - TestCase: TCDI01 failed! 2016-11-08_11-22-13.305
2016-11-08 11:22:13,327 - INFO  nl.spp.Controller              - Stopping firefox
Child 3732 ###!!! ABORT: Aborting on channel error.: file c:/builds/moz2_slave/m-rel-w32-00000000000000000000/build/src/ipc/glue/MessageChannel.cpp, line 2052
Exception in thread "main" org.openqa.selenium.remote.UnreachableBrowserException: Error communicating with the remote browser. It may have died.
Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:32:46'
System info: host: 'Computer0139', ip: '10.3.0.204', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_102'
Driver info: driver.version: RemoteWebDriver
Capabilities [{rotatable=false, raisesAccessibilityExceptions=false, marionette=true, appBuildId=20161019084923, version=, platform=XP, proxy={}, command_id=1, specificationLevel=0, acceptSslCerts=false, processId=4036, binary=C:\Program Files (x86)\Mozilla Firefox\firefox.exe, browserVersion=49.0.2, platformVersion=6.1, XULappId={ec8030f7-c20a-464f-9b0e-13a3a9e97384}, browserName=firefox, takesScreenshot=true, takesElementScreenshot=true, platformName=windows_nt, device=desktop, firefox_profile=UEsDBBQACAgIAC9WaEkAAAAAAAAAA...}]
Session ID: 927daba8-9f7c-4e69-ac4c-a0a1ce1b7b39
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:665)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:701)
    at org.openqa.selenium.remote.RemoteWebDriver.quit(RemoteWebDriver.java:526)
    at nl.spp.Controller.stopBrowser(Controller.java:213)
    at nl.spp.FrameWork.running(FrameWork.java:140)
    at nl.spp.FrameWork.start(FrameWork.java:80)
    at nl.spp.Apl.main(Apl.java:37)
Caused by: java.lang.IllegalStateException: UnixUtils may not be used on Windows
    at org.openqa.selenium.os.ProcessUtils.getProcessId(ProcessUtils.java:189)
    at org.openqa.selenium.os.UnixProcess$SeleniumWatchDog.getPID(UnixProcess.java:222)
    at org.openqa.selenium.os.UnixProcess$SeleniumWatchDog.access$3(UnixProcess.java:221)
    at org.openqa.selenium.os.UnixProcess.destroy(UnixProcess.java:132)
    at org.openqa.selenium.os.CommandLine.destroy(CommandLine.java:155)
    at org.openqa.selenium.remote.service.DriverService.stop(DriverService.java:196)
    at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:94)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:644)
    ... 6 more

FF を開始するために使用するコード:

public WebDriver loadBrowser(String strBrowser) {

    WebDriver driver = null;
    //String Xport = System.getProperty("lmportal.xvfb.id", ":1");

    //System.setProperty("webdriver.gecko.driver", "C:\\Programs\\GeckoDriver\\geckodriver.exe");
    System.setProperty("webdriver.gecko.driver", "F:\\Project\\GeckoDriver\\wires.exe");
    //System.setProperty("webdriver.firefox.marionette", "C:\\Programs\\GeckoDriver\\geckodriver.exe");

    if(strBrowser.equals("FireFox")) {

        // Start FireFox
        log.info("Configuring firefox");

        //Now you can initialize marionette driver to launch firefox
        DesiredCapabilities capabilities = DesiredCapabilities.firefox();
        capabilities.setCapability("marionette", true);

        //Windows config
        capabilities.setCapability("binary", "C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe");

        //Linux config
        //capabilities.setCapability("binary", "/usr/bin/firefox");

        //setting the profile
        FirefoxProfile profile = new FirefoxProfile();
        profile.setEnableNativeEvents(true);
        profile.setPreference( "intl.accept_languages", "no,en-us,en" ); 
        profile.setPreference( "privacy.clearOnShutdown.cookies", true );
        profile.setPreference( "privacy.clearOnShutdown.formdata", true );
        profile.setPreference( "privacy.donottrackheader.enabled", true );
        profile.setPreference( "browser.tabs.tabMaxWidth", 100 );
        profile.setPreference( "browser.cache.disk.capacity", 10240 );
        profile.setPreference( "browser.link.open_newwindow.override.external", 2);
        capabilities.setCapability(FirefoxDriver.PROFILE, profile);

        log.info("Starting firefox");

        //setting the environment
        driver = new MarionetteDriver(capabilities);

        driver.manage().timeouts().implicitlyWait(Long.parseLong(conConfig.getProperty("Implicit wait")), TimeUnit.SECONDS);

        log.info("Firefox loaded.");
    }
    else if(strBrowser.equals("Chrome")) {
        log.info("Starting chrome");
        System.setProperty("webdriver.chrome.driver", "C:\\Program Files (x86)\\Google\\ChromeDriver2016\\chromedriver.exe");
        driver = new ChromeDriver();
        driver.manage().timeouts().implicitlyWait(Long.parseLong(conConfig.getProperty("Implicit wait")), TimeUnit.SECONDS);

        log.info("Chrome loaded.");
    }

    return driver;
}
4

0 に答える 0