Handling modal popup windows

In this section, we will be using a simple modal popup created using http://www.w3schools.org/ and then we will write a script to handle that popup. The simple modal pop-up code is given next. We will build the HTML page first and then we will plug the CSS and JavaScript. We have kept the CSS and JavaScript external for the sake of simplicity: 

<html>  <head>    <link rel="stylesheet" type="text/css" href="GetModal.css">  </head>  <body onload="test()">         <!-- Trigger/Open The Modal -->     <button id="myBtn">Open Modal</button>     <!-- The Modal -->     <div id="myModal" class="modal">     <!-- Modal content -->     <frame name="MainWindow">         <div class="modal-content">         <div class="modal-header">         <span class="close">&times;</span> <h2>Login ...

Get Selenium WebDriver Quick Start Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.