I have test case that works fine in my local eclipse environment.
@Test
@Order(1)
void testTitle(@Arguments("--headless") ChromeDriver driver) {
driver.get("https://google.com");
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
assertThat(driver.getTitle(), containsString("Google"));
}
But when I used the same in Gitlab it fails. I used the following docker image: maven:3.3.9-jdk-8.
It downloads and extracts chrome driver https://chromedriver.storage.googleapis.com/90.0.4430.24/chromedriver_linux64.zip 2021-05-17 16:33:54.508 INFO --- [ main] i.g.bonigarcia.wdm.online.Downloader : Downloading https://chromedriver.storage.googleapis.com/90.0.4430.24/chromedriver_linux64.zip 2021-05-17 16:33:54.977 INFO --- [ main] i.g.bonigarcia.wdm.online.Downloader : Extracting driver from compressed file chromedriver_linux64.zip 2021-05-17 16:33:55.083 INFO --- [ main] i.g.bonigarcia.wdm.WebDriverManager : Exporting webdriver.chrome.driver as /root/.cache/selenium/chromedriver/linux64/90.0.4430.24/chromedriver
but shows the following error during test execution
Caused by: io.github.bonigarcia.seljup.SeleniumJupiterException: org.openqa.selenium.WebDriverException: unknown error: cannot find Chrome binary
Any idea from anyone?