|
89 | 89 | </head>
|
90 | 90 | <body>
|
91 | 91 | <h1>Selenium2Library</h1>
|
92 |
| -<b>Version:</b> 0.5.2<br> |
| 92 | +<b>Version:</b> 1.0.0<br> |
93 | 93 | <b>Scope:</b> global<br>
|
94 | 94 | <b>Named arguments: </b>
|
95 | 95 | supported
|
@@ -196,11 +196,13 @@ <h2 id="importing">Importing</h2>
|
196 | 196 | <th class="doc">Documentation</th>
|
197 | 197 | </tr>
|
198 | 198 | <tr>
|
199 |
| - <td class="arg">timeout=5.0, run_on_failure=Capture Page Screenshot</td> |
| 199 | + <td class="arg">timeout=5.0, implicit_wait=0.0, run_on_failure=Capture Page Screenshot</td> |
200 | 200 | <td class="doc">Selenium2Library can be imported with optional arguments.
|
201 | 201 |
|
202 | 202 | <span class="name">timeout</span> is the default timeout used to wait for all waiting actions. It can be later set with <a href="#Set Selenium Timeout" class="name">Set Selenium Timeout</a>.
|
203 | 203 |
|
| 204 | +'implicit_wait' is the implicit timeout that Selenium waits when looking for elements. It can be later set with 'Set Selenium Implicit Wait'. |
| 205 | + |
204 | 206 | <span class="name">run_on_failure</span> specifies the name of a keyword (from any available libraries) to execute when a Selenium2Library keyword fails. By default <a href="#Capture Page Screenshot" class="name">Capture Page Screenshot</a> will be used to take a screenshot of the current page. Using the value "Nothing" will disable this feature altogether. See <a href="#Register Keyword To Run On Failure" class="name">Register Keyword To Run On Failure</a> keyword for more information about this functionality.
|
205 | 207 |
|
206 | 208 | Examples:
|
@@ -275,6 +277,8 @@ <h2>Shortcuts</h2>
|
275 | 277 | ·
|
276 | 278 | <a href="#Element Text Should Be" title="Verifies element identified by `locator` exactly contains text `expected`.">Element Text Should Be</a>
|
277 | 279 | ·
|
| 280 | +<a href="#Execute Async Javascript" title="Executes asynchronous JavaScript code.">Execute Async Javascript</a> |
| 281 | + · |
278 | 282 | <a href="#Execute Javascript" title="Executes the given JavaScript code.">Execute Javascript</a>
|
279 | 283 | ·
|
280 | 284 | <a href="#Focus" title="Sets focus to element identified by `locator`.">Focus</a>
|
@@ -307,6 +311,8 @@ <h2>Shortcuts</h2>
|
307 | 311 | ·
|
308 | 312 | <a href="#Get Selected List Values" title="Returns the values of selected elements (as a list) from the select list identified by `locator`.">Get Selected List Values</a>
|
309 | 313 | ·
|
| 314 | +<a href="#Get Selenium Implicit Wait" title="Gets the wait in seconds that is waited by Selenium.">Get Selenium Implicit Wait</a> |
| 315 | + · |
310 | 316 | <a href="#Get Selenium Speed" title="Gets the delay in seconds that is waited after each Selenium command.">Get Selenium Speed</a>
|
311 | 317 | ·
|
312 | 318 | <a href="#Get Selenium Timeout" title="Gets the timeout in seconds that is used by various keywords.">Get Selenium Timeout</a>
|
@@ -425,6 +431,10 @@ <h2>Shortcuts</h2>
|
425 | 431 | ·
|
426 | 432 | <a href="#Select Window" title="Selects the window found with `locator` as the context of actions.">Select Window</a>
|
427 | 433 | ·
|
| 434 | +<a href="#Set Browser Implicit Wait" title="Sets current browser's implicit wait in seconds.">Set Browser Implicit Wait</a> |
| 435 | + · |
| 436 | +<a href="#Set Selenium Implicit Wait" title="Sets Selenium 2's default implicit wait in seconds and">Set Selenium Implicit Wait</a> |
| 437 | + · |
428 | 438 | <a href="#Set Selenium Speed" title="Sets the delay in seconds that is waited after each Selenium command.">Set Selenium Speed</a>
|
429 | 439 | ·
|
430 | 440 | <a href="#Set Selenium Timeout" title="Sets the timeout in seconds used by various keywords.">Set Selenium Timeout</a>
|
@@ -733,6 +743,31 @@ <h2>Keywords</h2>
|
733 | 743 |
|
734 | 744 | Key attributes for arbitrary elements are <span class="name">id</span> and <span class="name">name</span>. See <a href="#introduction" class="name">introduction</a> for details about locating elements.</td>
|
735 | 745 | </tr>
|
| 746 | +<tr> |
| 747 | + <td class="kw"><a name="Execute Async Javascript"></a>Execute Async Javascript</td> |
| 748 | + <td class="arg">*code</td> |
| 749 | + <td class="doc">Executes asynchronous JavaScript code. |
| 750 | + |
| 751 | +<span class="name">code</span> may contain multiple lines of code but must contain a return statement (with the value to be returned) at the end. |
| 752 | + |
| 753 | +<span class="name">code</span> may be divided into multiple cells in the test data. In that case, the parts are catenated together without adding spaces. |
| 754 | + |
| 755 | +If <span class="name">code</span> is an absolute path to an existing file, the JavaScript to execute will be read from that file. Forward slashes work as a path separator on all operating systems. |
| 756 | + |
| 757 | +Note that, by default, the code will be executed in the context of the Selenium object itself, so <span class="name">this</span> will refer to the Selenium object. Use <span class="name">window</span> to refer to the window of your application, e.g. <span class="name">window.document.getElementById('foo')</span>. |
| 758 | + |
| 759 | +Example: |
| 760 | +<table border="1" class="doc"> |
| 761 | +<tr> |
| 762 | +<td>Execute Async JavaScript</td> |
| 763 | +<td>window.my_js_function('arg1', 'arg2')</td> |
| 764 | +</tr> |
| 765 | +<tr> |
| 766 | +<td>Execute Async JavaScript</td> |
| 767 | +<td>${CURDIR}/js_to_execute.js</td> |
| 768 | +</tr> |
| 769 | +</table></td> |
| 770 | +</tr> |
736 | 771 | <tr>
|
737 | 772 | <td class="kw"><a name="Execute Javascript"></a>Execute Javascript</td>
|
738 | 773 | <td class="arg">*code</td>
|
@@ -869,6 +904,13 @@ <h2>Keywords</h2>
|
869 | 904 |
|
870 | 905 | Select list keywords work on both lists and combo boxes. Key attributes for select lists are <span class="name">id</span> and <span class="name">name</span>. See <a href="#introduction" class="name">introduction</a> for details about locating elements.</td>
|
871 | 906 | </tr>
|
| 907 | +<tr> |
| 908 | + <td class="kw"><a name="Get Selenium Implicit Wait"></a>Get Selenium Implicit Wait</td> |
| 909 | + <td class="arg"></td> |
| 910 | + <td class="doc">Gets the wait in seconds that is waited by Selenium. |
| 911 | + |
| 912 | +See <a href="#Set Selenium Implicit Wait" class="name">Set Selenium Implicit Wait</a> for an explanation.</td> |
| 913 | +</tr> |
872 | 914 | <tr>
|
873 | 915 | <td class="kw"><a name="Get Selenium Speed"></a>Get Selenium Speed</td>
|
874 | 916 | <td class="arg"></td>
|
@@ -1051,7 +1093,7 @@ <h2>Keywords</h2>
|
1051 | 1093 | </tr>
|
1052 | 1094 | <tr>
|
1053 | 1095 | <td class="kw"><a name="Open Browser"></a>Open Browser</td>
|
1054 |
| - <td class="arg">url, browser=firefox, alias=None</td> |
| 1096 | + <td class="arg">url, browser=firefox, alias=None, remote_url=False, desired_capabilities=None, ff_profile_dir=None</td> |
1055 | 1097 | <td class="doc">Opens a new browser instance to given URL.
|
1056 | 1098 |
|
1057 | 1099 | Returns the index of this browser instance which can be used later to switch back to it. Index starts from 1 and is reset back to it when <a href="#Close All Browsers" class="name">Close All Browsers</a> keyword is used. See <a href="#Switch Browser" class="name">Switch Browser</a> for example.
|
@@ -1089,8 +1131,16 @@ <h2>Keywords</h2>
|
1089 | 1131 | <td>chrome</td>
|
1090 | 1132 | <td>Google Chrome</td>
|
1091 | 1133 | </tr>
|
| 1134 | +<tr> |
| 1135 | +<td>opera</td> |
| 1136 | +<td>Opera</td> |
| 1137 | +</tr> |
1092 | 1138 | </table>
|
1093 |
| -Note, that you will encounter strange behavior, if you open multiple Internet Explorer browser instances. That is also why <a href="#Switch Browser" class="name">Switch Browser</a> only works with one IE browser at most. For more information see: <a href="http://selenium-grid.seleniumhq.org/faq.html#i_get_some_strange_errors_when_i_run_multiple_internet_explorer_instances_on_the_same_machine">http://selenium-grid.seleniumhq.org/faq.html#i_get_some_strange_errors_when_i_run_multiple_internet_explorer_instances_on_the_same_machine</a></td> |
| 1139 | +Note, that you will encounter strange behavior, if you open multiple Internet Explorer browser instances. That is also why <a href="#Switch Browser" class="name">Switch Browser</a> only works with one IE browser at most. For more information see: <a href="http://selenium-grid.seleniumhq.org/faq.html#i_get_some_strange_errors_when_i_run_multiple_internet_explorer_instances_on_the_same_machine">http://selenium-grid.seleniumhq.org/faq.html#i_get_some_strange_errors_when_i_run_multiple_internet_explorer_instances_on_the_same_machine</a> |
| 1140 | + |
| 1141 | +Optional 'remote_url' is the url for a remote selenium server for example <a href="http://127.0.0.1/wd/hub">http://127.0.0.1/wd/hub</a>. If you specify a value for remote you can also specify 'desired_capabilities' which is a string in the form key1:val1,key2:val2 that will be used to specify desired_capabilities to the remote server. This is useful for doing things like specify a proxy server for internet explorer or for specify browser and os if your using saucelabs.com. |
| 1142 | + |
| 1143 | +Optional 'ff_profile_dir' is the path to the firefox profile dir if you wish to overwrite the default.</td> |
1094 | 1144 | </tr>
|
1095 | 1145 | <tr>
|
1096 | 1146 | <td class="kw"><a name="Open Context Menu"></a>Open Context Menu</td>
|
@@ -1459,6 +1509,48 @@ <h2>Keywords</h2>
|
1459 | 1509 | </tr>
|
1460 | 1510 | </table></td>
|
1461 | 1511 | </tr>
|
| 1512 | +<tr> |
| 1513 | + <td class="kw"><a name="Set Browser Implicit Wait"></a>Set Browser Implicit Wait</td> |
| 1514 | + <td class="arg">seconds</td> |
| 1515 | + <td class="doc">Sets current browser's implicit wait in seconds. |
| 1516 | + |
| 1517 | +From selenium 2 function 'Sets a sticky timeout to implicitly wait for an element to be found, or a command to complete. This method only needs to be called one time per session.' |
| 1518 | + |
| 1519 | +Example: |
| 1520 | +<table border="1" class="doc"> |
| 1521 | +<tr> |
| 1522 | +<td>Set Browser Implicit Wait</td> |
| 1523 | +<td>10 seconds</td> |
| 1524 | +</tr> |
| 1525 | +</table> |
| 1526 | +See also <a href="#Set Selenium Implicit Wait" class="name">Set Selenium Implicit Wait</a>.</td> |
| 1527 | +</tr> |
| 1528 | +<tr> |
| 1529 | + <td class="kw"><a name="Set Selenium Implicit Wait"></a>Set Selenium Implicit Wait</td> |
| 1530 | + <td class="arg">seconds</td> |
| 1531 | + <td class="doc">Sets Selenium 2's default implicit wait in seconds and sets the implicit wait for all open browsers. |
| 1532 | + |
| 1533 | +From selenium 2 function 'Sets a sticky timeout to implicitly wait for an element to be found, or a command to complete. This method only needs to be called one time per session.' |
| 1534 | + |
| 1535 | +Example: |
| 1536 | +<table border="1" class="doc"> |
| 1537 | +<tr> |
| 1538 | +<td>${orig wait} =</td> |
| 1539 | +<td>Set Selenium Implicit Wait</td> |
| 1540 | +<td>10 seconds</td> |
| 1541 | +</tr> |
| 1542 | +<tr> |
| 1543 | +<td>Perform AJAX call that is slow</td> |
| 1544 | +<td></td> |
| 1545 | +<td></td> |
| 1546 | +</tr> |
| 1547 | +<tr> |
| 1548 | +<td>Set Selenium Implicit Wait</td> |
| 1549 | +<td>${orig wait}</td> |
| 1550 | +<td></td> |
| 1551 | +</tr> |
| 1552 | +</table></td> |
| 1553 | +</tr> |
1462 | 1554 | <tr>
|
1463 | 1555 | <td class="kw"><a name="Set Selenium Speed"></a>Set Selenium Speed</td>
|
1464 | 1556 | <td class="arg">seconds</td>
|
@@ -1768,9 +1860,9 @@ <h2>Keywords</h2>
|
1768 | 1860 | </tr>
|
1769 | 1861 | </table>
|
1770 | 1862 | <p id="footer">
|
1771 |
| -Altogether 122 keywords.<br /> |
| 1863 | +Altogether 126 keywords.<br /> |
1772 | 1864 | Generated by <a href="http://code.google.com/p/robotframework/wiki/LibraryDocumentationTool">libdoc.py</a>
|
1773 |
| -on 2011-10-26 16:47:19. |
| 1865 | +on 2012-03-09 22:02:58. |
1774 | 1866 | </p>
|
1775 | 1867 | </body>
|
1776 | 1868 | </html>
|
0 commit comments