Created test script should not pass after setting negative value

Hi,

Im trying to check if my test script will fail if I put the value as -1 (the original script is to check if the element or text ,a pop up message is correct when user successfully deposited an amount == Successfully Deposited) However when I try putting a negative amount, my test script says PASSED which is suppose to fail.

*********** script below :

import static com.kms.katalon.core.checkpoint.CheckpointFactory.findCheckpoint

import static com.kms.katalon.core.testcase.TestCaseFactory.findTestCase

import static com.kms.katalon.core.testdata.TestDataFactory.findTestData

import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject

import com.kms.katalon.core.checkpoint.Checkpoint as Checkpoint

import com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords as CucumberKW

import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as Mobile

import com.kms.katalon.core.model.FailureHandling as FailureHandling

import com.kms.katalon.core.testcase.TestCase as TestCase

import com.kms.katalon.core.testdata.TestData as TestData

import com.kms.katalon.core.testobject.TestObject as TestObject

import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WS

import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI

import internal.GlobalVariable as GlobalVariable

WebUI.openBrowser(‘’)

WebUI.navigateToUrl(‘https://warrenbarrington.mytrackprice.com/’)

WebUI.click(findTestObject(‘Object Repository/n4/Page_Warren Barrington (BETA)/a_login now’))

WebUI.setText(findTestObject(‘Object Repository/n4/Page_Warren Barrington (BETA)/input_Username_username’), ‘sarah’)

WebUI.setEncryptedText(findTestObject(‘Object Repository/n4/Page_Warren Barrington (BETA)/input_Password_password’), ‘bFLRZF5fW9h2QD0v5595zA==’)

WebUI.click(findTestObject(‘Object Repository/n4/Page_Warren Barrington (BETA)/button_Sign In’))

WebUI.click(findTestObject(‘Object Repository/n4/Page_Warren Barrington (BETA)/img_BETTING LINE0418 84 3261 s’))

WebUI.click(findTestObject(‘Object Repository/n4/Page_Warren Barrington (BETA)/button_Profile’))

WebUI.click(findTestObject(‘Object Repository/n4/Page_Warren Barrington (BETA)/button_Deposit’))

WebUI.setText(findTestObject(‘Object Repository/n4/Page_Warren Barrington (BETA)/input__amount’), ‘-1’)

WebUI.setText(findTestObject(‘Object Repository/n4/Page_Warren Barrington (BETA)/input_Card Number_card_number’), ‘4111111111111111’)

WebUI.setText(findTestObject(‘Object Repository/n4/Page_Warren Barrington (BETA)/input_CVN_card_cvn’), ‘123’)

WebUI.click(findTestObject(‘Object Repository/n4/Page_Warren Barrington (BETA)/button_Expiration Date_btn btn’))

WebUI.click(findTestObject(‘Object Repository/n4/Page_Warren Barrington (BETA)/button_December’))

WebUI.click(findTestObject(‘Object Repository/n4/Page_Warren Barrington (BETA)/button_Deposit_1’))

WebUI.verifyElementText(findTestObject(‘n4/Page_Warren Barrington (BETA)/div_Successfully Deposited’), ‘Successfully Deposited’)

WebUI.closeBrowser()

**********************

Website behavior when putting a negative value :

Since Im putting the value of Verify Element Text as “Successfully Deposited” I believe my test script should fail since the pop up error is not showing and cant proceed with the Deposit. Please help. Thanks

11.PNG

12.PNG

Read the following article to learn how to use Google Chrome’s developer tool to do search the current HTML

And you want to search the HTML in quetion for the text “Successfully Deposited”. It is likely you find it, though the text might be invisible for you. If the text is there, then WebUI.verifyElementText() would pass.

Read the following article to learn how to use Google Chrome’s developer tool to do search the current HTML

And you want to search the HTML in quetion for the text “Successfully Deposited”. It is likely you find it, though the text might be invisible. If invible “Successfully Deposited” is there, then WebUI.verifyElementText() would pass.

Read the following article to learn how to use Google Chrome’s developer tool to do search the current HTML

And you want to search the HTML in quetion for the text “Successfully Deposited”. It is likely you find it, though the text might be invisible. If invible “Successfully Deposited” is there, then WebUI.verifyElementText() would pass.