Andrej Podhajský said:
but this is another one…
See this total code , in this i need compare the text present are not …
ExcelData data = findTestData(‘Excell_Data’)
WebUI.openBrowser(‘’)
WebUI.navigateToUrl(‘CURA Healthcare Service’)
for (int i = 0; i <= (data.getRowNumbers() - 1); i++) {
login(data.internallyGetValue(‘Username’, i), data.internallyGetValue(‘Password’, i))
WebUI.click(findTestObject(‘Page_CURA Healthcare Service/button_Login’))
WebUI.delay(5)
if(WebUI.verifyTextPresent(‘Login failed! Please ensure the username and password are valid.’, false, FailureHandling.CONTINUE_ON_FAILURE)){
println(“--------- failed login-------------------”)
}else {
WebUI.delay(5)
WebUI.click(findTestObject(‘Object Repository/Menu/a_menu-toggle’))
WebUI.click(findTestObject(‘Object Repository/Menu/a_Logout’))
println(“--------- log out successfull-------------------”)
}
}
WebUI.closeBrowser()
def login(def usr,def psd) {
WebUI.setText(findTestObject(‘Page_CURA Healthcare Service/input_username’), usr)
WebUI.setText(findTestObject(‘Page_CURA Healthcare Service/input_password’), psd)
}
On this code exicution i am getting this error …
Unable to click on object ‘Object Repository/Menu/a_Logout’ (Root cause: com.kms.katalon.core.webui.exception.WebElementNotFoundException: Web element with id: ‘Object Repository/Menu/a_Logout’ located by ‘By.xpath: //a[@href = ‘authenticate.php?logout’ and (text() = ‘Logout’ or . = ‘Logout’)]’ not found)