use of javafxlibrary.matchers.InstanceOfMatcher in project JavaFXLibrary by eficode.
the class ConvenienceKeywords method findClass.
@RobotKeyword("Returns the *first* node matching the query. \n\n" + "``query`` is the Class name String to use in lookup.\n" + "\nExample:\n" + "| ${my node}= | Find | javafx.scene.control.Button | # button class |")
@ArgumentNames({ "query" })
public Object findClass(final String query) {
try {
Class<?> clazz = Class.forName(query);
InstanceOfMatcher matcher = new InstanceOfMatcher(clazz);
return mapObject(robot.lookup(matcher).query());
} catch (Exception e) {
robotLog("TRACE", "Problem has occurred during node lookup: " + e);
return "";
}
}
Aggregations