ruffle-rs / ruffle

A Flash Player emulator written in Rust
https://ruffle.rs
Other
15.66k stars 813 forks source link

Lunar Lander can't identify START button to have Selenium click on it. Isn't identifiable in Chrome dev tools #18524

Open breezin320 opened 5 hours ago

breezin320 commented 5 hours ago

Working to get Lunar Lander (old Flash game) working in Ruffle. It works fine manually, but I need to automate pressing the "Start" button using Selenium. Chrome Dev tools can't identify the Start button. It simply reports as part of the "body" element. If I right click on it manually, the Ruffle popup menu appears. Image of Start screen uploaded. Image

I've also tried using Selenium to scan the page and report Button ID's, but that didn't work.

Any suggestions as to how to identify the Start button, use some key combination, or other approach to push it? Totally stumped thanks for your help!! dave

kjarosh commented 5 hours ago

Hello đź‘‹

Ruffle does not produce interactive HTML, instead it draws the content on a canvas and provides interactive elements (e.g. buttons) in its own way. The only solution you can employ is to click the button based on its x,y coordinates on the canvas.

You can see how Ruffle does it by picking the element in Dev Tools—press Ctrl+Shift+C and select the Flash content on the page. You'll see a shadow root (Ruffle player) and a canvas inside which draws the content.

breezin320 commented 5 hours ago

Thanks for the quick and helpful response!!!! Much appreciated....

will go down this road....onward! thanks again dave

n0samu commented 4 hours ago

Another option is to use JPEXS Decompiler to create a modified version of the game that automatically starts. That would probably involve copying whatever code runs when the button is pressed and inserting that code elsewhere in the game. I've done modifications like this before and they usually took me a few hours of work.

breezin320 commented 3 hours ago

Thanks for the suggestion! Sounds like a bit more surgery than I'm capable of doing. I did take a look at JPEXS, and will see if I can go down that road....

dave