Hi,
i’m writing a test on page that has multiple items.
each item is a backup, each backup has a type and a number.
i want to get the number of the backup, which i can find in the id of the object, from the type which is entered by the user.
here is my code:
@Keyword
def int getBackupNum(String backupType)
{
TestObject backupIcon = new TestObject()
String src = “//*[@src = '/assets/device_icon_” + backupType + “.png]”
backupIcon.addProperty(“src”, ConditionType.EQUALS, src )
WebUI.verifyElementPresent(backupIcon, 0)
List list = backupIcon.getProperties()
String id = backupIcon.getObjectId()
int num = Integer.parseInt(id.replaceAll(“\\D”, “”));
return num
}
i can’t get the id from no where, both list & id doesn’t have what i need.
any ideas?