So I created a test case where I need to add new orders to the system. Each order has a patient and other important information. I add the patient to the order by entering the id number of the patient. Every patient should be loaded to the sistem first for this case to work.
The thing is that the TC passes even when I enter an id number that does not exist on the system. If this happens the system suggests you to pick another patients so a pop up loads with all the previously loaded patients. The thing is that the TC I created does not make this, so it should fail, but it does not.
This is the TC:
WebUI.openBrowser(‘’)
WebUI.navigateToUrl(‘http://…’)
WebUI.setText(findTestObject(‘Page_Login/input_User Name_vUSERNAME’), ‘admin’)
WebUI.setEncryptedText(findTestObject(‘Page_Login/input_User Password_vUSERPASSWORD’), ‘hUKwJTbofgPU9eVlw/CnDQ==’)
WebUI.click(findTestObject(‘Page_Login/input_User Password_LOGIN’))
WebUI.click(findTestObject(‘Page_Inicio/a_Pre Analtica’))
WebUI.delay(2)
WebUI.click(findTestObject(‘Page_Inicio/a_Carga de rdenes’))
WebUI.waitForPageLoad(5)
WebUI.waitForElementVisible(findTestObject(‘Page_Ingreso Orden/input_Nmero de Documento_vPERSONADOCUMENTONUMERO’), 30)
WebElement elementCI = WebUiCommonHelper.findWebElement(findTestObject(‘Object Repository/Page_Ingreso Orden/input_Nmero de Documento_vPERSONADOCUMENTONUMERO’),
30)
WebUI.delay(2)
WebUI.executeJavaScript(‘arguments[0].value='472444441221'’, Arrays.asList(elementCI))
WebUI.sendKeys(findTestObject(‘Page_Ingreso Orden/input_Nmero de Documento_vPERSONADOCUMENTONUMERO’), Keys.chord(Keys.ENTER))
//HERE IS WHERE THE TC SHOULD FAIL BECAUSE I WAIT FOR THIS ELEMENT TO LOAD BUT IT NEVER DOES
WebUI.waitForElementVisible(findTestObject(‘Page_Ingreso Orden/span_DatosUsuario’), 30)
//WebUI.click(findTestObject(‘Page_Ingreso Orden/input_Prueba Codigo_vPRUEBACODIGO’))
WebUI.delay(3)
//WebUI.waitForElementNotVisible(findTestObject(‘Page_Ingreso Orden/div_PacienteTipo’), 30)
WebElement elementPrueba = WebUiCommonHelper.findWebElement(findTestObject(‘Page_Ingreso Orden/input_Prueba Codigo_vPRUEBACODIGO’),
30)
WebUI.delay(2)
WebUI.executeJavaScript(‘arguments[0].value='1'’, Arrays.asList(elementPrueba))
CustomKeywords.‘keywordPrueba.CustomFunction.clickUsingJS’(findTestObject(‘Page_Ingreso Orden/input_Prueba Descripcion_BTNBTNADDPRUEBA’),
30)
WebUI.waitForElementNotVisible(findTestObject(‘Page_Ingreso Orden/div_PacienteTipo’), 30)
WebUI.waitForElementVisible(findTestObject(‘Page_Ingreso Orden/div_BoxConPruebas’), 30)
WebUI.delay(3)
CustomKeywords.‘keywordPrueba.CustomFunction.clickUsingJS’(findTestObject(‘Page_Ingreso Orden/input_Extraccin Observacin_BTNENTER’),
30)
//WebUI.waitForPageLoad(5, FailureHandling.STOP_ON_FAILURE)
WebUI.delay(3)
I need to know when my test cases fail cause I am using katalon and jenkins and whenever the tc fails I need to send and email. I should send and email whenever the entered id number is not on the system but I cant because it passes
Any suggestions?