Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

update selenium lib to current 1.0.3

  • Loading branch information...
commit 885e340719ab1a8a71643ee0220c9fb7e8f2dc03 1 parent 560814b
Jehan-Guillaume (ioguix) de Rorthais authored
Showing with 13,653 additions and 6,477 deletions.
  1. +2 −2 tests/selenium/selenium-lib/VERSION.txt
  2. +0 −54 tests/selenium/selenium-lib/coding-conventions.txt
  3. +18 −27 tests/selenium/selenium-lib/core/RemoteRunner.html
  4. +3 −3 tests/selenium/selenium-lib/core/TestPrompt.html
  5. +8 −10 tests/selenium/selenium-lib/core/TestRunner.hta
  6. +8 −10 tests/selenium/selenium-lib/core/TestRunner.html
  7. +0 −298 tests/selenium/selenium-lib/core/domviewer/domviewer.css
  8. +0 −16 tests/selenium/selenium-lib/core/domviewer/domviewer.html
  9. +0 −205 tests/selenium/selenium-lib/core/domviewer/selenium-domviewer.js
  10. +309 −35 tests/selenium/selenium-lib/core/iedoc-core.xml
  11. +396 −35 tests/selenium/selenium-lib/core/iedoc.xml
  12. +91 −0 tests/selenium/selenium-lib/core/lib/snapsie.js
  13. +765 −36 tests/selenium/selenium-lib/core/scripts/htmlutils.js
  14. +2 −2 tests/selenium/selenium-lib/core/scripts/injection.html
  15. +0 −70 tests/selenium/selenium-lib/core/scripts/js2html.js
  16. +0 −175 tests/selenium/selenium-lib/core/scripts/narcissus-defs.js
  17. +0 −1,054 tests/selenium/selenium-lib/core/scripts/narcissus-exec.js
  18. +0 −1,003 tests/selenium/selenium-lib/core/scripts/narcissus-parse.js
  19. +0 −63 tests/selenium/selenium-lib/core/scripts/se2html.js
  20. +892 −61 tests/selenium/selenium-lib/core/scripts/selenium-api.js
  21. +319 −189 tests/selenium/selenium-lib/core/scripts/selenium-browserbot.js
  22. +4 −1 tests/selenium/selenium-lib/core/scripts/selenium-browserdetect.js
  23. +8 −6 tests/selenium/selenium-lib/core/scripts/selenium-commandhandlers.js
  24. +1 −1  tests/selenium/selenium-lib/core/scripts/selenium-executionloop.js
  25. +5 −4 tests/selenium/selenium-lib/core/scripts/selenium-logging.js
  26. +186 −62 tests/selenium/selenium-lib/core/scripts/selenium-remoterunner.js
  27. +55 −32 tests/selenium/selenium-lib/core/scripts/selenium-testrunner.js
  28. +2 −2 tests/selenium/selenium-lib/core/scripts/selenium-version.js
  29. +803 −0 tests/selenium/selenium-lib/core/scripts/ui-doc.html
  30. +1,627 −0 tests/selenium/selenium-lib/core/scripts/ui-element.js
  31. +979 −0 tests/selenium/selenium-lib/core/scripts/ui-map-sample.js
  32. +18 −6 tests/selenium/selenium-lib/core/selenium.css
  33. +566 −428 tests/selenium/selenium-lib/core/xpath/dom.js
  34. +2,816 −0 tests/selenium/selenium-lib/core/xpath/javascript-xpath-0.1.11.js
  35. +0 −252 tests/selenium/selenium-lib/core/xpath/misc.js
  36. +549 −0 tests/selenium/selenium-lib/core/xpath/util.js
  37. +149 −0 tests/selenium/selenium-lib/core/xpath/xmltoken.js
  38. +2,481 −2,223 tests/selenium/selenium-lib/core/xpath/xpath.js
  39. +0 −63 tests/selenium/selenium-lib/index.html
  40. +0 −9 tests/selenium/selenium-lib/install-readme.txt
  41. +591 −40 tests/selenium/selenium-lib/reference.html
