Created
April 3, 2015 11:25
-
-
Save piccaso/e13673cce0deae76d435 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE> | |
<html> | |
<head> | |
<title>Selenium Test Example Page</title> | |
</head> | |
<body style="margin: 20px" onload="checkParams()"> | |
<h2>Selenium Test Example Page</h2> | |
<p id="intro"> | |
A very basic example page for running remote Selenium Tests on the CrossBrowserTesting.com platform. | |
</p> | |
<hr> | |
<p>Unordered List</p> | |
<div id="list-test"> | |
<ul class="list"> | |
<li>One</li> | |
<li>Two</li> | |
<li>Three</li> | |
<li>Four</li> | |
</ul> | |
</div> | |
<hr> | |
<p>Links and buttons</p> | |
<div id="link-test"> | |
<a href="selenium_example_page2.html">Go To Page 2</a><br><br> | |
<button type="button" id="btn" onclick="showMessage()">Show Message</button> | |
<div id="button-message" style="display:none"> I am the message!! </div> | |
</div> | |
<hr> | |
<p>Form Elements</p> | |
<form id="myform"> | |
<input type="text" name="text" value="" placeholder="Input Text Here"><br> | |
<input type="checkbox" name="checkbox"> Check It<br> | |
<select name="select"> | |
<option value="option1">Option 1</option> | |
<option value="option2">Option 2</option> | |
<option value="option3">Option 3</option> | |
<option value="option4">Option 4</option> | |
</select><br> | |
<input type="radio" name="radio" value="radio1"> Radio 1<br> | |
<input type="radio" name="radio" value="radio2"> Radio 2<br> | |
<textarea name="textarea"></textarea><br> | |
<input type="submit" value="Submit"> | |
</form> | |
<div id="form-results" style="display:none"> | |
<hr> | |
<p>Form Results</p> | |
</div> | |
<script type="text/javascript"> | |
function showMessage(){ | |
var message = document.getElementById("button-message"); | |
message.style.display = ''; | |
} | |
function checkParams(){ | |
if (location.search.length > 0){ | |
var params = location.search.replace('?',''), | |
tokens = params.split('&'), | |
formresults = document.getElementById("form-results"), | |
newDiv = null; | |
formresults.style.display = ''; | |
for (var i=0; i <= tokens.length; i++){ | |
if (tokens[i]){ | |
var params = tokens[i].split('='); | |
if (params.length == 2 && params[1].length > 0){ | |
newDiv = document.createElement('div'); | |
newDiv.innerHTML = '<span>' + params[0] + '</span> <span>' + decodeURIComponent((params[1]).replace(/\+/g, '%20')); + '</span>'; | |
formresults.appendChild(newDiv); | |
} | |
} | |
} | |
} | |
} | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment