You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to NightwatchJs
Hi All,
Does nightwatch offer the ability to wait until an alert/confirm/prompt dialog is shown?
I see there are selenium commands to interact with alert dialogs, but how does one know if/when such a dialog is showing for selenium to interact with it?
- Jackie
Andrei Rusu
unread,
Sep 17, 2015, 3:44:21 AM9/17/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to nightw...@googlegroups.com
As far as I'm aware it's not possible to check for an alert if it's
present but you can try to use .getAlertText() and presumably it will
give you an error in the result if it's not present:
http://nightwatchjs.org/api#getAlertText
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to NightwatchJs
Unfortunately in my case getAlertText doesn't break the test if there is no dialog open. Response status from the Selenium server is 500 and I can see the error message when I run nightwatch with --verbose flag, yet the test is still successful. The same problem with acceptAlert() (and with the even with the plain click(), if element cannot be clicked, for that matter).
Bao.Tran
unread,
Jun 3, 2016, 5:40:02 AM6/3/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to NightwatchJs
Do we have it now,function .waitForAlertPresent() ?
Eric Mumford
unread,
Jun 7, 2016, 12:04:28 AM6/7/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to NightwatchJs
Do you want code to execute if an alert is shown, do you want code to execute if an alert is not present, do you want an independent watchdog code to trigger an event if a modal is ever shown..? Your question is imprecise.
John Kretschmann
unread,
Feb 3, 2021, 7:55:31 PM2/3/21
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to NightwatchJs
Wow, I'm coming along on this issue a few years later! Still no answer it seems. As far as I can tell, there is no .waitForAlertPresent() function. I tried using getAlertText() and it will return status: -1 if the alert is not found. However, it will also throw an error message to the console which is not desirable.