Unable to verify the text present in the second popup modal/prompt

Hi there! I’m unable to verify the text present in the second pop up modal/prompt in the page (Screenshot 1). The popup modal/prompt is a success message. It’s the second popup modal/prompt displayed after confirming a row entry deletion by clicking on the “Yes” button of the first popup modal/prompt (Screenshot 2). I think what’s causing this is the “Edit-Remove” drop down still being displayed in the page. That drop down is displayed when the vertical ellipsis button at the rightmost of a row entry is clicked. I did try to focus on the window with title “Message” but it didn’t work. Also, I tried capturing the alert message but didn’t work as well since it’s obviously not an alert. I’m running out of ideas on this. Can you please help me out? Thank you! :slight_smile:

Here’s the error I got in the console:

12-04-2018 01:10:23 AM - [FAILED] - Text 'Announcement successfully removed.' is not present on page 
12-04-2018 01:10:23 AM - [FAILED] - Unable to verify text 'Announcement successfully removed.' is present  (Root cause: Text 'Announcement successfully removed.' is not present on page )
12-04-2018 01:10:23 AM - [FAILED] - Test Cases/System Admin/Remove Announcement FAILED because (of) (Stack trace: com.kms.katalon.core.exception.StepFailedException: Unable to verify text 'Announcement successfully removed.' is present  (Root cause: Text 'Announcement successfully removed.' is not present on page )

Here’s my code:

String adminMenu = 'SysAd Create New Announcement/button_Admin'
String announcementsOption = 'SysAd Create New Announcement/span_Announcements'
String verEllipButton = 'SysAd Remove Announcement/button_vertical_ellipsis'
String removeButton = 'SysAd Remove Announcement/button_Remove'
String yesButton = 'SysAd Remove Announcement/button_Yes'
String successfulText = 'Announcement successfully removed.'
String okButton = 'SysAd Remove Announcement/button_Ok'
WebUI.waitForElementClickable(findTestObject(adminMenu), 30)
CustomKeywords.'com.nb.utilities.CommonUtilities.clickUsingJS'(findTestObject(adminMenu), 30)
WebUI.mouseOver(findTestObject(adminMenu))
WebUI.waitForElementVisible(findTestObject(announcementsOption), 30)
WebUI.click(findTestObject(announcementsOption))
WebUI.waitForElementClickable(findTestObject(verEllipButton), 30)
CustomKeywords.'com.nb.utilities.CommonUtilities.clickUsingJS'(findTestObject(verEllipButton), 30)
WebUI.waitForElementClickable(findTestObject(removeButton), 30)
WebUI.scrollToElement(findTestObject(removeButton), 30)
CustomKeywords.'com.nb.utilities.CommonUtilities.clickUsingJS'(findTestObject(removeButton), 30)
WebUI.waitForElementClickable(findTestObject(yesButton), 30)
CustomKeywords.'com.nb.utilities.CommonUtilities.clickUsingJS'(findTestObject(yesButton), 30)
WebUI.waitForElementVisible(findTestObject(okButton), 30)
WebUI.verifyTextPresent(successfulText, false)
WebUI.click(findTestObject(okButton))

My test failed at:

 WebUI.verifyTextPresent(successfulText, false)

Screenshot 1

Screenshot 2
(Note: This was captured manually as I cannot capture this part during automated script execution, where the “Edit-Remove” drop down is still displayed.)

1.jpg

2.jpg

Got this resolved by adding

WebUI.waitForElementClickable(findTestObject(okButton), 30)

before verifyTextPresent.

Adding a delay works too but it is discouraged.

Please close this thread. Thanks!