-1

I have a scene in JavaFX in which there is a CustomTextField with an autocomplete function. When user is typing a popup is opened with more columns. I have done an automatic scenario in TestFX witch is typing in the CustomTextField.

Is there any way to navigate through the popup, through it's columns?

clickOn(article2SearchTxt);
write(cfgUiTest.article2SearchVal);
push(KeyCode.ENTER);

The structure is: Scene, Popup, HBox, VBox, Cells. Actually there is a popup with columns from a database. Content of Popup is HBox and VBox. (a table) I want to access the content of the cells. With "clickOn" on the text is not working, but if I get the content of the cell I can move with "TAB" over it and press "ENTER"

If I do a sysout on this:

System.out.println(((PopupColumn) ((VBox) IntellitaxUI.getPopup().getContentHBox().getChildren().get(5)).getChildren().get(2)).getItems());

I get the content of the cells but in a TextFlow. Ho can I get the content of it?

selectedItem popupcontent selectedItem], TextFlow@7f3d205f[styleClass=popupcontent selectedItem], TextFlow@761997b6[styleClass=popupcontent selectedItem], TextFlow@777a8ef1[styleClass=popupcontent selectedItem], TextFlow@6a680ebb[styleClass=popupcontent selectedItem], TextFlow@50f69067[styleClass=popupcontent selectedItem], 
Trica
  • 53
  • 6

1 Answers1

0

The navigation through a popup with rows/columns can be done by two ways:

1) Emulating DOWN/UP/LEFT/RIGHT arrow pressing:

press(KeyCode.DOWN).release(KeyCode.DOWN);

2) Emulating mouse click or double click on a specific text:

clickOn("expected text");
doubleClickOn("expected text");

UPDATE:

According to your println expression and its result I draw by hand the next model of your table:

enter image description here

What I can see is a collection of TextFlow controls in each cell. Is it correct? May be only one TextFlow is to be in the cell?

BTW, why not to use the standard TableView control for database data presentation?

Dmytro Maslenko
  • 2,247
  • 9
  • 16
  • Key.DOWN is working but when I press ENTER I receive the error - '"org.testfx.api.FxRobotException: the query "A2A SPACER BOX" returned no nodes."' - The text exist. – Trica Feb 14 '18 at 10:40
  • Seems "A2A SPACER BOX" is an id of your popup? If so, seems you try to look up it after popup was closed. Try to find who calls this look up and why. Is it possible to lookup before ENTER press? – Dmytro Maslenko Feb 14 '18 at 18:58