after i have finished recording, there are some other sets of data which are different from what i record. how can i use these data by one test class.
that means when i play back, the windowstester can import these data automaticlly
Moderators: gnebling, Eric Clayberg, Dan Rubel, keertip, Phil Quitslund
public class TestGoods extends UITestCaseSWT {
static final class Good {
String name;
String type;
String description;
}
private static final Good SAMPLE_GOOD = new Good();
static {
SAMPLE_GOOD.name = "EVERGREEN";
SAMPLE_GOOD.type = "0783W";
SAMPLE_GOOD.description = "TEST ENTRY TAB 0234nh768";
}
public void testExample() throws Exception {
Good[] goods = getGoods();
for (Good good : goods) {
enter(good);
}
}
private Good[] getGoods() {
//ultimately get the goods from a datastore...
//for now just a sample entry
return new Good[]{SAMPLE_GOOD};
}
private void enter(Good good) throws WidgetSearchException {
enterGood(good.name, good.type, good.description);
}
private void enterGood(String name, String type, String description) throws WidgetSearchException {
IUIContext ui = getUI();
//probably need a selection here to establish initial focus
ui.enterText(name);
ui.keyClick(WT.TAB);
ui.enterText(type);
ui.keyClick(WT.TAB);
ui.click(new XYLocator(new LabeledTextLocator("Desc of Goods"), -352,
26));
ui.keyClick(WT.CTRL, 'a');
ui.keyClick(WT.BS);
ui.enterText(description);
//validation here?
}
}
Users browsing this forum: No registered users and 1 guest