0
私はtestFx 4に関する質問があります。 TextField( "#searchField")にテキストを設定するGUIオブジェクトがあります。 TestFx 3でTestFX 4でそれを行うには?
それの作品次のように:
//Load FXML
@Override
protected Parent getRootNode() {
Parent parent = null;
try {
FXMLLoader loader = new FXMLLoader();
loader.setResources(ResourceBundle.getBundle(ENTITIES_FIELDS_BUNDLE_PATH, Locale.GERMANY));
parent = loader.load(this.getClass().getClassLoader().getResource(SHOW_ALL_LAYOUT_PATH).openStream());
} catch (IOException ex) {}
return parent;
}
//Set text into Field and check it's there
@Test
public void setBothnamesAndCheckEnabledSearchButton() {
TextField searchField = find("#searchField");
searchField.setText("new text");
verifyThat("#searchField", hasText("new text"));
}
だから、それが動作し、すべての罰金。 TestFx 4で
100%同じ場合:
@Override
public void start(Stage stage) throws Exception {
try {
FXMLLoader loader = new FXMLLoader();
loader.setResources(ResourceBundle.getBundle(ENTITIES_FIELDS_BUNDLE_PATH, Locale.GERMANY));
AnchorPane pane = (AnchorPane)loader.load(this.getClass().getClassLoader().getResource(SHOW_ALL_LAYOUT_PATH).openStream());
Scene scene = new Scene(pane);
stage.setScene(scene);
} catch (IOException ex) {}
}
@Test
public void setBothnamesAndCheckEnabledSearchButton() {
clickOn("#searchField").write("new text");
verifyThat("#searchField", hasText("new text"));
}
私はいつも「FxRobotException:クエリ "になっ#searchFieldは、"。はノードが返されない、彼はしませんので、 "" 同じTextFieldを見る...
私は誰も私を助けてくださいすることができ感謝
誰もいませんか? OK。だから私はTestFX 3と一緒にいます。非常に悲しい... –