At work we are passing the --remote-debugging-port=9555 parameter to a CEF based desktop app and launching it using
Runtime.getRuntime.exec("path to app"). Then, using selenium, we open an instance of chrome and open the link http://localhost:9555 in it. This displays the entire html code of the desktop app in that browser instance.
Then we perform interactions like button clicks and data entry on the chrome browser using selenium. Any interaction performed on the browser is reflected on the app as well.
On many screens of the desktop app, the html visible on chrome browser to the user is different from the html visible to selenium. We confirmed this by running
driver.getPageSource() and observing completely different css and html. Due to this, buttons visible to the user on the screen are not visible to selenium. Hence selenium cannot click on the buttons on those screens. Is there way to solve this problem and get selenium to interact with those buttons?
If you query the page source using selenium you'll actually get the source and not the DOM, so anything you do dynamically to the source code via JS will not be displayed in the output. Seleniums interactions though do actually access the DOM so using the returned page source as a metric for what is "visible" to selenium is problematic at least. If you'd provide some more information on what you're actually trying to do I'd like to provide some more constructive advice.