How to use custom chrome profile (Electron browser) with remote webdriver

64 views Asked by At

I am using selenium grid where multiple laptops are connected as a node machine and we are using electron browser to launch the application. It was working fine but now it's broken cause browser requires some local cache to launch the application. If I use browser profile then it works fine on local machine but does not work on remote machine, I am using selenium with Java, is there a way to use custom browser profile so that application is loading fine in all node machines? FYI we are running automation in offline mode where all the hub, node machines are connected via router and server is also hosted locally.

Below code works on local device but not in remote:

var options = new ChromeOptions();
options.setBinary(ConfigReader.getConfigData().getProperty("SECURED_BROWSER"));
options.addArguments("--remote-debugging-port=5858");
options.addArguments("--no-sandbox");
options.addArguments("--disable-setuid-sandbox");
options.addArguments("user-data-dir=C:\\users\\SystemAdmin\\ADP Electron");
options.addArguments("--profile-directory=Userdata");
var gridUrl = ConfigReader.getConfigData().getProperty("GRID_URL");
driver = new RemoteWebDriver(new URL(gridUrl), options);

Running above command suppose to launch application directly, I don't need to send driver.get(url) command.

0

There are 0 answers