Skip to content

Instantly share code, notes, and snippets.

@bbugh
Created October 13, 2012 01:04
Show Gist options
  • Select an option

  • Save bbugh/3882746 to your computer and use it in GitHub Desktop.

Select an option

Save bbugh/3882746 to your computer and use it in GitHub Desktop.

Revisions

  1. bbugh created this gist Oct 13, 2012.
    15 changes: 15 additions & 0 deletions gistfile1.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    //Get a reference to the alert using the following:

    alert = page.driver.browser.switch_to.alert

    // and then hit OK with

    page.driver.browser.switch_to.alert.accept

    // or dismiss it with

    page.driver.browser.switch_to.alert.dismiss

    // or get the text with

    page.driver.browser.switch_to.alert.text