SeleniumHQ / selenium

A browser automation framework and ecosystem.
https://selenium.dev
Apache License 2.0
30.18k stars 8.1k forks source link

[🐛 Bug]: Selenium Manager needs to static link binary #11400

Closed gheeno closed 1 year ago

gheeno commented 1 year ago

What happened?

Issue : java.lang.IllegalStateException: The path to the driver executable The path to the driver executable must be set by the webdriver.chrome.driver system property

Steps :

  1. Add 4.6.0 to POM
  2. run test in a jenkins server

Results :

10:34:49.999 [pool-1-thread-1] WARN  o.o.s.remote.service.DriverService - Unable to obtain driver using Selenium Manager: Error running command: [/tmp/selenium-manager20252854139289024732448555598337657/selenium-manager, --driver, chromedriver]

POM :

<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.testframework</groupId>
    <artifactId>testframework</artifactId>
    <version>1.0-SNAPSHOT</version>

    <name>Automation UI Test Framework</name>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <maven-download-plugin.version>1.3.0</maven-download-plugin.version>
        <maven-surefire.version>3.0.0-M4</maven-surefire.version>
        <logback-classic.version>1.2.3</logback-classic.version>
        <slf4j.version>1.7.25</slf4j.version>
        <owner.version>1.0.8</owner.version>
        <testng.version>6.14.3</testng.version>
        <webdrivermanager.version>5.3.0</webdrivermanager.version>
        <lombok.version>1.18.22</lombok.version>
        <hamcrest-all.version>1.3</hamcrest-all.version>
        <selenium-java.version>4.6.0</selenium-java.version>
        <junit.version>4.12</junit.version>
        <common-io.version>2.6</common-io.version>
        <cucumber.version>6.9.1</cucumber.version>
        <cucumber-html.version>0.2.7</cucumber-html.version>
        <cucumber-jvm-deps.version>1.0.6</cucumber-jvm-deps.version>
        <cluecumber-report.version>2.3.1</cluecumber-report.version>
        <gherkin.version>16.0.0</gherkin.version>
        <gson.version>2.8.6</gson.version>
        <json-simple.version>1.1.1</json-simple.version>
        <skipStaticAnalysis>false</skipStaticAnalysis>
        <rest_assured.version>4.2.0</rest_assured.version>
        <spring.version>5.3.13</spring.version>
        <spring-boot.version>2.5.0</spring-boot.version>
        <groovy.version>3.0.5</groovy.version>
        <mysql.version>5.1.39</mysql.version>
        <mariadb.version>1.5.5</mariadb.version>
        <json.version>20211205</json.version>
        <vavr.version>0.9.0</vavr.version>
        <junit-vintage.version>5.7.2</junit-vintage.version>
        <aspectj.version>1.9.2</aspectj.version>
        <allure.version>2.17.3</allure.version>
        <allure.maven.plugin.version>2.8</allure.maven.plugin.version>
        <allure.cli.version>2.17.3</allure.cli.version>
        <maven.exec.plugin.version>3.0.0</maven.exec.plugin.version>
        <netty-handler.version>4.1.85.Final</netty-handler.version>
        <jackson-databind.version>2.9.8</jackson-databind.version>
        <pdf-box.version>3.0.0-RC1</pdf-box.version>
        <sikulix.version>2.0.5</sikulix.version>
        <qtest-java-sdk.version>1.4.10</qtest-java-sdk.version>
        <open.csv.version>5.6</open.csv.version>
        <jackson-dataformat-csv.version>2.13.3</jackson-dataformat-csv.version>
        <appium.version>8.2.1</appium.version>

    </properties>

    <dependencies>
        <!--Java core-->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>${slf4j.version}</version>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>${logback-classic.version}</version>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>${lombok.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${junit.version}</version>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-all</artifactId>
            <version>${hamcrest-all.version}</version>
        </dependency>
        <dependency>
            <groupId>org.codehaus.httpcache4j.uribuilder</groupId>
            <artifactId>uribuilder</artifactId>
            <version>2.0.0</version>
        </dependency>

        <!--Cucumber Selenium requirements-->
        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-java</artifactId>
            <version>${selenium-java.version}</version>
        </dependency>

        <!--Appium-->
        <dependency>
            <groupId>io.appium</groupId>
            <artifactId>java-client</artifactId>
            <version>${appium.version}</version>
        </dependency>

        <!-- netty explicit dependency is required for selenium to remove conflicts with other netty versions -->
        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty-handler</artifactId>
            <version>${netty-handler.version}</version>
        </dependency>
        <dependency>
            <groupId>io.cucumber</groupId>
            <artifactId>cucumber-jvm</artifactId>
            <version>${cucumber.version}</version>
            <type>pom</type>
        </dependency>
        <dependency>
            <groupId>io.cucumber</groupId>
            <artifactId>cucumber-java</artifactId>
            <version>${cucumber.version}</version>
        </dependency>
        <dependency>
            <groupId>io.cucumber</groupId>
            <artifactId>cucumber-html</artifactId>
            <version>${cucumber-html.version}</version>
        </dependency>
        <dependency>
            <groupId>io.cucumber</groupId>
            <artifactId>gherkin</artifactId>
            <version>${gherkin.version}</version>
        </dependency>

        <!--Properties file mapper-->
        <dependency>
            <groupId>org.aeonbits.owner</groupId>
            <artifactId>owner</artifactId>
            <version>${owner.version}</version>
        </dependency>

        <!--HTTP Calls / JSON modifier-->
        <dependency>
            <groupId>io.rest-assured</groupId>
            <artifactId>rest-assured</artifactId>
            <version>${rest_assured.version}</version>
        </dependency>
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>${gson.version}</version>
        </dependency>
        <dependency>
            <groupId>com.googlecode.json-simple</groupId>
            <artifactId>json-simple</artifactId>
            <version>${json-simple.version}</version>
        </dependency>
        <dependency>
            <groupId>org.json</groupId>
            <artifactId>json</artifactId>
            <version>${json.version}</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>${jackson-databind.version}</version>
        </dependency>

        <!--Dependency Injection : Spring & Cucumber State Transfer-->
        <dependency>
            <groupId>io.cucumber</groupId>
            <artifactId>cucumber-spring</artifactId>
            <version>${cucumber.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>${spring.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <version>${spring-boot.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.junit.jupiter</groupId>
                    <artifactId>junit-jupiter</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.junit.vintage</groupId>
                    <artifactId>junit-vintage-engine</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.vaadin.external.google</groupId>
                    <artifactId>android-json</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.mockito</groupId>
                    <artifactId>mockito-junit-jupiter</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <!-- vavr dependency for fluent try catch blocks -->
        <dependency>
            <groupId>io.vavr</groupId>
            <artifactId>vavr</artifactId>
            <version>${vavr.version}</version>
        </dependency>

        <!--JUnit Parallel Test Run Dependencies-->
        <dependency>
            <groupId>io.cucumber</groupId>
            <artifactId>cucumber-junit</artifactId>
            <version>${cucumber.version}</version>
            <scope>test</scope>
        </dependency>

        <!--Database hooks-->
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>${mysql.version}</version>
        </dependency>
        <dependency>
            <groupId>org.mariadb.jdbc</groupId>
            <artifactId>mariadb-java-client</artifactId>
            <version>${mariadb.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-jdbc</artifactId>
            <version>${spring-boot.version}</version>
        </dependency>

        <!-- reporting dependencies -->
        <dependency>
            <groupId>io.qameta.allure</groupId>
            <artifactId>allure-cucumber6-jvm</artifactId>
            <version>${allure.version}</version>
        </dependency>
        <dependency>
            <groupId>io.qameta.allure</groupId>
            <artifactId>allure-rest-assured</artifactId>
            <version>${allure.version}</version>
        </dependency>
        <dependency>
            <groupId>org.aspectj</groupId>
            <artifactId>aspectjweaver</artifactId>
            <version>${aspectj.version}</version>
        </dependency>

        <!--pdf parser dependency-->
        <dependency>
            <groupId>org.apache.pdfbox</groupId>
            <artifactId>pdfbox</artifactId>
            <version>${pdf-box.version}</version>
        </dependency>

        <!-- csv parser dependency -->
        <dependency>
            <groupId>com.opencsv</groupId>
            <artifactId>opencsv</artifactId>
            <version>${open.csv.version}</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.dataformat</groupId>
            <artifactId>jackson-dataformat-csv</artifactId>
            <version>${jackson-dataformat-csv.version}</version>
        </dependency>

        <!--QTest integration dependency-->
        <dependency>
            <groupId>com.qasymphony.qtest</groupId>
            <artifactId>qtest-sdk-java</artifactId>
            <version>${qtest-java-sdk.version}</version>
        </dependency>

        <!--image validation dependency-->
        <dependency>
            <groupId>com.sikulix</groupId>
            <artifactId>sikulixapi</artifactId>
            <version>${sikulix.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-nop</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>log4j</groupId>
                    <artifactId>log4j</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>${maven-surefire.version}</version>
                <executions>
                    <execution>
                        <id>Initial Test Run</id>
                        <phase>test</phase>
                        <goals>
                            <goal>integration-test</goal>
                        </goals>
                        <configuration>
                            <argLine>
                                -javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar"
                            </argLine>
                            <argLine>-Duser.timezone=Canada/Mountain</argLine>
                            <excludes>
                                <exclude>**/DeveloperTools.java</exclude>
                                <exclude>**/FailedTestReRunnerIT.java</exclude>
                            </excludes>
                            <parallel>methods</parallel>
                            <threadCount>8</threadCount>
                            <perCoreThreadCount>false</perCoreThreadCount>
                            <rerunFailingTestsCount>1</rerunFailingTestsCount>
                        </configuration>
                    </execution>
                    <execution>
                        <id>Verify</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>verify</goal>
                        </goals>
                        <configuration>
                            <testFailureIgnore>true</testFailureIgnore>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>io.qameta.allure</groupId>
                <artifactId>allure-maven</artifactId>
                <version>${allure.maven.plugin.version}</version>
                <configuration>
                    <reportDirectory>target/allure-report</reportDirectory>
                    <reportingOutputDirectory>target/allure-report</reportingOutputDirectory>
                    <reportVersion>${allure.cli.version}</reportVersion>
                    <allureDownloadUrl>
                        https://repo.maven.apache.org/maven2/io/qameta/allure/allure-commandline/%s/allure-commandline-%s.zip
                    </allureDownloadUrl>
                </configuration>
                <executions>
                    <execution>
                        <id>Test Report</id>
                        <phase>post-integration-test</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>3.0.0</version>
                <configuration>
                    <skip>${skipStaticAnalysis}</skip>
                    <consoleOutput>true</consoleOutput>
                    <configLocation>build_config/checkstyle.xml</configLocation>
                    <propertyExpansion>basedir=${project.basedir}</propertyExpansion>
                    <violationSeverity>info</violationSeverity>
                    <includeTestSourceDirectory>true</includeTestSourceDirectory>
                    <sourceDirectories>
                        <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
                    </sourceDirectories>
                </configuration>
                <executions>
                    <execution>
                        <phase>verify</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <!-- below plugin is used for pos batch execution-->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>${maven.exec.plugin.version}</version>
                <executions>
                    <execution>
                        <id>user-sync-batch</id>
                        <configuration>
                            <mainClass>com.core.batches.user.UserSyncBatchRunner</mainClass>
                        </configuration>
                    </execution>
                    <execution>
                        <id>workstation-sync-batch</id>
                        <configuration>
                            <mainClass>com.core.batches.workstation.WorkStationSyncBatchRunner</mainClass>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>

Note :

Running the same test locally, after deleting all the initial webdrivers, it runs fine. Local machine spec: MacOS Ventura ( intel chip )

Running 4.6.0 with Bonni's WebDriverManager in Jenkins ( Linux )

11:08:26.679 [pool-1-thread-3] INFO  c.pos.stepdefinitions.CucumberHooks - Thread - 14 - Scenario - MKS - Go to Inventory Lookup app and do a basic SKU search.
11:08:28.700 [pool-1-thread-3] INFO  i.g.bonigarcia.wdm.WebDriverManager - Using chromedriver 87.0.4280.88 (resolved driver for Chrome 87)
11:08:28.731 [pool-1-thread-3] INFO  i.g.bonigarcia.wdm.WebDriverManager - Reading https://chromedriver.storage.googleapis.com/ to seek chromedriver
11:08:29.473 [pool-1-thread-3] INFO  i.g.bonigarcia.wdm.online.Downloader - Downloading https://chromedriver.storage.googleapis.com/87.0.4280.88/chromedriver_linux64.zip
11:08:30.050 [pool-1-thread-3] INFO  i.g.bonigarcia.wdm.online.Downloader - Extracting driver from compressed file chromedriver_linux64.zip
11:08:30.167 [pool-1-thread-3] INFO  i.g.bonigarcia.wdm.WebDriverManager - Exporting webdriver.chrome.driver as /home/jenkins/.cache/selenium/chromedriver/linux64/87.0.4280.88/chromedriver
Starting ChromeDriver 87.0.4280.88 (89e2380a3e36c3464b5dd1302349b1382549290d-refs/branch-heads/4280@{#1761}) on port 25532

Environments

Selenium 4.6.0 / 4.7.0( without Boni's webDriverManager )

  1. Linux - Chrome 87 -- Where the failure is seen.
  2. macOS Ventura - Chrome 108 -- Runs as expected, chrome driver is downloaded and executes the test.

Selenium 4.6.0 ( with Boni's webDriverManager )

  1. Linux - Chrome 87 -- Runs as expected.
  2. macOS Ventura - Chrome 108 -- Runs as expected, chrome driver is downloaded and executes the test.

How can we reproduce the issue?

Execute the test on a Linux machine, Jenkins.

Relevant log output

10:34:49.999 [pool-1-thread-1] WARN  o.o.s.remote.service.DriverService - Unable to obtain driver using Selenium Manager: Error running command: [/tmp/selenium-manager20252854139289024732448555598337657/selenium-manager, --driver, chromedriver]
Build info: version: '4.6.0', revision: '79f1c02ae20'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '3.10.0-1160.76.1.el7.x86_64', java.version: '1.8.0_275'
Driver info: driver.version: ChromeDriver
  Given a default browser is opened                                                 # com.pos.stepdefinitions.steps.common.WindowHandlerSteps.openBrowser()
      java.lang.IllegalStateException: The path to the driver executable The path to the driver executable must be set by the webdriver.chrome.driver system property; for more information, see https://chromedriver.chromium.org/. The latest version can be downloaded from https://chromedriver.chromium.org/downloads
    at org.openqa.selenium.internal.Require$StateChecker.nonNull(Require.java:314)
    at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:148)
    at org.openqa.selenium.chrome.ChromeDriverService.access$000(ChromeDriverService.java:39)
    at org.openqa.selenium.chrome.ChromeDriverService$Builder.findDefaultExecutable(ChromeDriverService.java:233)
    at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:450)
    at org.openqa.selenium.chrome.ChromeDriverService.createServiceWithConfig(ChromeDriverService.java:142)
    at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:70)
    at com.core.factory.webdriver.DriverSettings.startDefaultDriver(DriverSettings.java:50)
    at com.core.factory.webdriver.DriverActions.openBrowser(DriverActions.java:51)
    at com.pos.stepdefinitions.steps.common.WindowHandlerSteps.openBrowser(WindowHandlerSteps.java:22)
    at ✽.a default browser is opened(file:///apps/jenkins/slave/workspace/Automation/Tools%20-%20Feature%20Branch%20Smoke%20Test/src/test/java/com/features/tools/smoke/PosServices_Smoke.feature:5)

Operating System

Linux ( Jenkins ) , macOS Ventura ( Local )

Selenium version

4.6.0 , 4.7.0

What are the browser(s) and version(s) where you see this issue?

Chrome 87

What are the browser driver(s) and version(s) where you see this issue?

Chrome 87, Chrome 108

Are you using Selenium Grid?

No

github-actions[bot] commented 1 year ago

@gheeno, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

titusfortner commented 1 year ago

Can you run with 4.7? We improved the error message for that error.

gheeno commented 1 year ago

@titusfortner , updated dependency to 4.7 and reran the smoke test.

Still the same observation as 4.6

      java.lang.IllegalStateException: The path to the driver executable The path to the driver executable must be set by the webdriver.chrome.driver system property; for more information, see https://chromedriver.chromium.org/. The latest version can be downloaded from https://chromedriver.chromium.org/downloads
    at org.openqa.selenium.internal.Require$StateChecker.nonNull(Require.java:314)
    at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:148)
    at org.openqa.selenium.chrome.ChromeDriverService.access$000(ChromeDriverService.java:39)
    at org.openqa.selenium.chrome.ChromeDriverService$Builder.findDefaultExecutable(ChromeDriverService.java:233)
    at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:450)
    at org.openqa.selenium.chrome.ChromeDriverService.createServiceWithConfig(ChromeDriverService.java:142)
    at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:70)
    at com.core.factory.webdriver.DriverSettings.startDefaultDriver(DriverSettings.java:51)
    at com.core.factory.webdriver.DriverActions.openBrowser(DriverActions.java:51)
    at com.pos.stepdefinitions.steps.common.WindowHandlerSteps.openBrowser(WindowHandlerSteps.java:22)
    at ✽.a default browser is opened(file:///apps/jenkins/slave/workspace/Automation/Tools%20-%20Feature%20Branch%20Smoke%20Test/src/test/java/com/features/cbo/boui/DeviceOverviewService.feature:5)
titusfortner commented 1 year ago

Right, there should be something more on this line in 4.7:

10:34:49.999 [pool-1-thread-1] WARN  o.o.s.remote.service.DriverService - Unable to obtain driver using Selenium Manager: Error running command: [/tmp/selenium-manager20252854139289024732448555598337657/selenium-manager, --driver, chromedriver]
gheeno commented 1 year ago

@titusfortner , used 4.7 here

[INFO] Running SMOKE TEST - MKS - Employee Sale
14:53:52.831 [pool-1-thread-8] INFO  o.s.b.t.c.SpringBootTestContextBootstrapper - Neither @ContextConfiguration nor @ContextHierarchy found for test class [com.core.config.SpringTestConfig], using SpringBootContextLoader
14:53:52.837 [pool-1-thread-8] INFO  o.s.t.c.s.AbstractContextLoader - Could not detect default resource locations for test class [com.core.config.SpringTestConfig]: no resource found for suffixes {-context.xml, Context.groovy}.
14:53:53.052 [pool-1-thread-8] INFO  o.s.b.t.c.SpringBootTestContextBootstrapper - Loaded default TestExecutionListener class names from location [META-INF/spring.factories]: [org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener, org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener, org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener, org.springframework.boot.test.autoconfigure.web.client.MockRestServiceServerResetTestExecutionListener, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrintOnlyOnFailureTestExecutionListener, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverTestExecutionListener, org.springframework.boot.test.autoconfigure.webservices.client.MockWebServiceServerTestExecutionListener, org.springframework.test.context.web.ServletTestExecutionListener, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener, org.springframework.test.context.event.ApplicationEventsTestExecutionListener, org.springframework.test.context.support.DependencyInjectionTestExecutionListener, org.springframework.test.context.support.DirtiesContextTestExecutionListener, org.springframework.test.context.transaction.TransactionalTestExecutionListener, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener, org.springframework.test.context.event.EventPublishingTestExecutionListener]
14:53:53.083 [pool-1-thread-8] INFO  o.s.b.t.c.SpringBootTestContextBootstrapper - Using TestExecutionListeners: [org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener@618e0ec8, org.springframework.test.context.event.ApplicationEventsTestExecutionListener@317d6e22, org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener@30fbe6e9, org.springframework.boot.test.autoconfigure.SpringBootDependencyInjectionTestExecutionListener@7796ade9, org.springframework.test.context.support.DirtiesContextTestExecutionListener@667f059d, org.springframework.test.context.transaction.TransactionalTestExecutionListener@3c296b0e, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener@530a1ecc, org.springframework.test.context.event.EventPublishingTestExecutionListener@11b108a1, org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener@ffcb4e7, org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener@787adf0d, org.springframework.boot.test.autoconfigure.web.client.MockRestServiceServerResetTestExecutionListener@7b8542b0, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrintOnlyOnFailureTestExecutionListener@62e8a961, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverTestExecutionListener@8597257, org.springframework.boot.test.autoconfigure.webservices.client.MockWebServiceServerTestExecutionListener@26f556e6]

@smoke
Scenario: Return Transaction - non-receipted return                                                                   # src/test/java/com/features/tools/smoke/Mks_Smoke.feature:9
14:53:55.993 [pool-1-thread-8] INFO  c.pos.stepdefinitions.CucumberHooks - Thread - 19 - Scenario - Return Transaction - non-receipted return
14:53:56.154 [pool-1-thread-8] WARN  o.o.s.remote.service.DriverService - Unable to obtain driver using Selenium Manager: Unsuccessful command executed: [/tmp/selenium-manager20408319189877774246851600088809023/selenium-manager, --driver, chromedriver]
/tmp/selenium-manager20408319189877774246851600088809023/selenium-manager: /lib64/libc.so.6: version `GLIBC_2.29' not found (required by /tmp/selenium-manager20408319189877774246851600088809023/selenium-manager)
/tmp/selenium-manager20408319189877774246851600088809023/selenium-manager: /lib64/libc.so.6: version `GLIBC_2.25' not found (required by /tmp/selenium-manager20408319189877774246851600088809023/selenium-manager)
/tmp/selenium-manager20408319189877774246851600088809023/selenium-manager: /lib64/libc.so.6: version `GLIBC_2.28' not found (required by /tmp/selenium-manager20408319189877774246851600088809023/selenium-manager)
/tmp/selenium-manager20408319189877774246851600088809023/selenium-manager: /lib64/libc.so.6: version `GLIBC_2.18' not found (required by /tmp/selenium-manager20408319189877774246851600088809023/selenium-manager)

Build info: version: '4.7.0', revision: '0a5b49d16f'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '3.10.0-1160.76.1.el7.x86_64', java.version: '1.8.0_275'
Driver info: driver.version: ChromeDriver
  Given a default browser is opened                                                                                   # com.pos.stepdefinitions.steps.common.WindowHandlerSteps.openBrowser()
      java.lang.IllegalStateException: The path to the driver executable The path to the driver executable must be set by the webdriver.chrome.driver system property; for more information, see https://chromedriver.chromium.org/. The latest version can be downloaded from https://chromedriver.chromium.org/downloads
    at org.openqa.selenium.internal.Require$StateChecker.nonNull(Require.java:314)
    at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:148)
    at org.openqa.selenium.chrome.ChromeDriverService.access$000(ChromeDriverService.java:39)
    at org.openqa.selenium.chrome.ChromeDriverService$Builder.findDefaultExecutable(ChromeDriverService.java:233)
    at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:450)
    at org.openqa.selenium.chrome.ChromeDriverService.createServiceWithConfig(ChromeDriverService.java:142)
    at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:70)
    at com.core.factory.webdriver.DriverSettings.startDefaultDriver(DriverSettings.java:51)
    at com.core.factory.webdriver.DriverActions.openBrowser(DriverActions.java:51)
    at com.pos.stepdefinitions.steps.common.WindowHandlerSteps.openBrowser(WindowHandlerSteps.java:22)
    at ✽.a default browser is opened(file:///apps/jenkins/slave/workspace/Automation/Tools%20-%20Feature%20Branch%20Smoke%20Test/src/test/java/com/features/tools/smoke/Mks_Smoke.feature:5)
titusfortner commented 1 year ago

@diemol maybe some CI environments don't give the execution permissions in temp directories?

Maybe this is the real use case for #11359?

diemol commented 1 year ago

I'll defer to what @bonigarcia thinks, because if @gheeno says that it works with WebDriverManager, then we might be missing something there.

bonigarcia commented 1 year ago

These traces shows the cause of the issue:

14:53:56.154 [pool-1-thread-8] WARN  o.o.s.remote.service.DriverService - Unable to obtain driver using Selenium Manager: Unsuccessful command executed: [/tmp/selenium-manager20408319189877774246851600088809023/selenium-manager, --driver, chromedriver]
/tmp/selenium-manager20408319189877774246851600088809023/selenium-manager: /lib64/libc.so.6: version `GLIBC_2.29' not found (required by /tmp/selenium-manager20408319189877774246851600088809023/selenium-manager)

It seems that the selenium-manager binary cannot be executed in your Linux because of the glibc version. For the upcoming releases of Selenium Manager, we can try prevent this problem by linking statically the Rust binary (e.g. see reference).

@gheeno For trying to solve the issue in Selenium 4.7, you can try to update your glibc to version 2.29, as follows:

sudo apt install libc-bin=2.29 libc6=2.29
gheeno commented 1 year ago

@bonigarcia thanks for the feedback. I'll probably wait for 4.8, our we use RedHat 7 and it's limited to 2.19. I'll use your WebDriverManager in the time meantime.

Thanks, team.

bonigarcia commented 1 year ago

I have just created a PR (#11471) to prevent this issue in the upcoming versions of Selenium Manager.

@gheeno Is it possible you try this at your end, please? To do that, download following Selenium Manager binary: selenium-manager_linux-x64, uncompress it in the machine you experienced the issue (your Jenkins), and execute the following:

./selenium-manager --browser chrome --debug

Please let us know if the issue has been fixed with that binary, thanks.

gheeno commented 1 year ago

I have just created a PR (#11471) to prevent this issue in the upcoming versions of Selenium Manager.

@gheeno Is it possible you try this at your end, please? To do that, download following Selenium Manager binary: selenium-manager_linux-x64, uncompress it in the machine you experienced the issue (your Jenkins), and execute the following:

./selenium-manager --browser chrome --debug

Please let us know if the issue has been fixed with that binary, thanks.

For sure. I am currently on vacation for a week. I’ll execute it when I get back. January 3 2023.

Thanks for looking into this!

Have a great holiday season.

titusfortner commented 1 year ago

11471 merged