Skip to content

Commit

Permalink
Fix chrome driver issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Aryan-Verma committed Aug 31, 2023
1 parent 4c85fb3 commit b448578
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ the License.-->
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-chrome-driver</artifactId>
<version>4.0.0-rc-1</version>
<version>4.11.0</version>
</dependency>

<dependency>
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/io/cdap/e2e/utils/SeleniumDriver.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

package io.cdap.e2e.utils;

import io.github.bonigarcia.wdm.WebDriverManager;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeDriverService;
import org.openqa.selenium.chrome.ChromeOptions;
import org.openqa.selenium.remote.HttpCommandExecutor;
import org.openqa.selenium.remote.SessionId;
Expand All @@ -43,7 +43,7 @@ public class SeleniumDriver {
private static ChromeDriver chromeDriver;

SeleniumDriver() throws IOException {
WebDriverManager.chromedriver().setup();
ChromeDriverService service = new ChromeDriverService.Builder().build();
ChromeOptions chromeOptions = new ChromeOptions();
chromeOptions.addArguments("--no-sandbox");
chromeOptions.addArguments("--disable-setuid-sandbox");
Expand All @@ -52,7 +52,7 @@ public class SeleniumDriver {
chromeOptions.addArguments("--disable-gpu");
chromeOptions.addArguments("--disable-dev-shm-usage");
chromeOptions.addArguments("--disable-features=VizDisplayCompositor");
chromeDriver = new ChromeDriver(chromeOptions);
chromeDriver = new ChromeDriver(service, chromeOptions);
chromeDriver.manage().window().maximize();
HttpCommandExecutor executor = (HttpCommandExecutor) chromeDriver.getCommandExecutor();
url = executor.getAddressOfRemoteServer();
Expand Down

0 comments on commit b448578

Please sign in to comment.