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 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 com.kms.katalon.core.windows.keyword.WindowsBuiltinKeywords as Windows
import internal.GlobalVariable as GlobalVariable
import org.openqa.selenium.Keys as Keys
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
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
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.