Popover

I have a question regarding popup . A CMS site made in wordpress having page “Gallery” . Click on one image popup button comes . Popup consits of next, prev and close button. Close button is designed as “X” . Now, I tried with every possible permutation and combination. E.g.:- switch to, Mouseover, focus etc. but katalon studio unable to click that “X” cross button.
I have another scenario, CMS page opens and newsletter popup automatically comes. User have to give email address> click on the subscribe button> message will show just below the email field> and user have to click on the cross"X" button.

Any suggestion ?

It would help if you showed us…

1 - The code you tried and any errors you received

2 - The method you used to access the element (xpath, css, etc)

3 - The section of HTML here the element is generated (including any iframe code that may be hosting it)

Otherwise, we’re just guessing.

//Below is the code recorded and edited in katalon studio

WebUI.openBrowser(’’)

WebUI.navigateToUrl(‘http://demo.switch2webpro.com/greenbriqs/’)

WebUI.waitForPageLoad(5)

WebUI.maximizeWindow()

WebUI.click(findTestObject(‘Page_Green Briqs/a_Gallery’))

WebUI.waitForJQueryLoad(5)

WebUI.click(findTestObject(‘Page_Gallery Green Briqs/img_example-image’))

WebUI.waitForJQueryLoad(5)

WebUI.click(findTestObject(‘Page_Gallery Green Briqs/a_lb-next’))

WebUI.waitForJQueryLoad(5)

WebUI.click(findTestObject(‘Page_Gallery Green Briqs/a_lb-next’))

WebUI.waitForJQueryLoad(5)

WebUI.click(findTestObject(‘Page_Gallery Green Briqs/a_lb-close’))

WebUI.closeBrowser()

// Below is the code captured in katalon recorder where it is working fine but not worked in katalon studio after imported

WebUI.openBrowser(‘https://www.katalon.com/’)

def driver = DriverFactory.getWebDriver()

String baseUrl = “https://www.katalon.com/

selenium = new WebDriverBackedSelenium(driver, baseUrl)

selenium.open(“http://demo.switch2webpro.com/greenbriqs/”)

selenium.windowMaximize()

selenium.click(“link=Home”)

selenium.click(“link=Gallery”)

selenium.click("//img[@alt=‘Lorem Ipsum’]")

selenium.click("//div[@id=‘lightbox’]/div/div/div/a[2]")

selenium.click("//div[@id=‘lightbox’]/div/div/div/a[2]")

selenium.click("//div[@id=‘lightbox’]/div/div/div/a[2]")

selenium.click("//div[@id=‘lightbox’]/div/div/div/a[2]")

selenium.click("//div[@id=‘lightbox’]/div/div/div/a[2]")

selenium.click("//div[@id=‘lightbox’]/div[2]/div/div[2]/a")

selenium.close()

Create your own test object called “Close_button”, give it this CSS:

#lightbox a.lb-close

Then use…

WebUI.click(findTestObject("path/Close_button"))
2 Likes