I Have an application developed using Electron+Chromium when browser launched without any URL there will be a popup.

This is a modal popup and using selenium I'm unable to handle this popup.

enter image description here

HTML Code for Modal popup

 <div class="mt-4">
        <button id="btnCancel" class="btn btn-secondary btn-danger btn-radius" data-i18n="checkSecurityPage.quit">Quit</button>
        <button id="btnNext" class="btn btn-primary btn-radius" data-size="l" data-style="slide-left" data-i18n="checkSecurityPage.next">Next</button>

Please give any suggestions for it. Thanks

  • Can you add HTML code for the modal mentioned? Commented Nov 4, 2018 at 13:12
  • Added the HTML Code Commented Nov 4, 2018 at 13:19
  • You will probably need something as browser.switchTo() because modals are not a part of the same window. Commented Nov 6, 2018 at 6:17

1 Answer 1


Did you try using below XPath

//*[@id="btnCancel"] to quit

//*[@id="btnNext"] to proceeding to next

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.