import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
‘Open browser and navigate to the AUT website’
WebUI.openBrowser(‘JavaScript Books’)
‘Click on the destination book store link’
WebUI.click(findTestObject(‘aStoreLink’))
‘Delay 5s to view the result’
WebUI.delay(5)
‘Verify that a new window is opened’
WebUI.switchToWindowTitle(‘Object-Oriented JavaScript, 2nd Edition: Stoyan Stefanov, Kumar Chetan Sharma: 9781849693127: Amazon.com: Books’)
‘Close the browser to clean up’
WebUI.closeBrowser()
run case error:
12-26-2017 07:42:39 下午 - [INFO] - Navigating browser to: ‘JavaScript Books’
12-26-2017 07:42:46 下午 - [PASSED] - Browser is opened with url: ‘JavaScript Books’
12-26-2017 07:42:46 下午 - [END] - End action : openBrowser
12-26-2017 07:42:46 下午 - [START] - Start action : click
12-26-2017 07:42:46 下午 - [INFO] - Finding Test Object with id ‘Object Repository/aStoreLink’
12-26-2017 07:42:46 下午 - [INFO] - Finding Test Object with id ‘Object Repository/sectionAllBooks’
12-26-2017 07:42:46 下午 - [INFO] - Checking object
12-26-2017 07:42:46 下午 - [INFO] - Checking timeout
12-26-2017 07:42:46 下午 - [INFO] - Web element with id: ‘Object Repository/aStoreLink’ have parent shadow root with id: ‘Object Repository/sectionAllBooks’
12-26-2017 07:42:46 下午 - [INFO] - Checking timeout
12-26-2017 07:42:46 下午 - [INFO] - Finding web element with id: ‘Object Repository/sectionAllBooks’ located by ‘By.xpath: //*[@id = ‘allBooks’]’ in ‘30’ second(s)
12-26-2017 07:42:46 下午 - [INFO] - Found 1 web elements with id: ‘Object Repository/sectionAllBooks’ located by ‘By.xpath: //*[@id = ‘allBooks’]’ in ‘30’ second(s)
12-26-2017 07:42:46 下午 - [INFO] - Finding web element with id: ‘Object Repository/aStoreLink’ located by ‘*[href=“http://www.amazon.com/gp/product/1849693129/ref=as\_li\_qf\_sp\_asin\_il\_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1849693129&linkCode=as2&tag=kaidez-20&linkId=CK7X5SMYEHL3BMEQ”]’ in ‘30’ second(s)
12-26-2017 07:42:46 下午 - [INFO] - Found 1 web elements with id: ‘Object Repository/aStoreLink’ located by ‘*[href=“http://www.amazon.com/gp/product/1849693129/ref=as\_li\_qf\_sp\_asin\_il\_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1849693129&linkCode=as2&tag=kaidez-20&linkId=CK7X5SMYEHL3BMEQ”]’ in ‘30’ second(s)
…
12-26-2017 07:43:17 下午 - [INFO] - Found 1 web elements with id: ‘Object Repository/aStoreLink’ located by ‘*[href=“http://www.amazon.com/gp/product/1849693129/ref=as\_li\_qf\_sp\_asin\_il\_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1849693129&linkCode=as2&tag=kaidez-20&linkId=CK7X5SMYEHL3BMEQ”]’ in ‘30’ second(s)
12-26-2017 07:43:17 下午 - [INFO] - Found 1 web elements with id: ‘Object Repository/aStoreLink’ located by ‘*[href=“http://www.amazon.com/gp/product/1849693129/ref=as\_li\_qf\_sp\_asin\_il\_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1849693129&linkCode=as2&tag=kaidez-20&linkId=CK7X5SMYEHL3BMEQ”]’ in ‘30’ second(s)
12-26-2017 07:43:18 下午 - [FAILED] - Unable to click on object ‘Object Repository/aStoreLink’ (Root cause: com.kms.katalon.core.webui.exception.WebElementNotFoundException: Web element with id: ‘Object Repository/aStoreLink’ located by 'By.xpath: //*[@href = 'http://www.amazon.com/gp/product/1849693129/ref=as\_li\_qf\_sp\_asin\_il\_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1849693129&linkCode=as2&tag=kaidez-20&linkId=CK7X5SMYEHL3BMEQ’\]’ not found)
12-26-2017 07:43:18 下午 - [FAILED] - Test Cases/Shadow DOM Test FAILED because (of) Unable to click on object ‘Object Repository/aStoreLink’ (Root cause: com.kms.katalon.core.webui.exception.WebElementNotFoundException: Web element with id: ‘Object Repository/aStoreLink’ located by 'By.xpath: //*[@href = 'http://www.amazon.com/gp/product/1849693129/ref=as\_li\_qf\_sp\_asin\_il\_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1849693129&linkCode=as2&tag=kaidez-20&linkId=CK7X5SMYEHL3BMEQ’\]’ not found)
12-26-2017 07:43:18 下午 - [END] - End action : click
12-26-2017 07:43:18 下午 - [END] - End Test Case : Test Cases/Shadow DOM Test