I need to run Selenium Java tests with Maven.
My config.yml is :
version: 2.1
jobs:
# Below is the definition of your job to build and test your app, you can rename and customize it as you want.
Run On DEV Login:
docker:
- image: cimg/openjdk:11.0
steps:
# Checkout the code as the first step.
- checkout
# Use mvn clean and package as the standard maven build phase
- run:
name: Build
command: mvn -B -DskipTests clean package
# Then run your tests!
- run:
name: Test
command: mvn test -Denv=DEV -DtestngXML='login.xml'
- store_test_results:
path: target/surefire-reports
- store_artifacts:
path: target/surefire-reports
Run On DEV SignUp:
docker:
- image: cimg/openjdk:11.0
steps:
# Checkout the code as the first step.
- checkout
# Use mvn clean and package as the standard maven build phase
- run:
name: Build
command: mvn -B -DskipTests clean package
# Then run your tests!
- run:
name: Test
command: mvn test -Denv=DEV -DtestngXML='signUp.xml'
- store_test_results:
path: target/surefire-reports
- store_artifacts:
path: target/surefire-reports
# Invoke jobs via workflows
# See: https://circleci.com/docs/2.0/configuration-reference/#workflows
workflows:
test: # This is the name of the workflow, feel free to change it to better match your workflow.
# Inside the workflow, you define the jobs you want to run.
jobs:
- Run On DEV Login
- Run On DEV SignUp
But I have got errors:
og.openqa.selenium.WebDriverException: Timed out waiting for driver server to start.
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: '912db0d61cad', ip: '192.168.48.3', os.name: 'Linux', os.arch: 'amd64', os.version: '5.13.0-1021-aws', java.version: '11.0.13'
Driver info: driver.version: ChromeDriver
[main] INFO io.github.bonigarcia.wdm.WebDriverManager - Exporting webdriver.chrome.driver as /home/circleci/.cache/selenium/chromedriver/linux64/101.0.4951.41/chromedriver
/home/circleci/.cache/selenium/chromedriver/linux64/101.0.4951.41/chromedriver: error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory
May 02, 2022 7:32:50 AM org.openqa.selenium.os.OsProcess checkForError
My ChromeDriver settings:
ChromeOptions options = new ChromeOptions();
options.addArguments("--window-size=1920,1080");
options.addArguments("--start-maximized");
options.addArguments("--headless");
options.addArguments("--disable-gpu");
Could you, please, help me resolve this issue?