0

I found several answers to this, but they all require getting the alert text and catching an exception. How to avoid this clunky solution?

Is there another way to check if an alert is present?

Using Rails, Capybara, Selenium Webdriver and ChromeDriver helper.

B Seven
  • 44,484
  • 66
  • 240
  • 385
  • You shouldn't have to check the presence. The test will automatically fail on the next command if an alert appears unexpectedly. – Florent B. Feb 15 '18 at 22:17
  • 1
    Have you checked this https://stackoverflow.com/a/21121414/3759158 ? – Manishh Feb 16 '18 at 13:13
  • @Manishh - No, I didn't see that question and answer. Although it's a bit clunky to have a helper, it is the best solution so far. – B Seven Feb 16 '18 at 16:11

0 Answers0