In the below code, i took a screenshot of a pop up that appears when a button is clicked.
This is my code:
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.testng.keyword.TestNGBuiltinKeywords as TestNGKW
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
WebUI.openBrowser('')
WebUI.setViewPortSize(800,600)
WebUI.navigateToUrl('xxxx')
WebUI.setText(findTestObject('Object Repository/Page_Sign in/input_Email Address_Email Address'), 'x@gmail.com')
WebUI.setEncryptedText(findTestObject('Object Repository/Page_Sign in/input_Forgot your password_Password'), 'xxx')
WebUI.sendKeys(findTestObject('Object Repository/Page_Sign in/input_Forgot your password_Password'), Keys.chord(Keys.ENTER))
WebUI.click(findTestObject('Object Repository/Page_xLicense Details/button_'))
WebUI.click(findTestObject('Object Repository/Page_xAI License Details/button_Buy More Seats'))
WebUI.takeScreenshotAsCheckpoint('new_screenshot')
The first time this test case was executed it gave pop up A.
The next time it was executed it gave another pop up B - as i changed the name and email address that leads to a different pop up in the same test case.
On katalon testops , i can see the two different screenshots on different test runs.
But , why is it marking the second test run as passed , although it’s different?