this is the object '‘Object Repository/nine/Sent/SearchResult’ properties (locator using attribute)
where the text ‘[RegressionTestcase]001.SendMail 15122020033833’ is dynamic as per my test case I send string based on auto generated current timestamp.
//*[@class = ‘android.widget.TextView’ and (@text = ‘[RegressionTestcase]001.SendMail 15122020033833’ or . = ‘[RegressionTestcase]001.SendMail 15122020033833’) and @resource-id = ‘com.ninefolders.hd3:id/search_overlay_item_text’]
In test case, i know the verifyElementExist maybe helpful, but how do I make the object properties updated based on my test case? or my approach could be wrong, i should not use that element as object, please advise.
test case, i generate timestamp, send it as part of mail subject.
at search box, i retrieve back the timestamp string and do search.
i want to verify search result returned correctly:
//At Composer, set subject-setup subject dynamic name
def TimeStampNow = CustomKeywords.‘govtech.dynamic.myTimeStamp’()
GlobalVariable.TimeStampNow = TimeStampNow
//store the TimeStampNow to file
def WriteTimeStampNowfile = new File(RunConfiguration.getProjectDir() + “/Data Files/TimeStampNow.txt”)
WriteTimeStampNowfile.newWriter().withWriter { it << TimeStampNow }
//read the TimeStampNow to file
def file = new File(RunConfiguration.getProjectDir() + “/Data Files/TimeStampNow.txt”)
def ReadTimeStampNowfile = file.text
//At Composer, set subject
Mobile.tap(findTestObject(‘Object Repository/nine/Composer/android.widget.EditText - Subject’), 0)
Mobile.setText(findTestObject(‘Object Repository/nine/Composer/android.widget.EditText - Subject’), (’[RegressionTestcase]001.MobileSendMail ’ + TimeStampNow) , 0)
//Search mail search string by using the timestamp stored in file
Mobile.tap(findTestObject(‘Object Repository/nine/Inbox/android.widget.TextView-search’), 0)
Mobile.setText(findTestObject(‘Object Repository/nine/Sent/android.widget.EditText - Search’), (’[RegressionTestcase]001.SendMail ’ + ReadTimeStampNowfile) , 0)
//NOT SURE HOW
Mobile.verifyElementExist(findTestObject(‘Object Repository/nine/Sent/SearchResult’), 10)