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:
def int getBackupNum(String backupType)
TestObject backupIcon = new TestObject()
String src = “//*[@src = '/assets/device_icon_” + backupType + “.png]”
backupIcon.addProperty(“src”, ConditionType.EQUALS, src )
List list = backupIcon.getProperties()
String id = backupIcon.getObjectId()
int num = Integer.parseInt(id.replaceAll(“\\D”, “”));
i can’t get the id from no where, both list & id doesn’t have what i need.