Should javafx.scene.robot.Robot be able to use nested event loops?
Martin Fox
martin at martinfox.com
Mon May 22 14:42:23 UTC 2023
Mark,
Do you have a sample app that exhibits this behavior? I can’t reproduce it on Mac or Windows.
I can’t think of anything on the Robot side that would cause this. A Robot just asks the OS to post an event. The event isn’t targeted at a specific process or window and the Robot has no control over where it ends up. If it does get delivered to your app it should behave exactly like a user generated event.
If the user can close the window it means there’s an event loop running and that should be draining the OS queue. So I’m puzzled by what’s going on here.
Anyway, not expected behavior. Still a mystery.
Martin
> On May 20, 2023, at 2:19 PM, Mark Raynsford <org.openjdk at io7m.com> wrote:
>
> (Apologies for what might be the third duplicate to the list; for some
> reason list mail is reaching me, but none of my messages to the list
> are getting through).
>
> Hello!
>
> I've been putting together some integration tests using
> javafx.scene.robot.Robot for an application. I've noticed that if the
> application creates a Stage and then calls showAndWait() on it, there
> appears to be no way to get a robot to send events to that stage. If
> that Stage is opened during an integration test, and then manually
> closed by the user, all of the events (mouse clicks, keys typed, etc)
> that _would_ have been sent are immediately applied in the context of
> the outer event loop.
>
> Is this expected behaviour? The various Robot implementation classes
> are suspiciously short, so I'm guessing that this is something that's
> just not supported.
>
> --
> Mark Raynsford | https://www.io7m.com
More information about the openjfx-dev
mailing list