-2

I am trying to automate a JavaFx application which has an integrated web page for loggin in. I am using the code found here: https://jxbrowser.support.teamdev.com/support/solutions/articles/9000013135-jxbrowser-selenium and every thing is working great on my local machine. The issue is that I need to open the application on a remote machine and integrate with it as well. The above code will not work, I am getting

unknown error: cannot connect to chrome at 192.168.2.147:9222
from chrome not reachable

ERROR.

I have tried another method not using the chromeDriverService but using selenium grid and it looks like this:

DesiredCapabilities capabilities = new DesiredCapabilities();
ChromeOptions options = new ChromeOptions();

String remoteDebuggingAddress = add + ":9222";

options.setExperimentalOption("debuggerAddress", remoteDebuggingAddress);
capabilities.setCapability(ChromeOptions.CAPABILITY, options);

LoggingPreferences logs = new LoggingPreferences();
logs.enable(LogType.BROWSER, Level.ALL);
capabilities.setCapability(CapabilityType.LOGGING_PREFS, logs);

jxDriver = new RemoteWebDriver(new URL("http://" + add + ":5555" + "/wd/hub"), capabilities);
return jxDriver;

I run the hub on port 5555 and the node on the machine machine. The chromeDriver is in the path envVar, and I see in the cmd window that a connection request is sent. The result is the same.

Can anyone please advise what am I doing wrong here? Can this remote jxbroswer automation possible?

EDIT: When I initialize a Chrome session on the remote machine it works as expected (using selenium grid) but when I add

options.setExperimentalOption("debuggerAddress", remoteDebuggingAddress);

it fails with same error.

MarkZvu
  • 51
  • 5

2 Answers2

0

This error message...

unknown error: cannot connect to chrome at 192.168.2.147:9222 from chrome not reachable

...implies that the ChromeDriver was unable to initiate/spawn a new Browsing Context i.e. Chrome Browser session.

Your main issue is the incompatibility between the version of the binaries you are using.

As far as Selenium driven WebDriver controlled is concerned you are following the correct documentation.

However, in this discussion @SerhiiFedchenko mentioned, this particular approach was tested with Selenium WebDriver 2.46 and ChromeDriver 2.16. JxBrowser was not tested with the older/newer versions of Selenium WebDriver and ChromeDriver.


Solution

A possible solution would be to execute your test with the tested version of the binaries:

  • Selenium WebDriver 2.46
  • ChromeDriver 2.16
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
  • Thanks for the detailed answer but our application is using chromium 69.x.x and ChromeDriver 2.16 is not supported. Another thing that I checked is starting a regular chrome seesion, while I am able to start a chrome browser seesion on the remote machine, if I add the "debuggerAddress" to chromeOptions, it fails, so I guess the problem is somewhere with this flag. – MarkZvu Jul 07 '20 at 05:14
0

So I was able to find the solution for this and the problem was the IP that I sent to "debuggerAddress". While I sent the remote machine IP I should have used "localhost" as the connection was already established using the selenium grid.

MarkZvu
  • 51
  • 5