Jenkins管道,Cucumber测试步骤:由于页面崩溃而导致会话被删除

时间:2018-01-25 07:51:59

标签: java selenium jenkins cucumber docker-swarm

我正面临着这个问题。当我尝试构建我的Jenkins管道时,有一个测试步骤始终失败。注意:当我在swarm模式下构建Docker镜像时,本地它按预期工作,并且没有任何失败测试。我使用chrome = 56.0.2924.87,chromedriver = 2.27.440175,selenium / hub:3.0.1,os.name:'Linux'(在Windows上确定)

 @When("^I want to preview customizations$")
    @DescribedAs("I want to preview customizations")
    public void previewCustomizations(){
        final String idButton="previewCustomization";
        commonDefinition.getBrowsers().execute(browser -> {
            final WebElement webElement = browser.findElement(By.id(idButton))
                    .orElseThrow(() -> new CucumberException(String.format("Unable to find overview button by [%s] id", idButton)));
            webElement.click();
        });
    }


Tests run: 26, Failures: 0, Errors: 2, Skipped: 7, Time elapsed: 0.003 sec <<< FAILURE! - in Scenario: XXXX
I want to preview customizations(Scenario: XXXX)  Time elapsed: 0.003 sec  <<< ERROR!
org.openqa.selenium.WebDriverException: unknown error: session deleted because of page crash
from tab crashed
  (Session info: chrome=56.0.2924.87)
  (Driver info: chromedriver=2.27.440175 (9bc1d90b8bfa4dd181fbbf769a5eb5e575574320),platform=Linux 3.10.0-514.21.1.el7.x86_64 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 1.74 seconds
Build info: version: '3.0.1', revision: '1969d75', time: '2016-10-18 09:48:19 -0700'
System info: host: '', ip: '', os.name: 'Linux', os.arch: 'amd64', os.version: '3.10.0-514.21.1.el7.x86_64', java.version: '1.8.0_121'


org.openqa.selenium.WebDriverException: unknown error: session deleted because of page crash
from tab crashed
  (Session info: chrome=56.0.2924.87)
  (Driver info: chromedriver=2.27.440175 (9bc1d90b8bfa4dd181fbbf769a5eb5e575574320),platform=Linux 3.10.0-514.21.1.el7.x86_64 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 1.74 seconds
Build info: version: '3.0.1', revision: '1969d75', time: '2016-10-18 09:48:19 -0700'
System info: host: '', ip: '', os.name: 'Linux', os.arch: 'amd64', os.version: '3.10.0-514.21.1.el7.x86_64', java.version: '1.8.0_121'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{applicationCacheEnabled=false, rotatable=false, mobileEmulationEnabled=false, networkConnectionEnabled=false, chrome={chromedriverVersion=2.27.440175 (9bc1d90b8bfa4dd181fbbf769a5eb5e575574320), userDataDir=/tmp/.org.chromium.Chromium.70A1hR}, takesHeapSnapshot=true, pageLoadStrategy=normal, databaseEnabled=false, handlesAlerts=true, hasTouchScreen=false, version=56.0.2924.87, platform=LINUX, browserConnectionEnabled=false, nativeEvents=true, acceptSslCerts=true, locationContextEnabled=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true, unexpectedAlertBehaviour=accept}]
Session ID: 1e439001dcab758d5e223feb8215ecc9
Command duration or timeout: 1.90 seconds
Build info: version: '3.0.1', revision: '1969d75', time: '2016-10-18 09:49:13 -0700'
System info: host: '', ip: '', os.name: 'Linux', os.arch: 'amd64', os.version: '3.10.0-514.6.1.el7.x86_64', java.version: '1.8.0_151'
Driver info: org.openqa.selenium.remote.RemoteWebDriver
Capabilities [{applicationCacheEnabled=false, rotatable=false, mobileEmulationEnabled=false, networkConnectionEnabled=false, chrome={chromedriverVersion=2.27.440175 (9bc1d90b8bfa4dd181fbbf769a5eb5e575574320), userDataDir=/tmp/.org.chromium.Chromium.70A1hR}, takesHeapSnapshot=true, pageLoadStrategy=normal, databaseEnabled=false, handlesAlerts=true, hasTouchScreen=true, version=56.0.2924.87, platform=LINUX, browserConnectionEnabled=false, nativeEvents=true, acceptSslCerts=true, webdriver.remote.sessionid=600786ad-3faa-49a9-b056-09acb1aec681, locationContextEnabled=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true, unexpectedAlertBehaviour=accept}]
Session ID: 600786ad-3faa-49a9-b056-09acb1aec681
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:216)
    at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:168)

0 个答案:

没有答案