Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check if javascript alert is open #212

Open
acrogenesis opened this issue Apr 4, 2018 · 1 comment · May be fixed by #245
Open

Check if javascript alert is open #212

acrogenesis opened this issue Apr 4, 2018 · 1 comment · May be fixed by #245

Comments

@acrogenesis
Copy link

Can't find on the documentation a function to check if an alert is open, if I try to dismiss and it's not present it crashes

** (RuntimeError) no alert open
  (Session info: chrome=65.0.3325.181)
  (Driver info: chromedriver=2.35.528157 (4429ca2590d6988c0745c24c8858745aaaec01ef),platform=Mac OS X 10.13.4 x86_64)
    (hound) lib/hound/request_utils.ex:57: Hound.RequestUtils.handle_response/3
@acrogenesis
Copy link
Author

acrogenesis commented Apr 4, 2018

This is what I came up with, but don't know if there's a better way.

try do
  accept_dialog()
rescue
  RuntimeError -> "Dialog not open"
end

Sebisnow added a commit to Sebisnow/hound that referenced this issue Sep 11, 2019
check for dialogs by reading from a dialog, if that fails assume the dialog is not present.
@Sebisnow Sebisnow linked a pull request Sep 11, 2019 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant