Result showing 2 cases pass

Test case with wrong password
if user login with wrong password and record the test case with web record but result showing pass,

Test case with valid password
if user login with valid password and record the test case with web record result showing pass,

Result showing 2 cases pass

Maybe show us some screenshots of your script or the Reports…

Maybe read this post beforehand

Could you please share the Step in the Test Case which should fail?

we have created two cases record & play

1 -User login with valid credentials result should be -Pass

2-User login with invalid credentials result should be -failed

Both test cases result are visible Pass

Please help us

I want to help you but you should share the Code of your Test Case (the one which should Fail) with us, because maybe there is an error there…

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 static com.kms.katalon.core.testobject.ObjectRepository.findWindowsObject
import com.kms.katalon.core.checkpoint.Checkpoint as Checkpoint
import com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords as CucumberKW
import 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 as Windows
import internal.GlobalVariable as GlobalVariable
import org.openqa.selenium.Keys as Keys



WebUI.setText(findTestObject(‘Object Repository/Wrong_ID/Page_Login/input_Welcome to Roboassess_txtLogUsername’), ‘shrikantkhandait’)

WebUI.setEncryptedText(findTestObject(‘Object Repository/Wrong_ID/Page_Login/input_Welcome to Roboassess_txtLogPassword’),
‘tzH6RvlfSTg=’)‘Object Repository/Wrong_ID/Page_Login/button_Login’))

It does pass because there is no step it could fail on…

You should add a step which is only possible to Perform when succesfully logged in… (like for example: navigating to the Profile) because then this step will fail and it will be shown as failed…

try to create the test cases while login with wrong id & password record there is alert message is popup username & password showing wrong but log file is not generate in katalon

If im understanding right you could use verifyElementPresent(findTestObject(‘YOURALERT’)) to check if the alert is poping up or not…

Alert message is popup but not creating error log

Error log where? You are not trying to interact with the the alert message in your script so it doesnt get logged… Or am i Missing something here?

Thnx for looking the issue

when we record 1 test case in that case
we not enter any password ks web recorder record the error message username & password not enter properly
so this case is failed but ks showing in result pass

Hi @jackprakash12

Looking at the test case, its current flow is typing in the credentials and then clicking on the log-in button. This logic does not cover the case where the credentials are incorrect, because after clicking on the log-in button the test already ends. I

If you are trying to fail the test case when the credentials are wrong, then you would need to do something like this:

// Type in username
// Type in password
// Click on log-in button
WebUI.verifyElementNotPresent(findTestObject('this is an object that appears ONLY when the credentials are incorrect'))

Then the test case would fail if the element which indicates the credentials appears on the page.
For example, on Github, if you type in the incorrect credentials then there is an error message on the web page.