I have a Windows based application (.exe based) which upon launch comes up with Win form for login. Upon login, it loads the application and also loads the JxBrowser libs which launches an embedded chromium browser (I see in my task manager that Chromium.exe processes come up at this time). I plan to automate this embedded browser using selenium. So, I read about --remote-debugging-port
option, so I could access it in Chrome using selenium using localhost:<remote-debugging-port>
on which my application is launched.
I tried the following things to set the remote-debugging-port to my Windows application.
Option 1
In my Windows application exe path, I start it up with --remote-debugging-port=9222. When I launch the application, and then it comes up with embedded browsers, I then open a chrome window and try navigating to localhost:9222, and I get a Connection Refused.
I understand that somehow, within the application, when it launches the Chromium.exe processes, I need to send the remote-debugging-port in that Chromium.exe file.
Option 2
So, I create a shortcut for Chromium.exe, and add the --remote-debugging-port in the Target option of the shortcut. Then I again launch my Windows based application (this time without remote debugging port at Win application level). However, once the application is fully loaded, and the embedded JxBrowser based Chromium windows come up (and task manager launches the Chromium.exe) process, when I launch Chrome window and navigate to localhost:9222, again I get Connection Refused.
So, from the task manager, I then right-click on Chromium.exe process, and click on "Open File Location". It takes me to the Chromium.exe path. However, I had set the remote-debugging-port on the shortcut I created out of this Chromium.exe path, so I am not sure the application takes that (whether it needs to honor the remote-debugging-port from the shortcut of that actual exe path) into effect when it launches
After trying multiple different things, I am really stuck as to how I can make my Windows application chromium based process start up automatically with remote-debugging on so I can perform the automation activities using Selenium Chromedriver using localhost:9222
Since I am unable to inspect anything on the JxBrowser based Chromium embedded browser in my Windows application, I really need to have this working.
I went through the following article Automation for "Chrome Legacy Window" (Chromium) using Winium - however, this also does not give clarity as to how I can start my application with remote-debugging-port for the chromium process which comes up after the login to my windows process.
Has anybody encountered scenario like this, and been able to perform remote-debugging? Any help/advice would be really appreciated.
Please let me know if any specific information is required?