View
4 tests/selenium/selenium-lib/VERSION.txt
@@ -1,2 +1,2 @@
-selenium.core.version=0.8.3
-selenium.core.revision=1879
+selenium.core.version=@VERSION@
+selenium.core.revision=@REVISION@
View
54 tests/selenium/selenium-lib/coding-conventions.txt
@@ -1,54 +0,0 @@
- Coding standards for Selenium Core Javascript code
- --------------------------------------------------
-
- Here is a set of conventions agreed by the active Selenium Core
- developers at ThoughtWorks. Please stick to these guidelines when
- working on the Selenium Core code-base.
-
-Whitespace: we use spaces, NOT TABS. Indent in 4-space increments.
-
-Braces: we place open-braces on the same line as the associated keyword,
- for example:
-
- if (command.isBreakpoint) {
- this.pause();
- } else {
- window.setTimeout(this.resume.bind(this), delay);
- }
-
-Encapsulation: we prefer to encapsulate functions and variables inside
- objects, where possible.
-
-Variable declarations: declare variables (using "var") ... even if they're
- "global".
-
-Class definitions: we're shifting to "prototype.js" style for
- definition of classes, e.g.
-
- var MyClass = Class.create();
- Object.extend(MyClass.prototype, {
-
- initialize: function() {
- // ... constructor code ...
- },
-
- doStuff: function() {
- // ... method body ...
- }
-
- });
-
-'Private' functions/properties: we simulate "private" properties by
- prepended the name with an underscore ("_"), e.g.
-
- _resumeAfterDelay : function() {
- // ...etc...
- },
-
-Element addressing: use "$(id)" rather than
- "document.getElementById('id')".
-
-Timeout functions: pass function objects to setTimeout(), rather than
- strings, e.g.
-
- window.setTimeout(this.resume.bind(this), delay);
View
45 tests/selenium/selenium-lib/core/RemoteRunner.html
@@ -24,7 +24,9 @@
<script type="text/javascript" src="scripts/xmlextras.js"></script>
<script language="JavaScript" type="text/javascript" src="lib/prototype.js"></script>
<script language="JavaScript" type="text/javascript" src="lib/cssQuery/cssQuery-p.js"></script>
+<script language="JavaScript" type="text/javascript" src="lib/snapsie.js"></script>
<script language="JavaScript" type="text/javascript" src="scripts/htmlutils.js"></script>
+<script language="JavaScript" type="text/javascript" src="scripts/ui-element.js"></script>
<script language="JavaScript" type="text/javascript" src="scripts/selenium-browserdetect.js"></script>
<script language="JavaScript" type="text/javascript" src="scripts/selenium-browserbot.js"></script>
<script language="JavaScript" type="text/javascript" src="scripts/find_matching_child.js"></script>
@@ -34,18 +36,13 @@
<script language="JavaScript" type="text/javascript" src="scripts/selenium-remoterunner.js"></script>
<script language="JavaScript" type="text/javascript" src="scripts/selenium-logging.js"></script>
<script language="JavaScript" type="text/javascript" src="scripts/selenium-version.js"></script>
-<script language="JavaScript" type="text/javascript" src="xpath/misc.js"></script>
+<script language="JavaScript" type="text/javascript" src="xpath/util.js"></script>
+<script language="JavaScript" type="text/javascript" src="xpath/xmltoken.js"></script>
<script language="JavaScript" type="text/javascript" src="xpath/dom.js"></script>
<script language="JavaScript" type="text/javascript" src="xpath/xpath.js"></script>
+<script language="JavaScript" type="text/javascript" src="xpath/javascript-xpath-0.1.11.js"></script>
<script language="JavaScript" type="text/javascript" src="scripts/user-extensions.js"></script>
<script language="JavaScript" type="text/javascript">
- function openDomViewer() {
- var autFrame = document.getElementById('selenium_myiframe');
- var autFrameDocument = getIframeDocument(autFrame);
- var domViewer = window.open(getDocumentBase(document) + 'domviewer/domviewer.html');
- domViewer.rootDocument = autFrameDocument;
- return false;
- }
function cleanUp() {
if (LOG != null) {
@@ -58,30 +55,22 @@
<body onLoad="setTimeout(function(){runSeleniumTest();},1000)" onUnload="cleanUp()">
-<table border="1" style="height: 100%;">
+<table border="1" style="height: 100%; width: 100%;">
<tr>
- <td width="50%" height="30%">
+ <td width="50%">
<table>
<tr>
- <td>
- <img src="selenium-logo.png">
- </td>
- <td>
- <h1><a href="http://selenium.thoughtworks.com" >Selenium</a> Functional Testing for Web Apps</h1>
- Open Source From <a href="http://www.thoughtworks.com">ThoughtWorks, Inc</a> and Friends
+ <td class="remoterunner">
+ <h4><a href="http://selenium.openqa.org">Selenium</a> Functional Testing for Web Apps</h4>
+ Open Source From <a href="http://selenium.openqa.org/thoughtworks-and-friends.html">ThoughtWorks and Friends</a>
<form action="">
- <br/>Slow Mode:<INPUT TYPE="CHECKBOX" NAME="FASTMODE" VALUE="YES" onmouseup="slowClicked()">
-
+ <br/>
<iframe id="seleniumLoggingFrame" name="seleniumLoggingFrame" src="Blank.html" style="border: 0; height: 0; width: 0; "></iframe>
<fieldset>
- <legend>Tools</legend>
-
- <button type="button" id="domViewer1" onclick="openDomViewer();">
- View DOM
- </button>
<button type="button" onclick="LOG.show();">
Show Log
</button>
+ <label><INPUT TYPE="CHECKBOX" NAME="FASTMODE" VALUE="YES" onmouseup="slowClicked()"> Slow Mode</label>
</fieldset>
</form>
@@ -93,13 +82,15 @@
<label id="context" name="context"></label>
</form>
</td>
- <td width="50%" height="30%">
- <b>Last Four Test Commands:</b><br/>
- <div id="commandList"></div>
+ <td width="50%" class="remoterunner">
+ <h4>Command History:</h4>
+ <form name="commands">
+ <textarea style="overflow:auto; height:8em; width:100%" wrap="off" id="commandList"></textarea>
+ </form>
</td>
</tr>
<tr>
- <td colspan="2" height="70%">
+ <td colspan="2" height="100%">
<iframe name="selenium_myiframe" id="selenium_myiframe" src="Blank.html" height="100%" width="100%"></iframe>
</td>
</tr>
View
6 tests/selenium/selenium-lib/core/TestPrompt.html
@@ -67,7 +67,7 @@
}
function go() {
- if (!browserVersion.isHTA) return true;
+ if (!browserVersion.isHTA && !browserVersion.isChrome) return true;
var inputs = document.getElementsByTagName("input");
var queryString = "";
for (var i = 0; i < inputs.length; i++) {
@@ -96,7 +96,7 @@
<p>
Test Suite:
- <input id="test" name="test" size="30" value="../../TestSuite.html"/>
+ <input id="test" name="test" size="30" value="../tests/TestSuite.html"/>
</p>
<p align="center"><input type="submit" value="Go"/></p>
@@ -142,4 +142,4 @@
</form>
</body>
-</html>
+</html>
View
18 tests/selenium/selenium-lib/core/TestRunner.hta
@@ -26,14 +26,13 @@ to work-around a bug in IE on Win2K whereby the HTA application doesn't function
<title>Selenium Functional Test Runner</title>
<link rel="stylesheet" type="text/css" href="selenium.css"/>
- <script type="text/javascript" src="scripts/narcissus-defs.js"></script>
- <script type="text/javascript" src="scripts/narcissus-parse.js"></script>
- <script type="text/javascript" src="scripts/narcissus-exec.js"></script>
<script type="text/javascript" src="scripts/xmlextras.js"></script>
<script language="JavaScript" type="text/javascript" src="lib/prototype.js"></script>
+ <script language="JavaScript" type="text/javascript" src="lib/cssQuery/cssQuery-p.js"></script>
+ <script language="JavaScript" type="text/javascript" src="lib/snapsie.js"></script>
<script language="JavaScript" type="text/javascript" src="scripts/htmlutils.js"></script>
+ <script language="JavaScript" type="text/javascript" src="scripts/ui-element.js"></script>
<script language="JavaScript" type="text/javascript" src="lib/scriptaculous/scriptaculous.js"></script>
- <script language="JavaScript" type="text/javascript" src="lib/cssQuery/cssQuery-p.js"></script>
<script language="JavaScript" type="text/javascript" src="scripts/selenium-browserdetect.js"></script>
<script language="JavaScript" type="text/javascript" src="scripts/selenium-browserbot.js"></script>
<script language="JavaScript" type="text/javascript" src="scripts/find_matching_child.js"></script>
@@ -43,9 +42,11 @@ to work-around a bug in IE on Win2K whereby the HTA application doesn't function
<script language="JavaScript" type="text/javascript" src="scripts/selenium-testrunner.js"></script>
<script language="JavaScript" type="text/javascript" src="scripts/selenium-logging.js"></script>
<script language="JavaScript" type="text/javascript" src="scripts/selenium-version.js"></script>
- <script language="JavaScript" type="text/javascript" src="xpath/misc.js"></script>
+ <script language="JavaScript" type="text/javascript" src="xpath/util.js"></script>
+ <script language="JavaScript" type="text/javascript" src="xpath/xmltoken.js"></script>
<script language="JavaScript" type="text/javascript" src="xpath/dom.js"></script>
<script language="JavaScript" type="text/javascript" src="xpath/xpath.js"></script>
+ <script language="JavaScript" type="text/javascript" src="xpath/javascript-xpath-0.1.11.js"></script>
<script language="JavaScript" type="text/javascript" src="scripts/user-extensions.js"></script>
<script language="JavaScript" type="text/javascript">
function openDomViewer() {
@@ -69,14 +70,14 @@ to work-around a bug in IE on Win2K whereby the HTA application doesn't function
<iframe name="testSuiteFrame" id="testSuiteFrame" src="./TestPrompt.html" application="yes"></iframe>
</td>
<td width="50%" height="30%">
- <iframe name="testFrame" id="testFrame" application="yes"></iframe>
+ <iframe name="testFrame" id="testFrame" application="yes" src="Blank.html"></iframe>
</td>
<td width="25%">
<table class="layout">
<tr class="selenium">
<th width="25%" height="1" class="header">
- <h1><a href="http://selenium.thoughtworks.com" title="The Selenium Project">Selenium</a> TestRunner
+ <h1><a href="http://selenium.openqa.org" title="The Selenium Project">Selenium</a> TestRunner
</h1>
</th>
</tr>
@@ -89,9 +90,6 @@ to work-around a bug in IE on Win2K whereby the HTA application doesn't function
<button type="button" id="runSuite" onClick="htmlTestRunner.startTestSuite();"
title="Run All tests" accesskey="a">
</button>
- <button type="button" id="runRemainTests" onClick="htmlTestRunner.runRemainTests();"
- title="Run the tests from the selected" accesskey="f">
- </button>
<button type="button" id="runSeleniumTest" onClick="htmlTestRunner.runSingleTest();"
title="Run the Selected test" accesskey="r">
</button>
View
18 tests/selenium/selenium-lib/core/TestRunner.html
@@ -26,14 +26,13 @@
<title>Selenium Functional Test Runner</title>
<link rel="stylesheet" type="text/css" href="selenium.css"/>
- <script type="text/javascript" src="scripts/narcissus-defs.js"></script>
- <script type="text/javascript" src="scripts/narcissus-parse.js"></script>
- <script type="text/javascript" src="scripts/narcissus-exec.js"></script>
<script type="text/javascript" src="scripts/xmlextras.js"></script>
<script language="JavaScript" type="text/javascript" src="lib/prototype.js"></script>
+ <script language="JavaScript" type="text/javascript" src="lib/cssQuery/cssQuery-p.js"></script>
+ <script language="JavaScript" type="text/javascript" src="lib/snapsie.js"></script>
<script language="JavaScript" type="text/javascript" src="scripts/htmlutils.js"></script>
+ <script language="JavaScript" type="text/javascript" src="scripts/ui-element.js"></script>
<script language="JavaScript" type="text/javascript" src="lib/scriptaculous/scriptaculous.js"></script>
- <script language="JavaScript" type="text/javascript" src="lib/cssQuery/cssQuery-p.js"></script>
<script language="JavaScript" type="text/javascript" src="scripts/selenium-browserdetect.js"></script>
<script language="JavaScript" type="text/javascript" src="scripts/selenium-browserbot.js"></script>
<script language="JavaScript" type="text/javascript" src="scripts/find_matching_child.js"></script>
@@ -43,9 +42,11 @@
<script language="JavaScript" type="text/javascript" src="scripts/selenium-testrunner.js"></script>
<script language="JavaScript" type="text/javascript" src="scripts/selenium-logging.js"></script>
<script language="JavaScript" type="text/javascript" src="scripts/selenium-version.js"></script>
- <script language="JavaScript" type="text/javascript" src="xpath/misc.js"></script>
+ <script language="JavaScript" type="text/javascript" src="xpath/util.js"></script>
+ <script language="JavaScript" type="text/javascript" src="xpath/xmltoken.js"></script>
<script language="JavaScript" type="text/javascript" src="xpath/dom.js"></script>
<script language="JavaScript" type="text/javascript" src="xpath/xpath.js"></script>
+ <script language="JavaScript" type="text/javascript" src="xpath/javascript-xpath-0.1.11.js"></script>
<script language="JavaScript" type="text/javascript" src="scripts/user-extensions.js"></script>
<script language="JavaScript" type="text/javascript">
function openDomViewer() {
@@ -69,14 +70,14 @@
<iframe name="testSuiteFrame" id="testSuiteFrame" src="./TestPrompt.html" application="yes"></iframe>
</td>
<td width="50%" height="30%">
- <iframe name="testFrame" id="testFrame" application="yes"></iframe>
+ <iframe name="testFrame" id="testFrame" application="yes" src="Blank.html"></iframe>
</td>
<td width="25%">
<table class="layout">
<tr class="selenium">
<th width="25%" height="1" class="header">
- <h1><a href="http://selenium.thoughtworks.com" title="The Selenium Project">Selenium</a> TestRunner
+ <h1><a href="http://selenium.openqa.org" title="The Selenium Project">Selenium</a> TestRunner
</h1>
</th>
</tr>
@@ -89,9 +90,6 @@
<button type="button" id="runSuite" onClick="htmlTestRunner.startTestSuite();"
title="Run All tests" accesskey="a">
</button>
- <button type="button" id="runRemainTests" onClick="htmlTestRunner.runRemainTests();"
- title="Run the tests from the selected" accesskey="f">
- </button>
<button type="button" id="runSeleniumTest" onClick="htmlTestRunner.runSingleTest();"
title="Run the Selected test" accesskey="r">
</button>
View
298 tests/selenium/selenium-lib/core/domviewer/domviewer.css
@@ -1,298 +0,0 @@
-/******************************************************************************
-* Defines default styles for site pages. *
-******************************************************************************/
-.hidden {
- display: none;
-}
-
-img{
- display: inline;
- border: none;
-}
-
-.box{
- background: #fcfcfc;
- border: 1px solid #000;
- border-color: blue;
- color: #000000;
- margin: 10px auto;
- padding: 3px;
- vertical-align: bottom;
-}
-a {
- text-decoration: none;
-}
-
-body {
- background-color: #ffffff;
- color: #000000;
- font-family: Arial, Helvetica, sans-serif;
- font-size: 10pt;
-}
-
-h2 {
- font-size: 140%;
-}
-
-h3 {
- font-size: 120%;
-}
-
-h4 {
- font-size: 100%;
-}
-
-pre {
- font-family: Courier New, Courier, monospace;
- font-size: 80%;
-}
-
-td, th {
- font-family: Arial, Helvetica, sans-serif;
- font-size: 10pt;
- text-align: left;
- vertical-align: top;
-}
-
-th {
- font-weight: bold;
- vertical-align: bottom;
-}
-
-ul {
- list-style-type: square;
-}
-
-#demoBox {
- border-color: #000000;
- border-style: solid;
- border-width: 1px;
- padding: 8px;
- width: 24em;
-}
-
-.footer {
- margin-bottom: 0px;
- text-align: center;
-}
-
-/* Boxed table styles */
-
-table.boxed {
- border-spacing: 2px;
- empty-cells: hide;
-}
-
-td.boxed, th.boxed, th.boxedHeader {
- background-color: #ffffff;
- border-color: #000000;
- border-style: solid;
- border-width: 1px;
- color: #000000;
- padding: 2px;
- padding-left: 8px;
- padding-right: 8px;
-}
-
-th.boxed {
- background-color: #c0c0c0;
-}
-
-th.boxedHeader {
- background-color: #808080;
- color: #ffffff;
-}
-
-a.object {
- color: #0000ff;
-}
-
-li {
- white-space: nowrap;
-}
-
-ul {
- list-style-type: square;
- margin-left: 0px;
- padding-left: 1em;
-}
-
-.boxlevel1{
- background: #FFD700;
-}
-
-.boxlevel2{
- background: #D2691E;
-}
-
-.boxlevel3{
- background: #DCDCDC;
-}
-
-.boxlevel4{
- background: #F5F5F5;
-}
-
-.boxlevel5{
- background: #BEBEBE;
-}
-
-.boxlevel6{
- background: #D3D3D3;
-}
-
-.boxlevel7{
- background: #A9A9A9;
-}
-
-.boxlevel8{
- background: #191970;
-}
-
-.boxlevel9{
- background: #000080;
-}
-
-.boxlevel10{
- background: #6495ED;
-}
-
-.boxlevel11{
- background: #483D8B;
-}
-
-.boxlevel12{
- background: #6A5ACD;
-}
-
-.boxlevel13{
- background: #7B68EE;
-}
-
-.boxlevel14{
- background: #8470FF;
-}
-
-.boxlevel15{
- background: #0000CD;
-}
-
-.boxlevel16{
- background: #4169E1;
-}
-
-.boxlevel17{
- background: #0000FF;
-}
-
-.boxlevel18{
- background: #1E90FF;
-}
-
-.boxlevel19{
- background: #00BFFF;
-}
-
-.boxlevel20{
- background: #87CEEB;
-}
-
-.boxlevel21{
- background: #B0C4DE;
-}
-
-.boxlevel22{
- background: #ADD8E6;
-}
-
-.boxlevel23{
- background: #00CED1;
-}
-
-.boxlevel24{
- background: #48D1CC;
-}
-
-.boxlevel25{
- background: #40E0D0;
-}
-
-.boxlevel26{
- background: #008B8B;
-}
-
-.boxlevel27{
- background: #00FFFF;
-}
-
-.boxlevel28{
- background: #E0FFFF;
-}
-
-.boxlevel29{
- background: #5F9EA0;
-}
-
-.boxlevel30{
- background: #66CDAA;
-}
-
-.boxlevel31{
- background: #7FFFD4;
-}
-
-.boxlevel32{
- background: #006400;
-}
-
-.boxlevel33{
- background: #556B2F;
-}
-
-.boxlevel34{
- background: #8FBC8F;
-}
-
-.boxlevel35{
- background: #2E8B57;
-}
-
-.boxlevel36{
- background: #3CB371;
-}
-
-.boxlevel37{
- background: #20B2AA;
-}
-
-.boxlevel38{
- background: #00FF7F;
-}
-
-.boxlevel39{
- background: #7CFC00;
-}
-
-.boxlevel40{
- background: #90EE90;
-}
-
-.boxlevel41{
- background: #00FF00;
-}
-
-.boxlevel41{
- background: #7FFF00;
-}
-
-.boxlevel42{
- background: #00FA9A;
-}
-
-.boxlevel43{
- background: #ADFF2F;
-}
-
-.boxlevel44{
- background: #32CD32;
-}
View
16 tests/selenium/selenium-lib/core/domviewer/domviewer.html
@@ -1,16 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <title>DOM Viewer</title>
- <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
- <link rel="stylesheet" type="text/css" href="domviewer.css"/>
- <script type="text/javascript" src="selenium-domviewer.js"></script>
- </head>
- <body onload="loadDomViewer();">
- <h3>DOM Viewer</h3>
- <p> This page is generated using JavaScript. If you see this text, your
- browser doesn't support JavaScript.</p>
- </body>
-
-</html>
View
205 tests/selenium/selenium-lib/core/domviewer/selenium-domviewer.js
@@ -1,205 +0,0 @@
-var HIDDEN="hidden";
-var LEVEL = "level";
-var PLUS_SRC="butplus.gif";
-var MIN_SRC="butmin.gif";
-var newRoot;
-var maxColumns=1;
-
-function loadDomViewer() {
- // See if the rootDocument variable has been set on this window.
- var rootDocument = window.rootDocument;
-
- // If not look to the opener for an explicity rootDocument variable, otherwise, use the opener document
- if (!rootDocument && window.opener) {
- rootDocument = window.opener.rootDocument || window.opener.document;
- }
-
- if (rootDocument) {
- document.body.innerHTML = displayDOM(rootDocument);
- }
- else {
- document.body.innerHTML = "<b>Must specify rootDocument for window. This can be done by setting the rootDocument variable on this window, or on the opener window for a popup window.</b>";
- }
-}
-
-
-function displayDOM(root){
- var str = "";
- str+="<table>";
- str += treeTraversal(root,0);
- // to make table columns work well.
- str += "<tr>";
- for (var i=0; i < maxColumns; i++) {
- str+= "<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>";
- }
- str += "</tr>";
- str += "</table>";
- return str;
-}
-
-function checkForChildren(element){
- if(!element.hasChildNodes())
- return false;
-
- var nodes = element.childNodes;
- var size = nodes.length;
- var count=0;
-
- for(var i=0; i< size; i++){
- var node = nodes.item(i);
- //if(node.toString()=="[object Text]"){
- //this is equalent to the above
- //but will work with more browsers
- if(node.nodeType!=1){
- count++;
- }
- }
-
- if(count == size)
- return false;
- else
- return true;
-}
-
-function treeTraversal(root, level){
- var str = "";
- var nodes= null;
- var size = null;
- //it is supposed to show the last node,
- //but the last node is always nodeText type
- //and we don't show it
- if(!root.hasChildNodes())
- return "";//displayNode(root,level,false);
-
- nodes = root.childNodes;
- size = nodes.length;
-
- for(var i=0; i< size; i++){
- var element = nodes.item(i);
- //if the node is textNode, don't display
- if(element.nodeType==1){
- str+= displayNode(element,level,checkForChildren(element));
- str+=treeTraversal(element, level+1);
- }
- }
- return str;
-}
-
-function displayNode(element, level, isLink){
- nodeContent = getNodeContent(element);
- columns = Math.round((nodeContent.length / 12) + 0.5);
- if (columns + level > maxColumns) {
- maxColumns = columns + level;
- }
- var str ="<tr class='"+LEVEL+level+"'>";
- for (var i=0; i < level; i++)
- str+= "<td> </td>";
- str+="<td colspan='"+ columns +"' class='box"+" boxlevel"+level+"' >";
- if(isLink){
- str+='<a onclick="hide(this);return false;" href="javascript:void();">';
- str+='<img src="'+MIN_SRC+'" />';
- }
- str += nodeContent;
- if(isLink)
- str+="</a></td></tr>";
- return str;
-}
-
-function getNodeContent(element) {
-
- str = "";
- id ="";
- if (element.id != null && element.id != "") {
- id = " ID(" + element.id +")";
- }
- name ="";
- if (element.name != null && element.name != "") {
- name = " NAME(" + element.name + ")";
- }
- value ="";
- if (element.value != null && element.value != "") {
- value = " VALUE(" + element.value + ")";
- }
- href ="";
- if (element.href != null && element.href != "") {
- href = " HREF(" + element.href + ")";
- }
- clazz = "";
- if (element.className != null && element.className != "") {
- clazz = " CLASS(" + element.className + ")";
- }
- src = "";
- if (element.src != null && element.src != "") {
- src = " SRC(" + element.src + ")";
- }
- alt = "";
- if (element.alt != null && element.alt != "") {
- alt = " ALT(" + element.alt + ")";
- }
- type = "";
- if (element.type != null && element.type != "") {
- type = " TYPE(" + element.type + ")";
- }
- text ="";
- if (element.text != null && element.text != "" && element.text != "undefined") {
- text = " #TEXT(" + trim(element.text) +")";
- }
- str+=" <b>"+ element.nodeName + id + alt + type + clazz + name + value + href + src + text + "</b>";
- return str;
-
-}
-
-function trim(val) {
- val2 = val.substring(0,40) + " ";
- var spaceChr = String.fromCharCode(32);
- var length = val2.length;
- var retVal = "";
- var ix = length -1;
-
- while(ix > -1){
- if(val2.charAt(ix) == spaceChr) {
- } else {
- retVal = val2.substring(0, ix +1);
- break;
- }
- ix = ix-1;
- }
- if (val.length > 40) {
- retVal += "...";
- }
- return retVal;
-}
-
-function hide(hlink){
- var isHidden = false;
- var image = hlink.firstChild;
- if(image.src.toString().indexOf(MIN_SRC)!=-1){
- image.src=PLUS_SRC;
- isHidden=true;
- }else{
- image.src=MIN_SRC;
- }
- var rowObj= hlink.parentNode.parentNode;
- var rowLevel = parseInt(rowObj.className.substring(LEVEL.length));
-
- var sibling = rowObj.nextSibling;
- var siblingLevel = sibling.className.substring(LEVEL.length);
- if(siblingLevel.indexOf(HIDDEN)!=-1){
- siblingLevel = siblingLevel.substring(0,siblingLevel.length - HIDDEN.length-1);
- }
- siblingLevel=parseInt(siblingLevel);
- while(sibling!=null && rowLevel<siblingLevel){
- if(isHidden){
- sibling.className += " "+ HIDDEN;
- }else if(!isHidden && sibling.className.indexOf(HIDDEN)!=-1){
- var str = sibling.className;
- sibling.className=str.substring(0, str.length - HIDDEN.length-1);
- }
- sibling = sibling.nextSibling;
- siblingLevel = parseInt(sibling.className.substring(LEVEL.length));
- }
-}
-
-function LOG(message) {
- window.opener.LOG.warn(message);
-}
View
344 tests/selenium/selenium-lib/core/iedoc-core.xml
@@ -79,6 +79,16 @@ Select the element using css selectors. Please refer to <a href="http://www.w3.o
</ul>
<p>Currently the css selector locator supports all css1, css2 and css3 selectors except namespace in css3, some pseudo classes(:nth-of-type, :nth-last-of-type, :first-of-type, :last-of-type, :only-of-type, :visited, :hover, :active, :focus, :indeterminate) and pseudo elements(::first-line, ::first-letter, ::selection, ::before, ::after). </p>
</li>
+
+<li><strong>ui</strong>=<em>uiSpecifierString</em>:
+Locate an element by resolving the UI specifier string to another locator, and evaluating it. See the <a href="http://svn.openqa.org/fisheye/browse/~raw,r=trunk/selenium/trunk/src/main/resources/core/scripts/ui-doc.html">Selenium UI-Element Reference</a> for more details.
+<ul class="first last simple">
+<li>ui=loginPages::loginButton()</li>
+<li>ui=settingsPages::toggle(label=Hide Email)</li>
+<li>ui=forumPages::postBody(index=2)//a[2]</li>
+</ul>
+</li>
+
</ul>
<p>
@@ -123,6 +133,8 @@ string.</li>
<li><strong>regexp:</strong><em>regexp</em>:
Match a string using a regular-expression. The full power of JavaScript
regular-expressions is available.</li>
+<li><strong>regexpi:</strong><em>regexpi</em>:
+Match a string using a case-insensitive regular-expression.</li>
<li><strong>exact:</strong><em>string</em>:
Match a string exactly, verbatim, without any of that fancy wildcard
@@ -131,6 +143,14 @@ stuff.</li>
<p>
If no pattern prefix is specified, Selenium assumes that it's a "glob"
pattern.
+</p>
+<p>
+For commands that return multiple values (such as verifySelectOptions),
+the string being matched is a comma-separated list of the return values,
+where both commas and backslashes in the values are backslash-escaped.
+When providing a pattern, the optional matching syntax (i.e. glob,
+regexp, etc.) is specified once, as usual, at the beginning of the
+pattern.
</p></top>
<function name="click">
@@ -153,6 +173,14 @@ waitForPageToLoad.</comment>
</function>
+<function name="contextMenu">
+
+<param name="locator">an element locator</param>
+
+<comment>Simulates opening the context menu for the specified element (as might happen if the user "right-clicked" on the element).</comment>
+
+</function>
+
<function name="clickAt">
<param name="locator">an element locator</param>
@@ -177,6 +205,16 @@ waitForPageToLoad.</comment>
</function>
+<function name="contextMenuAt">
+
+<param name="locator">an element locator</param>
+
+<param name="coordString">specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator.</param>
+
+<comment>Simulates opening the context menu for the specified element (as might happen if the user "right-clicked" on the element).</comment>
+
+</function>
+
<function name="fireEvent">
<param name="locator">an <a href="#locators">element locator</a></param>
@@ -188,6 +226,14 @@ handler.</comment>
</function>
+<function name="focus">
+
+<param name="locator">an <a href="#locators">element locator</a></param>
+
+<comment>Move the focus to the specified element; for example, if the element is an input field, move the cursor to that field.</comment>
+
+</function>
+
<function name="keyPress">
<param name="locator">an <a href="#locators">element locator</a></param>
@@ -286,7 +332,16 @@ handler.</comment>
<param name="locator">an <a href="#locators">element locator</a></param>
-<comment>Simulates a user pressing the mouse button (without releasing it yet) on
+<comment>Simulates a user pressing the left mouse button (without releasing it yet) on
+the specified element.</comment>
+
+</function>
+
+<function name="mouseDownRight">
+
+<param name="locator">an <a href="#locators">element locator</a></param>
+
+<comment>Simulates a user pressing the right mouse button (without releasing it yet) on
the specified element.</comment>
</function>
@@ -297,7 +352,18 @@ the specified element.</comment>
<param name="coordString">specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator.</param>
-<comment>Simulates a user pressing the mouse button (without releasing it yet) at
+<comment>Simulates a user pressing the left mouse button (without releasing it yet) at
+the specified location.</comment>
+
+</function>
+
+<function name="mouseDownRightAt">
+
+<param name="locator">an <a href="#locators">element locator</a></param>
+
+<param name="coordString">specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator.</param>
+
+<comment>Simulates a user pressing the right mouse button (without releasing it yet) at
the specified location.</comment>
</function>
@@ -311,6 +377,15 @@ holding the button down) on the specified element.</comment>
</function>
+<function name="mouseUpRight">
+
+<param name="locator">an <a href="#locators">element locator</a></param>
+
+<comment>Simulates the event that occurs when the user releases the right mouse button (i.e., stops
+holding the button down) on the specified element.</comment>
+
+</function>
+
<function name="mouseUpAt">
<param name="locator">an <a href="#locators">element locator</a></param>
@@ -322,6 +397,17 @@ holding the button down) at the specified location.</comment>
</function>
+<function name="mouseUpRightAt">
+
+<param name="locator">an <a href="#locators">element locator</a></param>
+
+<param name="coordString">specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator.</param>
+
+<comment>Simulates the event that occurs when the user releases the right mouse button (i.e., stops
+holding the button down) at the specified location.</comment>
+
+</function>
+
<function name="mouseMove">
<param name="locator">an <a href="#locators">element locator</a></param>
@@ -386,6 +472,8 @@ the delay is 0 milliseconds.</comment>
<function name="getSpeed">
+<return type="string">the execution speed in milliseconds.</return>
+
<comment>Get execution speed (i.e., get the millisecond length of the delay following each selenium operation). By default, there is no such delay, i.e.,
the delay is 0 milliseconds.
@@ -538,27 +626,43 @@ an empty (blank) url, like this: openWindow("", "myFunnyWindow").</p></comment>
<param name="windowID">the JavaScript window ID of the window to select</param>
-<comment>Selects a popup window; once a popup window has been selected, all
+<comment>Selects a popup window using a window locator; once a popup window has been selected, all
commands go to that window. To select the main window again, use null
as the target.
-<p>Note that there is a big difference between a window's internal JavaScript "name" property
-and the "title" of a given window's document (which is normally what you actually see, as an end user,
-in the title bar of the window). The "name" is normally invisible to the end-user; it's the second
-parameter "windowName" passed to the JavaScript method window.open(url, windowName, windowFeatures, replaceFlag)
-(which selenium intercepts).</p>
-
-<p>Selenium has several strategies for finding the window object referred to by the "windowID" parameter.</p>
+<p>
+Window locators provide different ways of specifying the window object:
+by title, by internal JavaScript "name," or by JavaScript variable.
+</p>
+<ul>
+<li><strong>title</strong>=<em>My Special Window</em>:
+Finds the window using the text that appears in the title bar. Be careful;
+two windows can share the same title. If that happens, this locator will
+just pick one.
+</li>
+<li><strong>name</strong>=<em>myWindow</em>:
+Finds the window using its internal JavaScript "name" property. This is the second
+parameter "windowName" passed to the JavaScript method window.open(url, windowName, windowFeatures, replaceFlag)
+(which Selenium intercepts).
+</li>
+<li><strong>var</strong>=<em>variableName</em>:
+Some pop-up windows are unnamed (anonymous), but are associated with a JavaScript variable name in the current
+application window, e.g. "window.foo = window.open(url);". In those cases, you can open the window using
+"var=foo".
+</li>
+</ul>
+<p>
+If no window locator prefix is provided, we'll try to guess what you mean like this:</p>
<p>1.) if windowID is null, (or the string "null") then it is assumed the user is referring to the original window instantiated by the browser).</p>
<p>2.) if the value of the "windowID" parameter is a JavaScript variable name in the current application window, then it is assumed
that this variable contains the return value from a call to the JavaScript window.open() method.</p>
<p>3.) Otherwise, selenium looks in a hash it maintains that maps string names to window "names".</p>
-<p>4.) If <i>that</i> fails, we'll try looping over all of the known windows to try to find the appropriate "title".
+<p>4.) If <em>that</em> fails, we'll try looping over all of the known windows to try to find the appropriate "title".
Since "title" is not necessarily unique, this may have unexpected behavior.</p>
-<p>If you're having trouble figuring out what is the name of a window that you want to manipulate, look at the selenium log messages
-which identify the names of windows created via window.open (and therefore intercepted by selenium). You will see messages
+<p>If you're having trouble figuring out the name of a window that you want to manipulate, look at the Selenium log messages
+which identify the names of windows created via window.open (and therefore intercepted by Selenium). You will see messages
like the following for each window as it is opened:</p>
<p><code>debug: window.open call intercepted; window ID (which you can use with selectWindow()) is "myNewWindow"</code></p>
@@ -569,6 +673,36 @@ an empty (blank) url, like this: openWindow("", "myFunnyWindow").</p></comment>
</function>
+<function name="selectPopUp">
+
+<param name="windowID">an identifier for the popup window, which can take on a number of different meanings</param>
+
+<comment>Simplifies the process of selecting a popup window (and does not offer
+functionality beyond what <code>selectWindow()</code> already provides).
+<ul>
+<li>If <code>windowID</code> is either not specified, or specified as
+"null", the first non-top window is selected. The top window is the one
+that would be selected by <code>selectWindow()</code> without providing a
+<code>windowID</code> . This should not be used when more than one popup
+window is in play.</li>
+<li>Otherwise, the window will be looked up considering
+<code>windowID</code> as the following in order: 1) the "name" of the
+window, as specified to <code>window.open()</code>; 2) a javascript
+variable which is a reference to a window; and 3) the title of the
+window. This is the same ordered lookup performed by
+<code>selectWindow</code> .</li>
+</ul></comment>
+
+</function>
+
+<function name="deselectPopUp">
+
+<comment>Selects the main window. Functionally equivalent to using
+<code>selectWindow()</code> and specifying no value for
+<code>windowID</code>.</comment>
+
+</function>
+
<function name="selectFrame">
<param name="locator">an <a href="#locators">element locator</a> identifying a frame or iframe</param>
@@ -622,9 +756,9 @@ The selected window will return true, while all others will return false.</p></c
<function name="waitForPopUp">
-<param name="windowID">the JavaScript window ID of the window that will appear</param>
+<param name="windowID">the JavaScript window "name" of the window that will appear (not the text of the title bar) If unspecified, or specified as "null", this command will wait for the first non-top window to appear (don't rely on this if you are working with multiple popups simultaneously).</param>
-<param name="timeout">a timeout in milliseconds, after which the action will return with an error</param>
+<param name="timeout">a timeout in milliseconds, after which the action will return with an error. If this value is not specified, the default Selenium timeout will be used. See the setTimeout() command.</param>
<comment>Waits for a popup window to appear and load up.</comment>
@@ -632,26 +766,40 @@ The selected window will return true, while all others will return false.</p></c
<function name="chooseCancelOnNextConfirmation">
-<comment>By default, Selenium's overridden window.confirm() function will
+<comment><p>
+By default, Selenium's overridden window.confirm() function will
return true, as if the user had manually clicked OK; after running
this command, the next call to confirm() will return false, as if
the user had clicked Cancel. Selenium will then resume using the
default behavior for future confirmations, automatically returning
true (OK) unless/until you explicitly call this command for each
-confirmation.</comment>
+confirmation.
+</p>
+<p>
+Take note - every time a confirmation comes up, you must
+consume it with a corresponding getConfirmation, or else
+the next selenium operation will fail.
+</p></comment>
</function>
<function name="chooseOkOnNextConfirmation">
-<comment>Undo the effect of calling chooseCancelOnNextConfirmation. Note
+<comment><p>
+Undo the effect of calling chooseCancelOnNextConfirmation. Note
that Selenium's overridden window.confirm() function will normally automatically
return true, as if the user had manually clicked OK, so you shouldn't
need to use this command unless for some reason you need to change
your mind prior to the next confirmation. After any confirmation, Selenium will resume using the
default behavior for future confirmations, automatically returning
true (OK) unless/until you explicitly call chooseCancelOnNextConfirmation for each
-confirmation.</comment>
+confirmation.
+</p>
+<p>
+Take note - every time a confirmation comes up, you must
+consume it with a corresponding getConfirmation, or else
+the next selenium operation will fail.
+</p></comment>
</function>
@@ -726,13 +874,13 @@ This function never throws an exception
<comment>Retrieves the message of a JavaScript alert generated during the previous action, or fail if there were no alerts.
<p>Getting an alert has the same effect as manually clicking OK. If an
-alert is generated but you do not get/verify it, the next Selenium action
+alert is generated but you do not consume it with getAlert, the next Selenium action
will fail.</p>
-<p>NOTE: under Selenium, JavaScript alerts will NOT pop up a visible alert
+<p>Under Selenium, JavaScript alerts will NOT pop up a visible alert
dialog.</p>
-<p>NOTE: Selenium does NOT support JavaScript alerts that are generated in a
+<p>Selenium does NOT support JavaScript alerts that are generated in a
page's onload() event handler. In this case a visible dialog WILL be
generated and Selenium will hang until someone manually clicks OK.</p></comment>
@@ -748,8 +896,11 @@ the previous action.
<p>
By default, the confirm function will return true, having the same effect
as manually clicking OK. This can be changed by prior execution of the
-chooseCancelOnNextConfirmation command. If an confirmation is generated
-but you do not get/verify it, the next Selenium action will fail.
+chooseCancelOnNextConfirmation command.
+</p>
+<p>
+If an confirmation is generated but you do not consume it with getConfirmation,
+the next Selenium action will fail.
</p>
<p>
@@ -989,7 +1140,9 @@ tableLocator.row.column, where row and column start at 0.</comment>
<param name="attributeLocator">an element locator followed by an &#064; sign and then the name of the attribute, e.g. "foo&#064;bar"</param>
-<comment>Gets the value of an element attribute.</comment>
+<comment>Gets the value of an element attribute. The value of the attribute may
+differ across browsers (this is the case for the "style" attribute, for
+example).</comment>
</function>
@@ -1074,7 +1227,7 @@ This method will fail if the specified element isn't an input element.</comment>
<param name="attributeName">name of an attribute on the windows</param>
-<comment>Returns every instance of some attribute from all known windows.</comment>
+<comment>Returns an array of JavaScript property values from all known windows having one.</comment>
</function>
@@ -1144,25 +1297,25 @@ just send one "mousemove" at the start location and then one final one at the en
<function name="getAllWindowIds">
-<return type="string[]">the IDs of all windows that the browser knows about.</return>
+<return type="string[]">Array of identifiers of all windows that the browser knows about.</return>
-<comment>Returns the IDs of all windows that the browser knows about.</comment>
+<comment>Returns the IDs of all windows that the browser knows about in an array.</comment>
</function>
<function name="getAllWindowNames">
-<return type="string[]">the names of all windows that the browser knows about.</return>
+<return type="string[]">Array of names of all windows that the browser knows about.</return>
-<comment>Returns the names of all windows that the browser knows about.</comment>
+<comment>Returns the names of all windows that the browser knows about in an array.</comment>
</function>
<function name="getAllWindowTitles">
-<return type="string[]">the titles of all windows that the browser knows about.</return>
+<return type="string[]">Array of titles of all windows that the browser knows about.</return>
-<comment>Returns the titles of all windows that the browser knows about.</comment>
+<comment>Returns the titles of all windows that the browser knows about in an array.</comment>
</function>
@@ -1313,6 +1466,22 @@ version is much slower than the native implementations.</comment>
</function>
+<function name="ignoreAttributesWithoutValue">
+
+<param name="ignore">boolean, true means we'll ignore attributes without value at the expense of xpath "correctness"; false means we'll sacrifice speed for correctness.</param>
+
+<comment>Specifies whether Selenium will ignore xpath attributes that have no
+value, i.e. are the empty string, when using the non-native xpath
+evaluation engine. You'd want to do this for performance reasons in IE.
+However, this could break certain xpaths, for example an xpath that looks
+for an attribute whose value is NOT the empty string.
+
+The hope is that such xpaths are relatively rare, but the user should
+have the option of using them. Note that this only influences xpath
+evaluation when using the ajaxslt engine (i.e. not "javascript-xpath").</comment>
+
+</function>
+
<function name="waitForCondition">
<param name="script">the JavaScript snippet to run</param>
@@ -1380,11 +1549,31 @@ See waitForPageToLoad for more information.</comment>
</function>
+<function name="getCookieByName">
+
+<return type="string">the value of the cookie</return>
+
+<param name="name">the name of the cookie</param>
+
+<comment>Returns the value of the cookie with the specified name, or throws an error if the cookie is not present.</comment>
+
+</function>
+
+<function name="isCookiePresent">
+
+<return type="boolean">true if a cookie with the specified name is present, or false otherwise.</return>
+
+<param name="name">the name of the cookie</param>
+
+<comment>Returns true if a cookie with the specified name is present, or false otherwise.</comment>
+
+</function>
+
<function name="createCookie">
<param name="nameValuePair">name and value of the cookie in a format "name=value"</param>
-<param name="optionsString">options for the cookie. Currently supported options include 'path' and 'max_age'. the optionsString's format is "path=/path/, max_age=60". The order of options are irrelevant, the unit of the value of 'max_age' is second.</param>
+<param name="optionsString">options for the cookie. Currently supported options include 'path', 'max_age' and 'domain'. the optionsString's format is "path=/path/, max_age=60, domain=.foo.com". The order of options are irrelevant, the unit of the value of 'max_age' is second. Note that specifying a domain that isn't a subset of the current domain will usually fail.</param>
<comment>Create a new cookie whose path and domain are same with those of current page
under test, unless you specified a path for this cookie explicitly.</comment>
@@ -1395,9 +1584,26 @@ under test, unless you specified a path for this cookie explicitly.</comment>
<param name="name">the name of the cookie to be deleted</param>
-<param name="path">the path property of the cookie to be deleted</param>
+<param name="optionsString">options for the cookie. Currently supported options include 'path', 'domain' and 'recurse.' The optionsString's format is "path=/path/, domain=.foo.com, recurse=true". The order of options are irrelevant. Note that specifying a domain that isn't a subset of the current domain will usually fail.</param>
-<comment>Delete a named cookie with specified path.</comment>
+<comment>Delete a named cookie with specified path and domain. Be careful; to delete a cookie, you
+need to delete it using the exact same path and domain that were used to create the cookie.
+If the path is wrong, or the domain is wrong, the cookie simply won't be deleted. Also
+note that specifying a domain that isn't a subset of the current domain will usually fail.
+
+Since there's no way to discover at runtime the original path and domain of a given cookie,
+we've added an option called 'recurse' to try all sub-domains of the current domain with
+all paths that are a subset of the current path. Beware; this option can be slow. In
+big-O notation, it operates in O(n*m) time, where n is the number of dots in the domain
+name and m is the number of slashes in the path.</comment>
+
+</function>
+
+<function name="deleteAllVisibleCookies">
+
+<comment>Calls deleteCookie with recurse=true on all cookies visible to the current page.
+As noted on the documentation for deleteCookie, recurse=true can be much slower
+than simply deleting the cookies using a known domain/path.</comment>
</function>
@@ -1449,6 +1655,74 @@ The function must return null if the element can't be found.</comment>
</function>
+<function name="captureEntirePageScreenshot">
+
+<param name="filename">the path to the file to persist the screenshot as. No filename extension will be appended by default. Directories will not be created if they do not exist, and an exception will be thrown, possibly by native code.</param>
+
+<param name="kwargs">a kwargs string that modifies the way the screenshot is captured. Example: "background=#CCFFDD" . Currently valid options: <dl> <dt>background</dt> <dd>the background CSS for the HTML document. This may be useful to set for capturing screenshots of less-than-ideal layouts, for example where absolute positioning causes the calculation of the canvas dimension to fail and a black background is exposed (possibly obscuring black text).</dd> </dl></param>
+
+<comment>Saves the entire contents of the current window canvas to a PNG file.
+Contrast this with the captureScreenshot command, which captures the
+contents of the OS viewport (i.e. whatever is currently being displayed
+on the monitor), and is implemented in the RC only. Currently this only
+works in Firefox when running in chrome mode, and in IE non-HTA using
+the EXPERIMENTAL "Snapsie" utility. The Firefox implementation is mostly
+borrowed from the Screengrab! Firefox extension. Please see
+http://www.screengrab.org and http://snapsie.sourceforge.net/ for
+details.</comment>
+
+</function>
+
+<function name="rollup">
+
+<param name="rollupName">the name of the rollup command</param>
+
+<param name="kwargs">keyword arguments string that influences how the rollup expands into commands</param>
+
+<comment>Executes a command rollup, which is a series of commands with a unique
+name, and optionally arguments that control the generation of the set of
+commands. If any one of the rolled-up commands fails, the rollup is
+considered to have failed. Rollups may also contain nested rollups.</comment>
+
+</function>
+
+<function name="addScript">
+
+<param name="scriptContent">the Javascript content of the script to add</param>
+
+<param name="scriptTagId">(optional) the id of the new script tag. If specified, and an element with this id already exists, this operation will fail.</param>
+
+<comment>Loads script content into a new script tag in the Selenium document. This
+differs from the runScript command in that runScript adds the script tag
+to the document of the AUT, not the Selenium document. The following
+entities in the script content are replaced by the characters they
+represent:
+
+ &lt;
+ &gt;
+ &amp;
+
+The corresponding remove command is removeScript.</comment>
+
+</function>
+
+<function name="removeScript">
+
+<param name="scriptTagId">the id of the script element to remove.</param>
+
+<comment>Removes a script tag from the Selenium document identified by the given
+id. Does nothing if the referenced tag doesn't exist.</comment>
+
+</function>
+
+<function name="useXpathLibrary">
+
+<param name="libraryName">name of the desired library Only the following three can be chosen: <ul> <li>"ajaxslt" - Google's library</li> <li>"javascript-xpath" - Cybozu Labs' faster library</li> <li>"default" - The default library. Currently the default library is "ajaxslt" .</li> </ul> If libraryName isn't one of these three, then no change will be made.</param>
+
+<comment>Allows choice of one of the available libraries.</comment>
+
+</function>
+
<function name="pause">
<param name="waitTime">the amount of time to sleep (in milliseconds)</param>
View
431 tests/selenium/selenium-lib/core/iedoc.xml
@@ -79,6 +79,16 @@ Select the element using css selectors. Please refer to <a href="http://www.w3.o
</ul>
<p>Currently the css selector locator supports all css1, css2 and css3 selectors except namespace in css3, some pseudo classes(:nth-of-type, :nth-last-of-type, :first-of-type, :last-of-type, :only-of-type, :visited, :hover, :active, :focus, :indeterminate) and pseudo elements(::first-line, ::first-letter, ::selection, ::before, ::after). </p>
</li>
+
+<li><strong>ui</strong>=<em>uiSpecifierString</em>:
+Locate an element by resolving the UI specifier string to another locator, and evaluating it. See the <a href="http://svn.openqa.org/fisheye/browse/~raw,r=trunk/selenium/trunk/src/main/resources/core/scripts/ui-doc.html">Selenium UI-Element Reference</a> for more details.
+<ul class="first last simple">
+<li>ui=loginPages::loginButton()</li>
+<li>ui=settingsPages::toggle(label=Hide Email)</li>
+<li>ui=forumPages::postBody(index=2)//a[2]</li>
+</ul>
+</li>
+
</ul>
<p>
@@ -123,6 +133,8 @@ string.</li>
<li><strong>regexp:</strong><em>regexp</em>:
Match a string using a regular-expression. The full power of JavaScript
regular-expressions is available.</li>
+<li><strong>regexpi:</strong><em>regexpi</em>:
+Match a string using a case-insensitive regular-expression.</li>
<li><strong>exact:</strong><em>string</em>:
Match a string exactly, verbatim, without any of that fancy wildcard
@@ -131,6 +143,14 @@ stuff.</li>
<p>
If no pattern prefix is specified, Selenium assumes that it's a "glob"
pattern.
+</p>
+<p>
+For commands that return multiple values (such as verifySelectOptions),
+the string being matched is a comma-separated list of the return values,
+where both commas and backslashes in the values are backslash-escaped.
+When providing a pattern, the optional matching syntax (i.e. glob,
+regexp, etc.) is specified once, as usual, at the beginning of the
+pattern.
</p></top>
<function name="click">
@@ -153,6 +173,14 @@ waitForPageToLoad.</comment>
</function>
+<function name="contextMenu">
+
+<param name="locator">an element locator</param>
+
+<comment>Simulates opening the context menu for the specified element (as might happen if the user "right-clicked" on the element).</comment>
+
+</function>
+
<function name="clickAt">
<param name="locator">an element locator</param>
@@ -177,6 +205,16 @@ waitForPageToLoad.</comment>
</function>
+<function name="contextMenuAt">
+
+<param name="locator">an element locator</param>
+
+<param name="coordString">specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator.</param>
+
+<comment>Simulates opening the context menu for the specified element (as might happen if the user "right-clicked" on the element).</comment>
+
+</function>
+
<function name="fireEvent">
<param name="locator">an <a href="#locators">element locator</a></param>
@@ -188,6 +226,14 @@ handler.</comment>
</function>
+<function name="focus">
+
+<param name="locator">an <a href="#locators">element locator</a></param>
+
+<comment>Move the focus to the specified element; for example, if the element is an input field, move the cursor to that field.</comment>
+
+</function>
+
<function name="keyPress">
<param name="locator">an <a href="#locators">element locator</a></param>
@@ -286,7 +332,16 @@ handler.</comment>
<param name="locator">an <a href="#locators">element locator</a></param>
-<comment>Simulates a user pressing the mouse button (without releasing it yet) on
+<comment>Simulates a user pressing the left mouse button (without releasing it yet) on
+the specified element.</comment>
+
+</function>
+
+<function name="mouseDownRight">
+
+<param name="locator">an <a href="#locators">element locator</a></param>
+
+<comment>Simulates a user pressing the right mouse button (without releasing it yet) on
the specified element.</comment>
</function>
@@ -297,7 +352,18 @@ the specified element.</comment>
<param name="coordString">specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator.</param>
-<comment>Simulates a user pressing the mouse button (without releasing it yet) at
+<comment>Simulates a user pressing the left mouse button (without releasing it yet) at
+the specified location.</comment>
+
+</function>
+
+<function name="mouseDownRightAt">
+
+<param name="locator">an <a href="#locators">element locator</a></param>
+
+<param name="coordString">specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator.</param>
+
+<comment>Simulates a user pressing the right mouse button (without releasing it yet) at
the specified location.</comment>
</function>
@@ -311,6 +377,15 @@ holding the button down) on the specified element.</comment>
</function>
+<function name="mouseUpRight">
+
+<param name="locator">an <a href="#locators">element locator</a></param>
+
+<comment>Simulates the event that occurs when the user releases the right mouse button (i.e., stops
+holding the button down) on the specified element.</comment>
+
+</function>
+
<function name="mouseUpAt">
<param name="locator">an <a href="#locators">element locator</a></param>
@@ -322,6 +397,17 @@ holding the button down) at the specified location.</comment>
</function>
+<function name="mouseUpRightAt">
+
+<param name="locator">an <a href="#locators">element locator</a></param>
+
+<param name="coordString">specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator.</param>
+
+<comment>Simulates the event that occurs when the user releases the right mouse button (i.e., stops
+holding the button down) at the specified location.</comment>
+
+</function>
+
<function name="mouseMove">
<param name="locator">an <a href="#locators">element locator</a></param>
@@ -386,6 +472,8 @@ the delay is 0 milliseconds.</comment>
<function name="getSpeed">
+<return type="string">the execution speed in milliseconds.</return>
+
<comment>Get execution speed (i.e., get the millisecond length of the delay following each selenium operation). By default, there is no such delay, i.e.,
the delay is 0 milliseconds.
@@ -538,27 +626,43 @@ an empty (blank) url, like this: openWindow("", "myFunnyWindow").</p></comment>
<param name="windowID">the JavaScript window ID of the window to select</param>
-<comment>Selects a popup window; once a popup window has been selected, all
+<comment>Selects a popup window using a window locator; once a popup window has been selected, all
commands go to that window. To select the main window again, use null
as the target.
-<p>Note that there is a big difference between a window's internal JavaScript "name" property
-and the "title" of a given window's document (which is normally what you actually see, as an end user,
-in the title bar of the window). The "name" is normally invisible to the end-user; it's the second
-parameter "windowName" passed to the JavaScript method window.open(url, windowName, windowFeatures, replaceFlag)
-(which selenium intercepts).</p>
-
-<p>Selenium has several strategies for finding the window object referred to by the "windowID" parameter.</p>
+<p>
+Window locators provide different ways of specifying the window object:
+by title, by internal JavaScript "name," or by JavaScript variable.
+</p>
+<ul>
+<li><strong>title</strong>=<em>My Special Window</em>:
+Finds the window using the text that appears in the title bar. Be careful;
+two windows can share the same title. If that happens, this locator will
+just pick one.
+</li>
+<li><strong>name</strong>=<em>myWindow</em>:
+Finds the window using its internal JavaScript "name" property. This is the second
+parameter "windowName" passed to the JavaScript method window.open(url, windowName, windowFeatures, replaceFlag)
+(which Selenium intercepts).
+</li>
+<li><strong>var</strong>=<em>variableName</em>:
+Some pop-up windows are unnamed (anonymous), but are associated with a JavaScript variable name in the current
+application window, e.g. "window.foo = window.open(url);". In those cases, you can open the window using
+"var=foo".
+</li>
+</ul>
+<p>
+If no window locator prefix is provided, we'll try to guess what you mean like this:</p>
<p>1.) if windowID is null, (or the string "null") then it is assumed the user is referring to the original window instantiated by the browser).</p>
<p>2.) if the value of the "windowID" parameter is a JavaScript variable name in the current application window, then it is assumed
that this variable contains the return value from a call to the JavaScript window.open() method.</p>
<p>3.) Otherwise, selenium looks in a hash it maintains that maps string names to window "names".</p>
-<p>4.) If <i>that</i> fails, we'll try looping over all of the known windows to try to find the appropriate "title".
+<p>4.) If <em>that</em> fails, we'll try looping over all of the known windows to try to find the appropriate "title".
Since "title" is not necessarily unique, this may have unexpected behavior.</p>
-<p>If you're having trouble figuring out what is the name of a window that you want to manipulate, look at the selenium log messages
-which identify the names of windows created via window.open (and therefore intercepted by selenium). You will see messages
+<p>If you're having trouble figuring out the name of a window that you want to manipulate, look at the Selenium log messages
+which identify the names of windows created via window.open (and therefore intercepted by Selenium). You will see messages
like the following for each window as it is opened:</p>
<p><code>debug: window.open call intercepted; window ID (which you can use with selectWindow()) is "myNewWindow"</code></p>
@@ -569,6 +673,36 @@ an empty (blank) url, like this: openWindow("", "myFunnyWindow").</p></comment>
</function>
+<function name="selectPopUp">
+
+<param name="windowID">an identifier for the popup window, which can take on a number of different meanings</param>
+
+<comment>Simplifies the process of selecting a popup window (and does not offer
+functionality beyond what <code>selectWindow()</code> already provides).
+<ul>
+<li>If <code>windowID</code> is either not specified, or specified as
+"null", the first non-top window is selected. The top window is the one
+that would be selected by <code>selectWindow()</code> without providing a
+<code>windowID</code> . This should not be used when more than one popup
+window is in play.</li>
+<li>Otherwise, the window will be looked up considering
+<code>windowID</code> as the following in order: 1) the "name" of the
+window, as specified to <code>window.open()</code>; 2) a javascript
+variable which is a reference to a window; and 3) the title of the
+window. This is the same ordered lookup performed by
+<code>selectWindow</code> .</li>
+</ul></comment>
+
+</function>
+
+<function name="deselectPopUp">
+
+<comment>Selects the main window. Functionally equivalent to using
+<code>selectWindow()</code> and specifying no value for
+<code>windowID</code>.</comment>
+
+</function>
+
<function name="selectFrame">
<param name="locator">an <a href="#locators">element locator</a> identifying a frame or iframe</param>
@@ -622,9 +756,9 @@ The selected window will return true, while all others will return false.</p></c
<function name="waitForPopUp">
-<param name="windowID">the JavaScript window ID of the window that will appear</param>
+<param name="windowID">the JavaScript window "name" of the window that will appear (not the text of the title bar) If unspecified, or specified as "null", this command will wait for the first non-top window to appear (don't rely on this if you are working with multiple popups simultaneously).</param>
-<param name="timeout">a timeout in milliseconds, after which the action will return with an error</param>
+<param name="timeout">a timeout in milliseconds, after which the action will return with an error. If this value is not specified, the default Selenium timeout will be used. See the setTimeout() command.</param>
<comment>Waits for a popup window to appear and load up.</comment>
@@ -632,26 +766,40 @@ The selected window will return true, while all others will return false.</p></c
<function name="chooseCancelOnNextConfirmation">
-<comment>By default, Selenium's overridden window.confirm() function will
+<comment><p>
+By default, Selenium's overridden window.confirm() function will
return true, as if the user had manually clicked OK; after running
this command, the next call to confirm() will return false, as if
the user had clicked Cancel. Selenium will then resume using the
default behavior for future confirmations, automatically returning
true (OK) unless/until you explicitly call this command for each
-confirmation.</comment>
+confirmation.
+</p>
+<p>
+Take note - every time a confirmation comes up, you must
+consume it with a corresponding getConfirmation, or else
+the next selenium operation will fail.
+</p></comment>
</function>
<function name="chooseOkOnNextConfirmation">
-<comment>Undo the effect of calling chooseCancelOnNextConfirmation. Note
+<comment><p>
+Undo the effect of calling chooseCancelOnNextConfirmation. Note
that Selenium's overridden window.confirm() function will normally automatically
return true, as if the user had manually clicked OK, so you shouldn't
need to use this command unless for some reason you need to change
your mind prior to the next confirmation. After any confirmation, Selenium will resume using the
default behavior for future confirmations, automatically returning
true (OK) unless/until you explicitly call chooseCancelOnNextConfirmation for each
-confirmation.</comment>
+confirmation.
+</p>
+<p>
+Take note - every time a confirmation comes up, you must
+consume it with a corresponding getConfirmation, or else
+the next selenium operation will fail.
+</p></comment>
</function>
@@ -726,13 +874,13 @@ This function never throws an exception
<comment>Retrieves the message of a JavaScript alert generated during the previous action, or fail if there were no alerts.
<p>Getting an alert has the same effect as manually clicking OK. If an
-alert is generated but you do not get/verify it, the next Selenium action
+alert is generated but you do not consume it with getAlert, the next Selenium action
will fail.</p>
-<p>NOTE: under Selenium, JavaScript alerts will NOT pop up a visible alert
+<p>Under Selenium, JavaScript alerts will NOT pop up a visible alert
dialog.</p>
-<p>NOTE: Selenium does NOT support JavaScript alerts that are generated in a
+<p>Selenium does NOT support JavaScript alerts that are generated in a
page's onload() event handler. In this case a visible dialog WILL be
generated and Selenium will hang until someone manually clicks OK.</p></comment>
@@ -748,8 +896,11 @@ the previous action.
<p>
By default, the confirm function will return true, having the same effect
as manually clicking OK. This can be changed by prior execution of the
-chooseCancelOnNextConfirmation command. If an confirmation is generated
-but you do not get/verify it, the next Selenium action will fail.
+chooseCancelOnNextConfirmation command.
+</p>
+<p>
+If an confirmation is generated but you do not consume it with getConfirmation,
+the next Selenium action will fail.
</p>
<p>
@@ -989,7 +1140,9 @@ tableLocator.row.column, where row and column start at 0.</comment>
<param name="attributeLocator">an element locator followed by an &#064; sign and then the name of the attribute, e.g. "foo&#064;bar"</param>
-<comment>Gets the value of an element attribute.</comment>
+<comment>Gets the value of an element attribute. The value of the attribute may
+differ across browsers (this is the case for the "style" attribute, for
+example).</comment>
</function>
@@ -1074,7 +1227,7 @@ This method will fail if the specified element isn't an input element.</comment>
<param name="attributeName">name of an attribute on the windows</param>
-<comment>Returns every instance of some attribute from all known windows.</comment>
+<comment>Returns an array of JavaScript property values from all known windows having one.</comment>
</function>
@@ -1144,25 +1297,25 @@ just send one "mousemove" at the start location and then one final one at the en
<function name="getAllWindowIds">
-<return type="string[]">the IDs of all windows that the browser knows about.</return>
+<return type="string[]">Array of identifiers of all windows that the browser knows about.</return>
-<comment>Returns the IDs of all windows that the browser knows about.</comment>
+<comment>Returns the IDs of all windows that the browser knows about in an array.</comment>
</function>
<function name="getAllWindowNames">
-<return type="string[]">the names of all windows that the browser knows about.</return>
+<return type="string[]">Array of names of all windows that the browser knows about.</return>
-<comment>Returns the names of all windows that the browser knows about.</comment>
+<comment>Returns the names of all windows that the browser knows about in an array.</comment>
</function>
<function name="getAllWindowTitles">
-<return type="string[]">the titles of all windows that the browser knows about.</return>
+<return type="string[]">Array of titles of all windows that the browser knows about.</return>
-<comment>Returns the titles of all windows that the browser knows about.</comment>
+<comment>Returns the titles of all windows that the browser knows about in an array.</comment>
</function>
@@ -1313,6 +1466,22 @@ version is much slower than the native implementations.</comment>
</function>
+<function name="ignoreAttributesWithoutValue">
+
+<param name="ignore">boolean, true means we'll ignore attributes without value at the expense of xpath "correctness"; false means we'll sacrifice speed for correctness.</param>
+
+<comment>Specifies whether Selenium will ignore xpath attributes that have no
+value, i.e. are the empty string, when using the non-native xpath
+evaluation engine. You'd want to do this for performance reasons in IE.
+However, this could break certain xpaths, for example an xpath that looks
+for an attribute whose value is NOT the empty string.
+
+The hope is that such xpaths are relatively rare, but the user should
+have the option of using them. Note that this only influences xpath
+evaluation when using the ajaxslt engine (i.e. not "javascript-xpath").</comment>
+
+</function>
+
<function name="waitForCondition">
<param name="script">the JavaScript snippet to run</param>
@@ -1380,11 +1549,31 @@ See waitForPageToLoad for more information.</comment>
</function>
+<function name="getCookieByName">
+
+<return type="string">the value of the cookie</return>
+
+<param name="name">the name of the cookie</param>
+
+<comment>Returns the value of the cookie with the specified name, or throws an error if the cookie is not present.</comment>
+
+</function>
+
+<function name="isCookiePresent">
+
+<return type="boolean">true if a cookie with the specified name is present, or false otherwise.</return>
+
+<param name="name">the name of the cookie</param>
+
+<comment>Returns true if a cookie with the specified name is present, or false otherwise.</comment>
+
+</function>
+
<function name="createCookie">
<param name="nameValuePair">name and value of the cookie in a format "name=value"</param>
-<param name="optionsString">options for the cookie. Currently supported options include 'path' and 'max_age'. the optionsString's format is "path=/path/, max_age=60". The order of options are irrelevant, the unit of the value of 'max_age' is second.</param>
+<param name="optionsString">options for the cookie. Currently supported options include 'path', 'max_age' and 'domain'. the optionsString's format is "path=/path/, max_age=60, domain=.foo.com". The order of options are irrelevant, the unit of the value of 'max_age' is second. Note that specifying a domain that isn't a subset of the current domain will usually fail.</param>
<comment>Create a new cookie whose path and domain are same with those of current page
under test, unless you specified a path for this cookie explicitly.</comment>
@@ -1395,9 +1584,26 @@ under test, unless you specified a path for this cookie explicitly.</comment>
<param name="name">the name of the cookie to be deleted</param>
-<param name="path">the path property of the cookie to be deleted</param>
+<param name="optionsString">options for the cookie. Currently supported options include 'path', 'domain' and 'recurse.' The optionsString's format is "path=/path/, domain=.foo.com, recurse=true". The order of options are irrelevant. Note that specifying a domain that isn't a subset of the current domain will usually fail.</param>
+
+<comment>Delete a named cookie with specified path and domain. Be careful; to delete a cookie, you
+need to delete it using the exact same path and domain that were used to create the cookie.
+If the path is wrong, or the domain is wrong, the cookie simply won't be deleted. Also
+note that specifying a domain that isn't a subset of the current domain will usually fail.
+
+Since there's no way to discover at runtime the original path and domain of a given cookie,
+we've added an option called 'recurse' to try all sub-domains of the current domain with
+all paths that are a subset of the current path. Beware; this option can be slow. In
+big-O notation, it operates in O(n*m) time, where n is the number of dots in the domain
+name and m is the number of slashes in the path.</comment>
+
+</function>
+
+<function name="deleteAllVisibleCookies">
-<comment>Delete a named cookie with specified path.</comment>
+<comment>Calls deleteCookie with recurse=true on all cookies visible to the current page.
+As noted on the documentation for deleteCookie, recurse=true can be much slower
+than simply deleting the cookies using a known domain/path.</comment>
</function>
@@ -1449,6 +1655,74 @@ The function must return null if the element can't be found.</comment>
</function>
+<function name="captureEntirePageScreenshot">
+
+<param name="filename">the path to the file to persist the screenshot as. No filename extension will be appended by default. Directories will not be created if they do not exist, and an exception will be thrown, possibly by native code.</param>
+
+<param name="kwargs">a kwargs string that modifies the way the screenshot is captured. Example: "background=#CCFFDD" . Currently valid options: <dl> <dt>background</dt> <dd>the background CSS for the HTML document. This may be useful to set for capturing screenshots of less-than-ideal layouts, for example where absolute positioning causes the calculation of the canvas dimension to fail and a black background is exposed (possibly obscuring black text).</dd> </dl></param>
+
+<comment>Saves the entire contents of the current window canvas to a PNG file.
+Contrast this with the captureScreenshot command, which captures the
+contents of the OS viewport (i.e. whatever is currently being displayed
+on the monitor), and is implemented in the RC only. Currently this only
+works in Firefox when running in chrome mode, and in IE non-HTA using
+the EXPERIMENTAL "Snapsie" utility. The Firefox implementation is mostly
+borrowed from the Screengrab! Firefox extension. Please see
+http://www.screengrab.org and http://snapsie.sourceforge.net/ for
+details.</comment>
+
+</function>
+
+<function name="rollup">
+
+<param name="rollupName">the name of the rollup command</param>
+
+<param name="kwargs">keyword arguments string that influences how the rollup expands into commands</param>
+
+<comment>Executes a command rollup, which is a series of commands with a unique
+name, and optionally arguments that control the generation of the set of
+commands. If any one of the rolled-up commands fails, the rollup is
+considered to have failed. Rollups may also contain nested rollups.</comment>
+
+</function>
+
+<function name="addScript">
+
+<param name="scriptContent">the Javascript content of the script to add</param>
+
+<param name="scriptTagId">(optional) the id of the new script tag. If specified, and an element with this id already exists, this operation will fail.</param>
+
+<comment>Loads script content into a new script tag in the Selenium document. This
+differs from the runScript command in that runScript adds the script tag
+to the document of the AUT, not the Selenium document. The following
+entities in the script content are replaced by the characters they
+represent:
+
+ &lt;
+ &gt;
+ &amp;
+
+The corresponding remove command is removeScript.</comment>
+
+</function>
+
+<function name="removeScript">
+
+<param name="scriptTagId">the id of the script element to remove.</param>
+
+<comment>Removes a script tag from the Selenium document identified by the given
+id. Does nothing if the referenced tag doesn't exist.</comment>
+
+</function>
+
+<function name="useXpathLibrary">
+
+<param name="libraryName">name of the desired library Only the following three can be chosen: <ul> <li>"ajaxslt" - Google's library</li> <li>"javascript-xpath" - Cybozu Labs' faster library</li> <li>"default" - The default library. Currently the default library is "ajaxslt" .</li> </ul> If libraryName isn't one of these three, then no change will be made.</param>
+
+<comment>Allows choice of one of the available libraries.</comment>
+
+</function>
+
<function name="setContext">
<param name="context">the message to be sent to the browser</param>
@@ -1458,6 +1732,16 @@ log.</comment>
</function>
+<function name="attachFile">
+
+<param name="fieldLocator">an <a href="#locators">element locator</a></param>
+
+<param name="fileLocator">a URL pointing to the specified file. Before the file can be set in the input field (fieldLocator), Selenium RC may need to transfer the file to the local machine before attaching the file in a web page form. This is common in selenium grid configurations where the RC server driving the browser is not the same machine that started the test. Supported Browsers: Firefox ("*chrome") only.</param>
+
+<comment>Sets a file input (upload) field to the file listed in fileLocator</comment>
+
+</function>
+
<function name="captureScreenshot">
<param name="filename">the absolute path to the file to be written, e.g. "c:\blah\screenshot.png"</param>
@@ -1466,4 +1750,81 @@ log.</comment>
</function>
+<function name="captureScreenshotToString">
+
+<return type="string">The base 64 encoded string of the screen shot (PNG file)</return>
+
+<comment>Capture a PNG screenshot. It then returns the file as a base 64 encoded string.</comment>
+
+</function>
+
+<function name="captureEntirePageScreenshotToString">
+
+<return type="string">The base 64 encoded string of the page screenshot (PNG file)</return>
+
+<param name="kwargs">A kwargs string that modifies the way the screenshot is captured. Example: "background=#CCFFDD". This may be useful to set for capturing screenshots of less-than-ideal layouts, for example where absolute positioning causes the calculation of the canvas dimension to fail and a black background is exposed (possibly obscuring black text).</param>
+
+<comment>Downloads a screenshot of the browser current window canvas to a
+based 64 encoded PNG file. The <em>entire</em> windows canvas is captured,
+including parts rendered outside of the current view port.
+
+Currently this only works in Mozilla and when running in chrome mode.</comment>
+
+</function>
+
+<function name="shutDownSeleniumServer">
+
+<comment>Kills the running Selenium Server and all browser sessions. After you run this command, you will no longer be able to send
+commands to the server; you can't remotely start the server once it has been stopped. Normally
+you should prefer to run the "stop" command, which terminates the current browser session, rather than
+shutting down the entire server.</comment>
+
+</function>
+
+<function name="retrieveLastRemoteControlLogs">
+
+<return type="string">The last N log messages as a multi-line string.</return>
+
+<comment>Retrieve the last messages logged on a specific remote control. Useful for error reports, especially
+when running multiple remote controls in a distributed environment. The maximum number of log messages
+that can be retrieve is configured on remote control startup.</comment>
+
+</function>
+
+<function name="keyDownNative">
+
+<param name="keycode">an integer keycode number corresponding to a java.awt.event.KeyEvent; note that Java keycodes are NOT the same thing as JavaScript keycodes!</param>
+
+<comment>Simulates a user pressing a key (without releasing it yet) by sending a native operating system keystroke.
+This function uses the java.awt.Robot class to send a keystroke; this more accurately simulates typing
+a key on the keyboard. It does not honor settings from the shiftKeyDown, controlKeyDown, altKeyDown and
+metaKeyDown commands, and does not target any particular HTML element. To send a keystroke to a particular
+element, focus on the element first before running this command.</comment>
+
+</function>
+
+<function name="keyUpNative">
+
+<param name="keycode">an integer keycode number corresponding to a java.awt.event.KeyEvent; note that Java keycodes are NOT the same thing as JavaScript keycodes!</param>
+
+<comment>Simulates a user releasing a key by sending a native operating system keystroke.
+This function uses the java.awt.Robot class to send a keystroke; this more accurately simulates typing
+a key on the keyboard. It does not honor settings from the shiftKeyDown, controlKeyDown, altKeyDown and
+metaKeyDown commands, and does not target any particular HTML element. To send a keystroke to a particular
+element, focus on the element first before running this command.</comment>
+
+</function>
+
+<function name="keyPressNative">
+
+<param name="keycode">an integer keycode number corresponding to a java.awt.event.KeyEvent; note that Java keycodes are NOT the same thing as JavaScript keycodes!</param>
+
+<comment>Simulates a user pressing and releasing a key by sending a native operating system keystroke.
+This function uses the java.awt.Robot class to send a keystroke; this more accurately simulates typing
+a key on the keyboard. It does not honor settings from the shiftKeyDown, controlKeyDown, altKeyDown and
+metaKeyDown commands, and does not target any particular HTML element. To send a keystroke to a particular
+element, focus on the element first before running this command.</comment>
+
+</function>
+
</apidoc>
View
91 tests/selenium/selenium-lib/core/lib/snapsie.js
@@ -0,0 +1,91 @@
+/**
+ * This file wraps the Snapsie ActiveX object, exposing a single saveSnapshot()
+ * method on a the object.
+ *
+ * See http://snapsie.sourceforge.net/
+ */
+
+function Snapsie() {
+ // private methods
+
+ function isQuirksMode(inDocument) {
+ return (inDocument.compatMode == 'BackCompat');
+ }
+
+ function getDrawableElement(inDocument) {
+ if (isQuirksMode(inDocument)) {
+ var body = inDocument.getElementsByTagName('body')[0];
+ return body;
+ }
+ else {
+ // standards mode
+ return inDocument.documentElement;
+ }
+ }
+
+ /**
+ * Returns the canonical Windows path for a given path. This means
+ * basically replacing any forwards slashes with backslashes.
+ *
+ * @param path the path whose canonical form to return
+ */
+ function getCanonicalPath(path) {
+ path = path.replace(/\//g, '\\');
+ path = path.replace(/\\\\/g, '\\');
+ return path;
+ }
+
+ // public methods
+
+ /**
+ * Saves a screenshot of the current document to a file. If frameId is
+ * specified, a screenshot of just the frame is captured instead.