I'm working on automation project, and I'm trying to select a html dropdown list and the item in the list with JAVA-code (not javascript). Apparently the best way to this is the GuiSubitemTestObject but on constructing the method i can't find 开发者_StackOverflow中文版any examples. Does anyone have an example.
SelectGuiSubitemTestObject object_for_select = ((SelectGuiSubitemTestObject) to[0]);
try {
// ITestDataList dataList = (ITestDataList)object_for_select.getTestData("list");
// ITestDataElementList elementList = (ITestDataElementList)dataList.getElements();
// for(int i = 0; i<elementList.getLength(); i++) {
// This statement prints the Items of the Listbox or combo box.
// System.out.println("Item Index "+i+" "+elementList.getElement(i).getElement().toString());
// }
object_for_select.select(what_to_set);
}
精彩评论