Record UI elements for TestFX
Asked Answered
H

1

8

There is an existing JavaFX based application, which I should write automated tests for. I just started to use TestFX(version 4.0.13-alpha) and looking for advice, how to record and identify UI objects of application. I tried following code to initialize a button, but it couldn't be clicked.

Button button = new Button("click me!");

I found these GUI inspect tools, but not sure, which one could works with TestFX.

Hyperostosis answered 31/7, 2018 at 9:17 Comment(0)
I
3

There is a really good documentation about TestFX queries which can be found on github (here). I would use the lookup(<label/buttontext>) version if it's not possible to define IDs on the components.

Ious answered 9/8, 2018 at 9:5 Comment(3)
I see, but it is not possible in case of black box testing.Hyperostosis
that doesn't mean that you can't use the lookup queries, or does it?Ious
As I see, yes. As a simple example, you can't use it also with calculator application.Hyperostosis

© 2022 - 2024 — McMap. All rights reserved.