Download Saros Test Framework
Transcript
withText(“Finish”)
withLabel(“Username:”)
withRegex(“Proceed to step (.*)”)
widgetOfType(Button.class)
withStyle(SWT.ARROW, “SWT.ARROW”)
And combine all matchers with
allOf(matchers...)
anyOf(matchers...)
not(matcher)
allOf(anyOf(matchers...), matchers...)
At last put the whole thing together (the end user API)
public SWTBotTree treeWithLabelInGroup(String l, String g, int i) {
//create the matcher
Matcher matcher = allOf(widgetOfType(Tree.class), withLabel(l), inGroup(g));
//find the widget
Tree tree = (Tree)widget(matcher, index);
//create a wrapper for thread safety and convenience APIs
return new SWTBotTree(tree, matcher);
}
Performing actions
The [Widget]WithLabel method finds the widget control specified with the given label, so you will get a
SWTBot[Widget] object on which actions can be performed.
21