SAP / ui5-uiveri5

End-to-end testing framework for SAPUI5
Apache License 2.0
120 stars 56 forks source link

`stack: NoSuchSessionError: invalid session id` in Jenkins pipeline, but no locally #354

Closed robertiqkkk closed 2 years ago

robertiqkkk commented 2 years ago

Hello UIVERI5 team, hope you are doing fine!

We are facing a strange issue - stack: NoSuchSessionError: invalid session id. This error appears only during the Jenkins pipeline, locally no issues were observed.

I've attached verbose logs of the build where the run parameters and the error can be found.

uiveri5log.txt

Config after resolving config file and profile:

{
    "timeouts": {
        "waitForUI5Delta": 200,
        "getPageTimeout": "80000",
        "allScriptsTimeout": "81000",
        "defaultTimeoutInterval": "1200000",
        "waitForUI5PollingInterval": 400
    },
    "useClassicalWaitForUI5": false,
    "connection": "direct",
    "connectionConfigs": {
        "direct": {
            "name": "./connection/directConnectionProvider",
            "binaries": {
                "selenium": {
                    "version": "3.12",
                    "patch": "0",
                    "filename": "selenium-server-standalone",
                    "url": "https://selenium-release.storage.googleapis.com/3.12/selenium-server-standalone-3.12.0.jar",
                    "executable": "selenium-server-standalone-3.12.0.jar"
                },
                "chromedriver": {
                    "version": "{chrome.latest}",
                    "unzip": true,
                    "filename": "chromedriver",
                    "baseurl": "https://chromedriver.storage.googleapis.com",
                    "url": "https://chromedriver.storage.googleapis.com/{chrome.latest}/chromedriver_linux64.zip",
                    "latestVersionUrl": "https://chromedriver.storage.googleapis.com/LATEST_RELEASE_{chrome.latest}",
                    "latestMajorVersionFileUrl": "https://raw.githubusercontent.com/SAP/ui5-uiveri5/master/driverVersions.json",
                    "latestVersionDirectUrl": "https://chromedriver.storage.googleapis.com/LATEST_RELEASE",
                    "useDirectUrl": true,
                    "executable": {
                        "win32": "chromedriver-{chrome.latest}.exe",
                        "mac64": "chromedriver-{chrome.latest}",
                        "linux32": "chromedriver-{chrome.latest}",
                        "linux64": "chromedriver-{chrome.latest}"
                    }
                },
                "iedriver": {
                    "version": "3.12",
                    "patch": "0",
                    "unzip": true,
                    "filename": "IEDriverServer.exe",
                    "url": "http://selenium-release.storage.googleapis.com/3.12/IEDriverServer_Win32_3.12.0.zip",
                    "executable": "IEDriverServer.exe"
                },
                "geckodriver": {
                    "version": "{latest}",
                    "unzip": "false",
                    "untar": "true",
                    "filename": "geckodriver",
                    "baseurl": "http://github.com/mozilla/geckodriver/releases",
                    "url": "http://github.com/mozilla/geckodriver/releases/download/{latest}/geckodriver-{latest}-linux64.tar.gz",
                    "latestVersionRedirectUrl": "http://github.com/mozilla/geckodriver/releases/latest",
                    "executable": {
                        "win32": "geckodriver-{latest}.exe",
                        "win64": "geckodriver-{latest}.exe",
                        "mac64": "geckodriver-{latest}",
                        "linux32": "geckodriver-{latest}",
                        "linux64": "geckodriver-{latest}"
                    }
                }
            }
        }
    },
    "browserCapabilities": {
        "browser,chrome": { "android": { "*": { "deviceName": "android" } } },
        "firefox,ie,edge,safari,chrome,chromium": { "windows,mac,linux": { "*": { "remoteWebDriverOptions": { "maximized": true } } } },
        "chrome,chromium": {
            "*": { "*": { "chromeOptions": { "args": ["--no-sandbox", "--disable-dev-shm-usage", "--disable-gpu", "disable-infobars"] } } }
        },
        "safari": { "mac": { "*": { "safaridriverOptions": { "addArguments": ["--legacy"] } } } },
        "chromeMobileEmulation": {
            "*": {
                "*": {
                    "browserName": "chrome",
                    "remoteWebDriverOptions": { "maximized": false, "scaling": { "x": 4, "y": 4 } },
                    "chromeOptions": {
                        "mobileEmulation": { "deviceMetrics": { "width": 360, "height": 560, "pixelRatio": 4 } },
                        "args": ["--no-sandbox", "--disable-dev-shm-usage", "--disable-gpu", "--disable-infobars"]
                    }
                }
            }
        },
        "chromeHeadless": {
            "*": {
                "*": {
                    "browserName": "chrome",
                    "remoteWebDriverOptions": { "browserSize": { "width": 1600, "height": 1200 } },
                    "chromeOptions": {
                        "args": ["--headless", "--no-sandbox", "--disable-dev-shm-usage", "--disable-gpu", "--disable-infobars"]
                    }
                }
            }
        }
    },
    "auth": {
        "sapcloud-form": {
            "user": "#####################",
            "pass": "########",
            "userFieldSelector": "input[name='j_username']",
            "passFieldSelector": "input[type='password']",
            "conditionalLogonButtonSelector": "button[type='submit']",
            "logonButtonSelector": "button[type='submit']"
        }
    },
    "authConfigs": {
        "plain": { "name": "./authenticator/plainAuthenticator" },
        "basic": { "name": "./authenticator/basicUrlAuthenticator" },
        "fiori-form": {
            "name": "./authenticator/formAuthenticator",
            "userFieldSelector": "#USERNAME_BLOCK input",
            "passFieldSelector": "#PASSWORD_BLOCK input",
            "logonButtonSelector": "#LOGIN_LINK"
        },
        "sapcloud-form": {
            "name": "./authenticator/formAuthenticator",
            "userFieldSelector": "#j_username",
            "passFieldSelector": "#j_password",
            "logonButtonSelector": "#logOnFormSubmit"
        },
        "github-form": {
            "name": "./authenticator/formAuthenticator",
            "userFieldSelector": "#login_field",
            "passFieldSelector": "#password",
            "logonButtonSelector": "input[type=submit]",
            "authorizationButtonSelector": "button[type=submit]",
            "authorizationButtonTimeout": 10000
        }
    },
    "matchers": [],
    "log": { "browser": { "level": "SEVERE" } },
    "specResolver": "./resolver/localSpecResolver",
    "pageLoading": { "wait": "3000" },
    "takeScreenshot": { "onExpectFailure": true, "onExpectSuccess": true, "onAction": true },
    "profile": "integration",
    "browserName": "chrome",
    "baseUrl": "https://bigbuild-test-copin.internal.cfapps.sap.hana.ondemand.com/cp.portal/site?SAP_PIN_TESTMODE=true#Shell-home",
    "browsers": [
        {
            "browserName": "chrome",
            "capabilities": {
                "chromeOptions": {
                    "args": [
                        "--no-sandbox",
                        "--disable-dev-shm-usage",
                        "--disable-gpu",
                        "disable-infobars",
                        "--headless",
                        "--window-size=1600,900",
                        "lang=en-US",
                        "--disable-infobars",
                        "--disable-browser-side-navigation",
                        "--disable-features=VizDisplayCompositor"
                    ]
                },
                "remoteWebDriverOptions": { "maximized": true },
                "goog:chromeOptions": { "w3c": false },
                "chromedriverOptions": { "loggingTo": "chromedriver.log" }
            },
            "platformName": "linux",
            "platformResolution": "1600x1200",
            "browserVersion": "*",
            "platformVersion": "*",
            "ui5": { "theme": "belize", "direction": "ltr", "mode": "cozy" }
        }
    ],
    "params": { "TEST_USERNAME": "#####################", "TEST_PASSWORD": "########" },
    "seleniumLoopback": false,
    "ignoreNothing": true,
    "v": 1,
    "verbose": 1,
    "seleniumAddress": "http://selenium:4444/wd/hub",
    "specs": "./tests/UserStaffingInvitation.spec.js",
    "conf": "/var/jenkins_home/workspace/Project Invitation Staffing E2E-Testspace/conf.js",
    "reporters": [{ "name": "./reporter/screenshotReporter" }, { "name": "./reporter/consoleReporter" }],
    "locators": [{ "name": "./locators/jqueryLocator" }, { "name": "./locators/controlLocator" }],
    "plugins": [{ "name": "./plugins/browserLogsPlugin" }],
    "osTypeString": "linux64",
    "runtimes": [
        {
            "browserName": "chrome",
            "capabilities": {
                "chromeOptions": {
                    "args": [
                        "--no-sandbox",
                        "--disable-dev-shm-usage",
                        "--disable-gpu",
                        "disable-infobars",
                        "--headless",
                        "--window-size=1600,900",
                        "lang=en-US",
                        "--disable-infobars",
                        "--disable-browser-side-navigation",
                        "--disable-features=VizDisplayCompositor"
                    ]
                },
                "remoteWebDriverOptions": { "maximized": true },
                "goog:chromeOptions": { "w3c": false },
                "chromedriverOptions": { "loggingTo": "chromedriver.log" }
            },
            "platformName": "linux",
            "platformResolution": "1600x1200",
            "browserVersion": "*",
            "platformVersion": "*",
            "ui5": { "theme": "belize", "direction": "ltr", "mode": "cozy" }
        }
    ]
}

Could you give us a hint of what might be wrong?

BR, Robert

hmanchev commented 2 years ago

Hi Robert,

As you describe the test is running fine locally and fails only in the pipeline, I can conclude that there is an issue in your pipeline setup. From the log I can see that the execution with the uiveri5ExecuteTests Piper step is started successfully and you have some passed expectations and then something is causing the error.

I am not able to hint you as I am not aware of your Jenkins pipeline/Piper implementation nor your test script. Nevertheless Jenkins pipeline and Piper integrations are out of our scope.

Best Regards, Hristo

hmanchev commented 2 years ago

Closing the issue as we agreed that the issue is not related with UiVeri5.