I am working on Search functionality. added multiple data in my excel sheet and here is the functionality how it works. if i give the exact id it will be navigated to the next page or will be stayed in the same page with partial search.
my test case is passing when my script runs with the exact id and coming back to the search page. when the loop enters the 2nd set data (partial search) and able to display the results and it is not entering the 3rd data. here is the code i have written.
for (int rowNum = 1; rowNum <= findTestData(‘LocationID’).getRowNumbers(); rowNum++) {
WebUI.setText(findTestObject(‘Form Search/input_Location ID or Name_LocIdSearchString’), findTestData(‘LocationID’).getValue(1, rowNum))
WebUI.click(findTestObject('Form Search/button_Search'))
WebUI.delay(10)
if (WebUI.verifyElementNotPresent(findTestObject('Form Search/Search_datatable'), 0)) {
WebUI.verifyElementPresent(findTestObject('Form Search/p_Forms Search Filing History'), 0)
Thread.sleep(10)
WebUI.click(findTestObject('Object Repository/Page_SAGE/a_Forms'))
WebUI.click(findTestObject('Object Repository/Page_SAGE/a_Informational Forms Search'))
} else {
WebUI.verifyElementPresent(findTestObject('Form Search/h1_Form Search'), 0)
break
}
}
error logs:
Elapsed time: 57.716s
Test Cases/TC_Form Search FAILED.
Reason:
com.kms.katalon.core.exception.StepFailedException: Unable to verify object ‘Object Repository/Form Search/Search_datatable’ is not present
thanks
prakash