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 import org.openqa.selenium.Keys as Keys import org.openqa.selenium.JavascriptExecutor as JavascriptExecutor import org.openqa.selenium.WebElement as WebElement import com.kms.katalon.core.webui.common.WebUiCommonHelper as WebUiCommonHelper import com.kms.katalon.core.webui.driver.DriverFactory as DriverFactory import java.math.RoundingMode as RoundingMode /* Testing Title of Customer Information Page */ window_title = WebUI.getWindowTitle() WebUI.verifyMatch(window_title, 'Information.*', true) /* Test if Free Shipping Banner is present */ WebUI.callTestCase(findTestCase('Functions/Other/Testing_Free_Shipping_Banner'), [:], FailureHandling.STOP_ON_FAILURE) /* Verifying text of Free Shipping Banner */ WebUI.callTestCase(findTestCase('Functions/Other/Testing_Free_Shipping_Banner - Text'), [:], FailureHandling.STOP_ON_FAILURE) WebUI.verifyElementPresent(findTestObject('Customer_Information_Page/Customer_Information_Text'), 0) WebUI.verifyElementText(findTestObject('Customer_Information_Page/Customer_Information_Text'), 'Contact information') WebUI.verifyElementPresent(findTestObject('Customer_Information_Page/Already_Have_An_Account'), 0) WebUI.verifyElementText(findTestObject('Customer_Information_Page/Already_Have_An_Account'), 'Already have an account?') WebUI.verifyElementPresent(findTestObject('Customer_Information_Page/Express_Checkout_Text'), 0) WebUI.verifyElementText(findTestObject('Customer_Information_Page/Express_Checkout_Text'), 'Express checkout') WebUI.verifyElementPresent(findTestObject('Customer_Information_Page/Log_In_Button'), 0) WebUI.verifyElementText(findTestObject('Customer_Information_Page/Log_In_Button'), 'Already have an account?\nLog in') WebUI.verifyElementPresent(findTestObject('Customer_Information_Page/Keep_Me_Up_Lable'), 0) WebUI.verifyElementText(findTestObject('Customer_Information_Page/Keep_Me_Up_Lable'), 'Keep me up to date on brand news, new product drops, sales & promotions and shopping reminders.') WebUI.verifyElementPresent(findTestObject('Customer_Information_Page/Option_Subscribe_To_Marketing_Email'), 0) /* The Script will generate a random numnber and if the randmon number is even then it will Check Marketing box or else not */ int decide2 = ((org.apache.commons.lang.RandomStringUtils.randomNumeric(1)) as int) if ((decide2 % 2) == 0) { println('The Random Number generated by Script is Even and is : ' + decide2) WebUI.check(findTestObject('Customer_Information_Page/Option_Subscribe_To_Marketing_Email')) }