This repository was archived by the owner on Aug 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathSeleniumLibrary.html
More file actions
1667 lines (1662 loc) · 86.1 KB
/
Copy pathSeleniumLibrary.html
File metadata and controls
1667 lines (1662 loc) · 86.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>SeleniumLibrary</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style media="all" type="text/css">
body {
background: white;
color: black;
font-size: small;
font-family: sans-serif;
padding: 0.1em 0.5em;
}
a.name, span.name {
font-style: italic;
}
a, a:link, a:visited {
color: #c30;
}
a:hover, a:active {
text-decoration: underline;
color: black;
}
div.shortcuts {
margin: 1em 0em;
font-size: 0.9em;
}
div.shortcuts a {
text-decoration: none;
color: black;
}
div.shortcuts a:hover {
text-decoration: underline;
}
table.keywords {
border: 2px solid black;
border-collapse: collapse;
empty-cells: show;
margin: 0.3em 0em;
width: 100%;
}
table.keywords th, table.keywords td {
border: 2px solid black;
padding: 0.2em;
vertical-align: top;
}
table.keywords th {
background: #bbb;
color: black;
}
table.keywords td.kw {
width: 150px;
font-weight: bold;
}
table.keywords td.arg {
width: 300px;
font-style: italic;
}
table.doc {
border: 1px solid black;
background: transparent;
border-collapse: collapse;
empty-cells: show;
font-size: 0.85em;
}
table.doc td {
border: 1px solid black;
padding: 0.1em 0.3em;
height: 1.2em;
}
#footer {
font-size: 0.9em;
}
</style>
<style media="print" type="text/css">
body {
margin: 0px 1px;
padding: 0px;
font-size: 10px;
}
a {
text-decoration: none;
}
</style>
</head>
<body>
<h1>SeleniumLibrary</h1>
<b>Version:</b> 2.3-SNAPSHOT<br>
<b>Scope:</b> global</p>
<h2 id="introduction">Introduction</h2>
<p>SeleniumLibrary is a web testing library for Robot Test Automation Framework.<br />
<br />
It uses the Selenium Remote Control tool internally to control a web browser. See <a href="http://selenium-rc.openqa.org/">http://selenium-rc.openqa.org/</a> for more information on Selenium tool.<br />
<br />
SeleniumLibrary runs tests in a real browser instance. It should work in most modern browsers and can be used with both Python and Jython interpreters.<br />
<br />
<b>Before running the tests</b><br />
<br />
Prior to running test cases using SeleniumLibrary, the Selenium Server must be started. This can be done using keyword <a href="#Start Selenium Server" class="name">Start Selenium Server</a> or from the command line by using command: <span class="name">java -jar /path/to/selenium-server.jar</span>. The Selenium Server is included in the SeleniumLibrary distribution and can be found under <span class="name">[PythonLibs]/site-packages/SeleniumLibrary/lib</span>. Additionally, <a href="#Open Browser" class="name">Open Browser</a> keyword must be used in order to open browser in the desired location before any other keyword from the library may be used.<br />
<br />
<b>Locating elements</b><br />
<br />
To do operations on elements, elements have to be identified. The most common way of doing this is by searching the values of key attributes of an element type. All keywords that operate on elements document the key attributes for that element type. If the given <span class="name">locator</span> argument matches the value of any key attribute, the element is found.<br />
<br />
Asterisk character may be used as a wildcard in locators, but it only works as the last character of the expression. In the middle of the locator it is interpreted as literal '*'.<br />
<br />
It is also possible to give an arbitrary XPath or DOM expression as <span class="name">locator</span>. In this case, the expression must be prefixed with either 'xpath=' or 'dom='.<br />
<br />
Examples:<br />
<table border="1" class="doc">
<tr>
<td>Click Link</td>
<td>my link</td>
<td># Matches if either link text or value of attribute 'id', 'name' or 'href' equals 'my link'</td>
</tr>
<tr>
<td>Page Should Contain Link</td>
<td>Link id *</td>
<td># Passes if the page contain any link starting with 'Link id'</td>
</tr>
<tr>
<td>Select Checkbox</td>
<td>xpath=//table[0]/input[@name='my_checkbox']</td>
<td># Using XPath</td>
</tr>
<tr>
<td>Click Image</td>
<td>dom=document.images[56]</td>
<td># Using a DOM expression</td>
</tr>
</table>
<br />
All table related keywords (<a href="#Table Should Contain" class="name">Table Should Contain</a>, etc.) allow to identity a table either by the id of the table element, or by a css locator. Both of the following examples work. It's not possible to use an xpath or dom expression, since the table keywords use a css locator internally.<br />
<br />
Table Examples:<br />
<table border="1" class="doc">
<tr>
<td>Table Should Contain</td>
<td>tableID</td>
<td>$ 43,00</td>
</tr>
<tr>
<td>Table Should Contain</td>
<td>css=h2.someClass ~ table:last-child()</td>
<td>text</td>
</tr>
</table>
<br />
<b>Handling page load events</b><br />
<br />
Some keywords that may cause a page to load take an additional argument <span class="name">dont_wait</span> that is used to determine whether a new page is expected to load or not. By default, a page load is expected to happen whenever a link or image is clicked, or a form submitted. If a page load does not happen (if the link only executes some JavaScript, for example), a non-empty value must be given to <span class="name">dont_wait</span> argument.<br />
<br />
There are also some keywords that may cause a page to load but by default we expect them not to. In these case, the keywords have an optional <span class="name">wait</span> argument, and providing a non-empty value for it will cause the keyword to Examples:<br />
<br />
<table border="1" class="doc">
<tr>
<td>Click Link</td>
<td>link text</td>
<td></td>
<td></td>
<td># A page is expected to load.</td>
</tr>
<tr>
<td>Click Link</td>
<td>another link</td>
<td>don't wait</td>
<td></td>
<td># A page is not expected to load.</td>
</tr>
<tr>
<td>Select Radio Button</td>
<td>group1</td>
<td>value1</td>
<td></td>
<td># A page is not expected to load.</td>
</tr>
<tr>
<td>Select Radio Button</td>
<td>group2</td>
<td>value2</td>
<td>and wait</td>
<td># A page is expected to load.</td>
</tr>
</table>
<br />
<b>Testing sites using https</b><br />
<br />
Usually, https works out of the box. However, there may be trouble with self-signed certificates. We have a Wiki page describing how to test against these, using Firefox: <a href="http://code.google.com/p/robotframework-seleniumlibrary/wiki/HandlingSelfSignedCertificates">http://code.google.com/p/robotframework-seleniumlibrary/wiki/HandlingSelfSignedCertificates</a></p>
<h2 id="importing">Importing</h2>
<table border="1" class="keywords">
<tr>
<th class="arg">Arguments</th>
<th class="doc">Documentation</th>
</tr>
<tr>
<td class="arg">timeout=5.0, server_host=localhost, server_port=4444, jar_path=None</td>
<td class="doc">SeleniumLibrary can be imported with optional arguments.<br />
<br />
<span class="name">timeout</span> is the default timeout used to wait for page load actions. It can be later set with <a href="#Set Selenium Timeout" class="name">Set Selenium Timeout</a><br />
<br />
<span class="name">host</span> and <span class="name">port</span> are used to connect to Selenium Server. Browsers opened with this SeleniumLibrary instance will be attached to that server. Note that the Selenium Server must be running before <a href="#Open Browser" class="name">Open Browser</a> keyword can be used. Selenium Server can be started with keyword <a href="#Start Selenium Server" class="name">Start Selenium Server</a>.<br />
<br />
<span class="name">jar_path</span> is the absolute path to the selenium-server.jar file to be used by the library. If set, a custom, modified version can be started instead of the default one distributed with the library.<br />
<br />
Examples:<br />
<table border="1" class="doc">
<tr>
<td>Library</td>
<td>SeleniumLibrary</td>
<td>15</td>
<td></td>
<td></td>
<td># Sets default timeout</td>
</tr>
<tr>
<td>Library</td>
<td>SeleniumLibrary</td>
<td></td>
<td></td>
<td>4455</td>
<td># Use default timeout and host but specify different port.</td>
</tr>
</table>
</td>
</tr>
</table>
<h2>Shortcuts</h2>
<div class='shortcuts'>
<a href="#Add Location Strategy" title="Adds a custom location strategy.">Add Location Strategy</a>
·
<a href="#Alert Should Be Present" title="Verifies an alert is present and dismisses it.">Alert Should Be Present</a>
·
<a href="#Call Selenium Api" title="Calls a method in the Selenium remote control API directly.">Call Selenium Api</a>
·
<a href="#Capture Page Screenshot" title="Takes a screenshot of the current page and embeds it into the log.">Capture Page Screenshot</a>
·
<a href="#Capture Screenshot" title="Takes a screenshot of the entire screen and embeds it into the log.">Capture Screenshot</a>
·
<a href="#Checkbox Should Be Selected" title="Verifies checkbox identified by `locator` is selected/checked.">Checkbox Should Be Selected</a>
·
<a href="#Checkbox Should Not Be Selected" title="Verifies checkbox identified by `locator` is not selected/checked.">Checkbox Should Not Be Selected</a>
·
<a href="#Choose Cancel On Next Confirmation" title="Cancel will be selected the next time `Confirm Action` is used.">Choose Cancel On Next Confirmation</a>
·
<a href="#Choose File" title="Inputs the `file_path` into file input field found by `identifier`.">Choose File</a>
·
<a href="#Click Button" title="Clicks a button identified by `locator`.">Click Button</a>
·
<a href="#Click Element" title="Click element identified by `locator`.">Click Element</a>
·
<a href="#Click Image" title="Clicks an image found by `locator`.">Click Image</a>
·
<a href="#Click Link" title="Clicks a link identified by locator.">Click Link</a>
·
<a href="#Close All Browsers" title="Closes all open browsers and empties the connection cache.">Close All Browsers</a>
·
<a href="#Close Browser" title="Closes the current browser.">Close Browser</a>
·
<a href="#Close Window" title="Closes currently opened pop-up window.">Close Window</a>
·
<a href="#Confirm Action" title="Dismisses currently shown confirmation dialog.">Confirm Action</a>
·
<a href="#Current Frame Contains" title="Verifies that current page contains `text`.">Current Frame Contains</a>
·
<a href="#Current Frame Should Contain" title="Verifies that current page contains `text`.">Current Frame Should Contain</a>
·
<a href="#Delete All Cookies" title="Deletes all cookies by calling `Delete Cookie` repeatedly.">Delete All Cookies</a>
·
<a href="#Delete Cookie" title="Deletes cookie matching `name` and `options`.">Delete Cookie</a>
·
<a href="#Drag And Drop" title="Drags element identified with `locator` by `movement`">Drag And Drop</a>
·
<a href="#Element Should Contain" title="Verifies element identified by `locator` contains text `expected`.">Element Should Contain</a>
·
<a href="#Execute Javascript" title="Executes the given JavaScript code.">Execute Javascript</a>
·
<a href="#Focus" title="Sets focus to element identified by `locator`.">Focus</a>
·
<a href="#Frame Should Contain" title="Verifies frame identified by `locator` contains `text`.">Frame Should Contain</a>
·
<a href="#Frame Should Contain Text" title="Verifies frame identified by `locator` contains `text`.">Frame Should Contain Text</a>
·
<a href="#Get Alert Message" title="Returns the text of current JavaScript alert.">Get Alert Message</a>
·
<a href="#Get All Links" title="Returns a list containing ids of all links found in current page.">Get All Links</a>
·
<a href="#Get Cookie Value" title="Returns value of cookie found with `name`.">Get Cookie Value</a>
·
<a href="#Get Cookies" title="Returns all cookies of the current page.">Get Cookies</a>
·
<a href="#Get Element Attribute" title="Return value of element attribute.">Get Element Attribute</a>
·
<a href="#Get Horizontal Position" title="Returns horizontal position of element identified by `locator`.">Get Horizontal Position</a>
·
<a href="#Get Location" title="Returns the current location.">Get Location</a>
·
<a href="#Get Matching Xpath Count" title="Returns number of elements matching `xpath`">Get Matching Xpath Count</a>
·
<a href="#Get Source" title="Returns the entire html source of the current page or frame.">Get Source</a>
·
<a href="#Get Table Cell" title="Returns the content from a table cell.">Get Table Cell</a>
·
<a href="#Get Text" title="Returns the text of element identified by `locator`.">Get Text</a>
·
<a href="#Get Title" title="Returns title of current page.">Get Title</a>
·
<a href="#Get Value" title="Returns the value attribute of element identified by `locator`.">Get Value</a>
·
<a href="#Get Vertical Position" title="Returns vertical position of element identified by `locator`.">Get Vertical Position</a>
·
<a href="#Get Window Identifiers" title="Returns values of id attributes of all windows known to the browser.">Get Window Identifiers</a>
·
<a href="#Get Window Names" title="Returns names of all windows known to the browser.">Get Window Names</a>
·
<a href="#Get Window Titles" title="Returns titles of all windows known to the browser.">Get Window Titles</a>
·
<a href="#Go Back" title="Simulates the user clicking the "back" button on their browser.">Go Back</a>
·
<a href="#Go To" title="Navigates the active browser instance to the provided URL.">Go To</a>
·
<a href="#Input Password" title="Types the given password into text field identified by `locator`.">Input Password</a>
·
<a href="#Input Text" title="Types the given `text` into text field identified by `locator`.">Input Text</a>
·
<a href="#List Selection Should Be" title="Verifies the selection of list identified by `locator` is exactly `*values`.">List Selection Should Be</a>
·
<a href="#List Should Have No Selections" title="Verifies list identified by `locator` has no selections.">List Should Have No Selections</a>
·
<a href="#Location Should Be" title="Verifies that current URL is exactly `url`.">Location Should Be</a>
·
<a href="#Location Should Contain" title="Verifies that current URL contains `expected`.">Location Should Contain</a>
·
<a href="#Log Source" title="Logs and returns the entire html source of the current page or frame.">Log Source</a>
·
<a href="#Maximize Browser Window" title="Maximizes current browser window.">Maximize Browser Window</a>
·
<a href="#Mouse Down On Image" title="Simulates a mouse down event on an image.">Mouse Down On Image</a>
·
<a href="#Mouse Down On Link" title="Simulates a mouse down event on a link.">Mouse Down On Link</a>
·
<a href="#Open Browser" title="Opens a new browser instance to given url.">Open Browser</a>
·
<a href="#Open Context Menu" title="Opens context menu on element identified by `locator`.">Open Context Menu</a>
·
<a href="#Page Should Contain" title="Verifies that current page contains `text`.">Page Should Contain</a>
·
<a href="#Page Should Contain Button" title="Verifies button identified by `locator` is found from current page.">Page Should Contain Button</a>
·
<a href="#Page Should Contain Checkbox" title="Verifies checkbox identified by `locator` is found from current page.">Page Should Contain Checkbox</a>
·
<a href="#Page Should Contain Element" title="Verifies element identified by `locator` is found from current page.">Page Should Contain Element</a>
·
<a href="#Page Should Contain Image" title="Verifies image identified by `locator` is found from current page.">Page Should Contain Image</a>
·
<a href="#Page Should Contain Link" title="Verifies link identified by `locator` is found from current page.">Page Should Contain Link</a>
·
<a href="#Page Should Contain List" title="Verifies list identified by `locator` is found from current page.">Page Should Contain List</a>
·
<a href="#Page Should Contain Radio Button" title="Verifies radio button identified by `locator` is found from current page.">Page Should Contain Radio Button</a>
·
<a href="#Page Should Contain Textfield" title="Verifies text field identified by `locator` is found from current page.">Page Should Contain Textfield</a>
·
<a href="#Page Should Not Contain" title="Verifies the current page does not contain `text`.">Page Should Not Contain</a>
·
<a href="#Page Should Not Contain Button" title="Verifies button identified by `locator` is not found from current page.">Page Should Not Contain Button</a>
·
<a href="#Page Should Not Contain Checkbox" title="Verifies checkbox identified by `locator` is not found from current page.">Page Should Not Contain Checkbox</a>
·
<a href="#Page Should Not Contain Element" title="Verifies element identified by `locator` is not found from current page.">Page Should Not Contain Element</a>
·
<a href="#Page Should Not Contain Image" title="Verifies image identified by `locator` is not found from current page.">Page Should Not Contain Image</a>
·
<a href="#Page Should Not Contain Link" title="Verifies link identified by `locator` is not found from current page.">Page Should Not Contain Link</a>
·
<a href="#Page Should Not Contain List" title="Verifies list identified by `locator` is not found from current page.">Page Should Not Contain List</a>
·
<a href="#Page Should Not Contain Radio Button" title="Verifies radio button identified by `locator` is not found from current page.">Page Should Not Contain Radio Button</a>
·
<a href="#Page Should Not Contain Textfield" title="Verifies text field identified by `locator` is not found from current page.">Page Should Not Contain Textfield</a>
·
<a href="#Press Key" title="Simulates user pressing key on element identified by `locator`.">Press Key</a>
·
<a href="#Press Key Native" title="Simulates user pressing key by sending an operating system keystroke.">Press Key Native</a>
·
<a href="#Radio Button Should Be Set To" title="Verifies radio button group identified by `group_name` has its selection set to `value`.">Radio Button Should Be Set To</a>
·
<a href="#Radio Button Should Not Be Selected" title="Verifies radio button group identified by `group_name` has no selection.">Radio Button Should Not Be Selected</a>
·
<a href="#Select All From List" title="Selects all values from multi-select list identified by `id`.">Select All From List</a>
·
<a href="#Select Checkbox" title="Selects checkbox identified by `locator`.">Select Checkbox</a>
·
<a href="#Select Frame" title="Sets frame identified by `locator` as current frame.">Select Frame</a>
·
<a href="#Select From List" title="Selects `*values` from list identified by `locator`">Select From List</a>
·
<a href="#Select Radio Button" title="Sets selection of radio button group identified by `group_name` to `value`.">Select Radio Button</a>
·
<a href="#Select Window" title="Selects the window found with `windowID` as the context of actions.">Select Window</a>
·
<a href="#Set Selenium Speed" title="Sets the delay that is waited after each Selenium command.">Set Selenium Speed</a>
·
<a href="#Set Selenium Timeout" title="Sets the timeout used by various keywords.">Set Selenium Timeout</a>
·
<a href="#Simulate" title="Simulates `event` on component identified by `locator`.">Simulate</a>
·
<a href="#Start Selenium Server" title="Starts the Selenium Server provided with SeleniumLibrary.">Start Selenium Server</a>
·
<a href="#Stop Selenium Server" title="Stops the selenium server (and closes all browsers).">Stop Selenium Server</a>
·
<a href="#Submit Form" title="Submits a form identified by `locator`.">Submit Form</a>
·
<a href="#Switch Browser" title="Switches between active browsers using index or alias.">Switch Browser</a>
·
<a href="#Table Cell Should Contain" title="Verifies that a certain cell in a table contains the `expected content`.">Table Cell Should Contain</a>
·
<a href="#Table Column Should Contain" title="Verifies that a specific column contains the `expected_content`.">Table Column Should Contain</a>
·
<a href="#Table Footer Should Contain" title="Verifies that the table footer contains the `expected_content`.">Table Footer Should Contain</a>
·
<a href="#Table Header Should Contain" title="Verifies that the table header, i.e. any <th>...</th> element, contains the `expected_content`.">Table Header Should Contain</a>
·
<a href="#Table Row Should Contain" title="Verifies that a specific table row contains the `expected_content`.">Table Row Should Contain</a>
·
<a href="#Table Should Contain" title="Verifies that the `expected content` can be found somewhere in the table.">Table Should Contain</a>
·
<a href="#Text Field Should Contain" title="Verifies text field identified by `locator` contains text `expected`.">Text Field Should Contain</a>
·
<a href="#Textfield Value Should Be" title="Verifies the value in text field identified by `locator` is exactly `expected`.">Textfield Value Should Be</a>
·
<a href="#Title Should Be" title="Verifies that current page title equals `title`.">Title Should Be</a>
·
<a href="#Unselect Checkbox" title="Removes selection of checkbox identified by `locator`.">Unselect Checkbox</a>
·
<a href="#Unselect Frame" title="Sets the top frame as the current frame.">Unselect Frame</a>
·
<a href="#Unselect From List" title="Unselects given values from list identified by locator.">Unselect From List</a>
·
<a href="#Wait For Condition" title="Waits either for given condition to be true or until timeout expires.">Wait For Condition</a>
·
<a href="#Wait Until Page Contains" title="Waits until `text` appears on current page or `timeout` expires.">Wait Until Page Contains</a>
·
<a href="#Wait Until Page Contains Element" title="Waits until element specified with `locator` appears on current page or `timeout` expires.">Wait Until Page Contains Element</a>
</div>
<h2>Keywords</h2>
<table border="1" class="keywords">
<tr>
<th class="kw">Keyword</th>
<th class="arg">Arguments</th>
<th class="doc">Documentation</th>
</tr>
<tr>
<td class="kw"><a name="Add Location Strategy"></a>Add Location Strategy</td>
<td class="arg">strategy_name, function_definition</td>
<td class="doc">Adds a custom location strategy.<br />
<br />
<span class="name">strategy_name</span> is the name of the strategy; a prefix used when addressing an element.<br />
<br />
<span class="name">function_definition</span> is the JavaScript that will be called. It must return a DOM reference, an array with DOM references, or null.<br />
<br />
Together with the modified selenium-server.jar it can provide a new method of locating elements on the page. For example, a jQuery strategy can be added to locate elements given jQuery selector syntax.<br />
<br />
For jQuery selector setup see: <a href="http://code.google.com/p/robotframework-seleniumlibrary/wiki/jQueryElementSelectors">http://code.google.com/p/robotframework-seleniumlibrary/wiki/jQueryElementSelectors</a><br />
<br />
Examples:<br />
<table border="1" class="doc">
<tr>
<td>${func} =</td>
<td>return Selenium.prototype.locateElementByJQuerySelector(locator, inDocument, inWindow);</td>
<td></td>
</tr>
<tr>
<td>Add Location Strategy</td>
<td>jquery</td>
<td>${func}</td>
</tr>
<tr>
<td>Page Should Contain Element</td>
<td>jquery=div.#data-table</td>
<td></td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="kw"><a name="Alert Should Be Present"></a>Alert Should Be Present</td>
<td class="arg">text=</td>
<td class="doc">Verifies an alert is present and dismisses it.<br />
<br />
If <span class="name">text</span> is a non-empty string, then it is also verified that the message of the alert equals to <span class="name">text</span>.<br />
<br />
Will fail if no alert is present. Note that when running tests with selenium, the alerts will not be visible in the browser. Nevertheless, following keywords will fail unless the alert is dismissed by this keyword or by <a href="#Get Alert Message" class="name">Get Alert Message</a>.</td>
</tr>
<tr>
<td class="kw"><a name="Call Selenium Api"></a>Call Selenium Api</td>
<td class="arg">method_name, *args</td>
<td class="doc">Calls a method in the Selenium remote control API directly.<br />
<br />
This keyword can be used if some functionality provided by Selenium is not yet exposed as a keyword.<br />
<br />
<span class="name">method_name</span> is the name of the method to call in the Selenium API and <span class="name">args</span> specify the arguments it expects.<br />
<br />
The keyword first tries to find a method in Selenium's Python API provided by the <span class="name">selenium.py</span> file. If no matching method is found, the keyword calls the Selenium Server's Remote Controller API directly via the <span class="name">do_command</span> method in the Python API [1]. In both cases the keyword returns the return value of the call directly without any modifications or verifications.<br />
<br />
Examples:<br />
<table border="1" class="doc">
<tr>
<td>${ret} =</td>
<td>Call Selenium API</td>
<td>is_element_present</td>
<td># Python API</td>
</tr>
<tr>
<td>Call Selenium API</td>
<td>double_click</td>
<td>element_id</td>
<td># Python API</td>
</tr>
<tr>
<td>Call Selenium API</td>
<td>doubleClick</td>
<td>element_id</td>
<td># RC API</td>
</tr>
</table>
<br />
[1] <a href="http://release.seleniumhq.org/selenium-remote-control/1.0-beta-2/doc/python/">http://release.seleniumhq.org/selenium-remote-control/1.0-beta-2/doc/python/</a></td>
</tr>
<tr>
<td class="kw"><a name="Capture Page Screenshot"></a>Capture Page Screenshot</td>
<td class="arg">filename=None, css=background=#CCFFDD</td>
<td class="doc">Takes a screenshot of the current page and embeds it into the log.<br />
<br />
<span class="name">filename</span> argument specifies the name of the file to write the screenshot into. It works the same was as with <a href="#Capture Screenshot" class="name">Capture Screenshot</a>.<br />
<br />
<span class="name">css</span> can be used to modify how the screenshot is taken. By default the bakground color is changed to avoid possible problems with background leaking when the page layout is somehow broken.<br />
<br />
Selenium currently supports this keyword out-of-the-box only with Firefox browser. To make it work with IE, you can start the Selenium Server with <span class="name">-singleWindow</span> option and use <span class="name">*ieproxy</span> as the browser. Additionally, the browser independent <a href="#Capture Screenshot" class="name">Capture Screenshot</a> keyword can be used instead.<br />
<br />
This keyword was added in SeleniumLibrary 2.3.</td>
</tr>
<tr>
<td class="kw"><a name="Capture Screenshot"></a>Capture Screenshot</td>
<td class="arg">filename=None</td>
<td class="doc">Takes a screenshot of the entire screen and embeds it into the log.<br />
<br />
If no <span class="name">filename</span> is given, the screenshot is saved into file <span class="name">selenium-screenshot-<counter>.png</span> under the directory where the Robot Framework log file is written into. The <span class="name">filename</span> is also considered relative to the same directory, if it is not given in absolute format.<br />
<br />
When running on a locked Windows machine, the resulting screenshots will be all black. A workaround is using the <a href="#Capture Page Screenshot" class="name">Capture Page Screenshot</a> keyword instead.<br />
<br />
There were some changes to this keyword in the 2.3 release:<br />
- Possibility to take screenshots also when the Selenium Server is running on a remote machine was added.<br />
- Support for absolute <span class="name">filename</span> paths was added.<br />
- Automatic creation of intermediate directories in the path where the screenshot is saved was removed. <span class="name">OperatingSystem.Create Directory</span> can be used instead.</td>
</tr>
<tr>
<td class="kw"><a name="Checkbox Should Be Selected"></a>Checkbox Should Be Selected</td>
<td class="arg">locator</td>
<td class="doc">Verifies checkbox identified by <span class="name">locator</span> is selected/checked.<br />
<br />
Key attributes for checkboxes 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>
</tr>
<tr>
<td class="kw"><a name="Checkbox Should Not Be Selected"></a>Checkbox Should Not Be Selected</td>
<td class="arg">locator</td>
<td class="doc">Verifies checkbox identified by <span class="name">locator</span> is not selected/checked.<br />
<br />
Key attributes for checkboxes 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>
</tr>
<tr>
<td class="kw"><a name="Choose Cancel On Next Confirmation"></a>Choose Cancel On Next Confirmation</td>
<td class="arg"></td>
<td class="doc">Cancel will be selected the next time <a href="#Confirm Action" class="name">Confirm Action</a> is used.</td>
</tr>
<tr>
<td class="kw"><a name="Choose File"></a>Choose File</td>
<td class="arg">identifier, file_path</td>
<td class="doc">Inputs the <span class="name">file_path</span> into file input field found by <span class="name">identifier</span>.<br />
<br />
This keyword is most often used to input files into upload forms. In normal usage the file specified with <span class="name">file_path</span> must be available on the samme host where the Selenium Server is running.<br />
<br />
An alternative usage is specifying the <span class="name">file_path</span> with an URL (starting with <span class="name">http://</span> or <span class="name">https://</span>) in which case the file will be downloaded automatically. The limitations of this method are that it only works on Firefox and the file must be placed at the root level of a web server.<br />
<br />
Example:<br />
<table border="1" class="doc">
<tr>
<td>Choose File</td>
<td>my_upload_field</td>
<td>/home/user/files/trades.csv</td>
</tr>
<tr>
<td>Choose File</td>
<td>my_upload_field</td>
<td><a href="http://uploadhost.com/trades.csv">http://uploadhost.com/trades.csv</a></td>
</tr>
</table>
<br />
The support for remote files was added in SeleniumLibrary 2.3.2. It uses Selenium's <span class="name">attach_file</span> method which is explained at <a href="http://saucelabs.com/blog/index.php/2009/11/selenium-tip-of-the-week-upload-files-on-browsers-running-over-remote-machines/">http://saucelabs.com/blog/index.php/2009/11/selenium-tip-of-the-week-upload-files-on-browsers-running-over-remote-machines/</a></td>
</tr>
<tr>
<td class="kw"><a name="Click Button"></a>Click Button</td>
<td class="arg">locator, dont_wait=</td>
<td class="doc">Clicks a button identified by <span class="name">locator</span>.<br />
<br />
Key attributes for buttons are <span class="name">id</span>, <span class="name">name</span> and <span class="name">value</span>. See <a href="#introduction" class="name">introduction</a> for details about locating elements and about meaning of <span class="name">dont_wait</span> argument.</td>
</tr>
<tr>
<td class="kw"><a name="Click Element"></a>Click Element</td>
<td class="arg">locator, dont_wait=</td>
<td class="doc">Click element identified by <span class="name">locator</span>.<br />
<br />
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 and about meaning of <span class="name">dont_wait</span> argument.</td>
</tr>
<tr>
<td class="kw"><a name="Click Image"></a>Click Image</td>
<td class="arg">locator, dont_wait=</td>
<td class="doc">Clicks an image found by <span class="name">locator</span>.<br />
<br />
Key attributes for images are <span class="name">id</span>, <span class="name">src</span> and <span class="name">alt</span>. See <a href="#introduction" class="name">introduction</a> for details about locating elements and about meaning of <span class="name">dont_wait</span> argument.</td>
</tr>
<tr>
<td class="kw"><a name="Click Link"></a>Click Link</td>
<td class="arg">locator, dont_wait=</td>
<td class="doc">Clicks a link identified by locator.<br />
<br />
Key attributes for links are <span class="name">id</span>, <span class="name">name</span>, <span class="name">href</span> and link text. See <a href="#introduction" class="name">introduction</a> for details about locating elements and about meaning of <span class="name">dont_wait</span> argument.</td>
</tr>
<tr>
<td class="kw"><a name="Close All Browsers"></a>Close All Browsers</td>
<td class="arg"></td>
<td class="doc">Closes all open browsers and empties the connection cache.<br />
<br />
After this keyword new indexes get from Open Browser keyword are reset to 1.<br />
<br />
This keyword should be used in test or suite teardown to make sure all browsers are closed.</td>
</tr>
<tr>
<td class="kw"><a name="Close Browser"></a>Close Browser</td>
<td class="arg"></td>
<td class="doc">Closes the current browser.</td>
</tr>
<tr>
<td class="kw"><a name="Close Window"></a>Close Window</td>
<td class="arg"></td>
<td class="doc">Closes currently opened pop-up window.</td>
</tr>
<tr>
<td class="kw"><a name="Confirm Action"></a>Confirm Action</td>
<td class="arg"></td>
<td class="doc">Dismisses currently shown confirmation dialog.<br />
<br />
By default, this keyword chooses 'Ok' option from the dialog. If 'cancel' needs to be chosen, keyword <a href="#Choose Cancel On Next Confirmation" class="name">Choose Cancel On Next Confirmation</a> must be called before the action that causes the confirmation dialog to be shown.<br />
<br />
Examples:<br />
<br />
<table border="1" class="doc">
<tr>
<td>Click Button</td>
<td>Send</td>
<td># Shows a confirmation dialog</td>
</tr>
<tr>
<td>Choose Confirm</td>
<td></td>
<td># Chooses Ok</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>Choose Cancel On Next Confirmation</td>
<td></td>
<td></td>
</tr>
<tr>
<td>Click Button</td>
<td>Send</td>
<td># Shows a confirmation dialog</td>
</tr>
<tr>
<td>Choose Confirm</td>
<td></td>
<td># Chooses Cancel</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="kw"><a name="Current Frame Contains"></a>Current Frame Contains</td>
<td class="arg">text, level=INFO</td>
<td class="doc">Verifies that current page contains <span class="name">text</span>.<br />
<br />
If this keyword fails, it automatically logs the page source using the log level specified with the optional <span class="name">level</span> argument. This argument was added in SeleniumLibrary 2.3.1.</td>
</tr>
<tr>
<td class="kw"><a name="Current Frame Should Contain"></a>Current Frame Should Contain</td>
<td class="arg">text, level=INFO</td>
<td class="doc">Verifies that current page contains <span class="name">text</span>.<br />
<br />
If this keyword fails, it automatically logs the page source using the log level specified with the optional <span class="name">level</span> argument. This argument was added in SeleniumLibrary 2.3.1.</td>
</tr>
<tr>
<td class="kw"><a name="Delete All Cookies"></a>Delete All Cookies</td>
<td class="arg"></td>
<td class="doc">Deletes all cookies by calling <a href="#Delete Cookie" class="name">Delete Cookie</a> repeatedly.</td>
</tr>
<tr>
<td class="kw"><a name="Delete Cookie"></a>Delete Cookie</td>
<td class="arg">name, options=</td>
<td class="doc">Deletes cookie matching <span class="name">name</span> and <span class="name">options</span>.<br />
<br />
If the cookie is not found, nothing happens.<br />
<br />
<span class="name">options</span> is the options for the cookie as a string. Currently supported options include 'path', 'domain' and 'recurse.' Format for <span class="name">options</span> is "path=/path/, domain=.foo.com, recurse=true". The order of options is irrelevant. Note that specifying a domain that isn't a subset of the current domain will usually fail. Setting <span class="name">recurse=true</span> will cause this keyword to search all sub-domains of current domain with all paths that are subset of current path. This can take a long time.</td>
</tr>
<tr>
<td class="kw"><a name="Drag And Drop"></a>Drag And Drop</td>
<td class="arg">locator, movement</td>
<td class="doc">Drags element identified with <span class="name">locator</span> by <span class="name">movement</span><br />
<br />
`movement is a string in format "+70 -300" interpreted as pixels in relation to elements current position.</td>
</tr>
<tr>
<td class="kw"><a name="Element Should Contain"></a>Element Should Contain</td>
<td class="arg">locator, excepted, message=</td>
<td class="doc">Verifies element identified by <span class="name">locator</span> contains text <span class="name">expected</span>.<br />
<br />
<span class="name">message</span> can be used to override the default error message.<br />
<br />
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>
</tr>
<tr>
<td class="kw"><a name="Execute Javascript"></a>Execute Javascript</td>
<td class="arg">*code</td>
<td class="doc">Executes the given JavaScript code.<br />
<br />
<span class="name">*code</span> may contain multiple statements and the return value of last statement is returned by this keyword.<br />
<br />
<span class="name">*code</span> may be divided in multiple cells in the test data. In that case, the parts are catenated as is with no white space added.<br />
<br />
Note that, by default, the code will be executed in the context of the Selenium object itself, so 'this' will refer to the Selenium object. Use 'window' to refer to the window of your application, e.g. window.document.getElementById('foo')<br />
<br />
Example:<br />
<table border="1" class="doc">
<tr>
<td>Execute JavaScript</td>
<td>window.my_js_function('arg1', 'arg2')</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="kw"><a name="Focus"></a>Focus</td>
<td class="arg">locator</td>
<td class="doc">Sets focus to element identified by <span class="name">locator</span>.<br />
<br />
This is useful for instance to direct native keystrokes to particular element using <a href="#Press Key Native" class="name">Press Key Native</a>.</td>
</tr>
<tr>
<td class="kw"><a name="Frame Should Contain"></a>Frame Should Contain</td>
<td class="arg">locator, text</td>
<td class="doc">Verifies frame identified by <span class="name">locator</span> contains <span class="name">text</span>.<br />
<br />
Key attributes for frames 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>
</tr>
<tr>
<td class="kw"><a name="Frame Should Contain Text"></a>Frame Should Contain Text</td>
<td class="arg">locator, text</td>
<td class="doc">Verifies frame identified by <span class="name">locator</span> contains <span class="name">text</span>.<br />
<br />
Key attributes for frames 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>
</tr>
<tr>
<td class="kw"><a name="Get Alert Message"></a>Get Alert Message</td>
<td class="arg"></td>
<td class="doc">Returns the text of current JavaScript alert.<br />
<br />
This keyword will fail if no alert is present. Note that when running tests with selenium, the alerts will not be visible in the browser. Nevertheless, following keywords will fail unless the alert is dismissed by this keyword or by <a href="#Alert Should Be Present" class="name">Alert Should Be Present</a>.</td>
</tr>
<tr>
<td class="kw"><a name="Get All Links"></a>Get All Links</td>
<td class="arg"></td>
<td class="doc">Returns a list containing ids of all links found in current page.<br />
<br />
If a link has no id, an empty string will be in the list instead.</td>
</tr>
<tr>
<td class="kw"><a name="Get Cookie Value"></a>Get Cookie Value</td>
<td class="arg">name</td>
<td class="doc">Returns value of cookie found with <span class="name">name</span>.<br />
<br />
If no cookie is found with <span class="name">name</span>, this keyword fails.</td>
</tr>
<tr>
<td class="kw"><a name="Get Cookies"></a>Get Cookies</td>
<td class="arg"></td>
<td class="doc">Returns all cookies of the current page.</td>
</tr>
<tr>
<td class="kw"><a name="Get Element Attribute"></a>Get Element Attribute</td>
<td class="arg">attribute_locator</td>
<td class="doc">Return value of element attribute.<br />
<br />
<span class="name">attribute_locator</span> consists of element locator followed by an @ sign and attribute name, for example "element_id@class".</td>
</tr>
<tr>
<td class="kw"><a name="Get Horizontal Position"></a>Get Horizontal Position</td>
<td class="arg">locator</td>
<td class="doc">Returns horizontal position of element identified by <span class="name">locator</span>.<br />
<br />
The position is returned in pixels off the left side of the page, as an integer. Fails if a matching element is not found.<br />
<br />
See also <a href="#Get Vertical Position" class="name">Get Vertical Position</a>.</td>
</tr>
<tr>
<td class="kw"><a name="Get Location"></a>Get Location</td>
<td class="arg"></td>
<td class="doc">Returns the current location.</td>
</tr>
<tr>
<td class="kw"><a name="Get Matching Xpath Count"></a>Get Matching Xpath Count</td>
<td class="arg">xpath</td>
<td class="doc">Returns number of elements matching <span class="name">xpath</span></td>
</tr>
<tr>
<td class="kw"><a name="Get Source"></a>Get Source</td>
<td class="arg"></td>
<td class="doc">Returns the entire html source of the current page or frame.</td>
</tr>
<tr>
<td class="kw"><a name="Get Table Cell"></a>Get Table Cell</td>
<td class="arg">table_locator, row, column</td>
<td class="doc">Returns the content from a table cell.<br />
<br />
Row and Column number start from 1. Header and footer rows are included in the count. This means that also cell content from header or footer rows can be obtained with this keyword. To understand how tables are identified, please take a look at the <a href="#introduction" class="name">introduction</a>.</td>
</tr>
<tr>
<td class="kw"><a name="Get Text"></a>Get Text</td>
<td class="arg">locator</td>
<td class="doc">Returns the text of element identified by <span class="name">locator</span>.<br />
<br />
See <a href="#introduction" class="name">introduction</a> for details about locating elements.</td>
</tr>
<tr>
<td class="kw"><a name="Get Title"></a>Get Title</td>
<td class="arg"></td>
<td class="doc">Returns title of current page.</td>
</tr>
<tr>
<td class="kw"><a name="Get Value"></a>Get Value</td>
<td class="arg">locator</td>
<td class="doc">Returns the value attribute of element identified by <span class="name">locator</span>.<br />
<br />
See <a href="#introduction" class="name">introduction</a> for details about locating elements.</td>
</tr>
<tr>
<td class="kw"><a name="Get Vertical Position"></a>Get Vertical Position</td>
<td class="arg">locator</td>
<td class="doc">Returns vertical position of element identified by <span class="name">locator</span>.<br />
<br />
The position is returned in pixels off the top of the page, as an integer. Fails if a matching element is not found.<br />
<br />
See also <a href="#Get Horizontal Position" class="name">Get Horizontal Position</a>.</td>
</tr>
<tr>
<td class="kw"><a name="Get Window Identifiers"></a>Get Window Identifiers</td>
<td class="arg"></td>
<td class="doc">Returns values of id attributes of all windows known to the browser.</td>
</tr>
<tr>
<td class="kw"><a name="Get Window Names"></a>Get Window Names</td>
<td class="arg"></td>
<td class="doc">Returns names of all windows known to the browser.</td>
</tr>
<tr>
<td class="kw"><a name="Get Window Titles"></a>Get Window Titles</td>
<td class="arg"></td>
<td class="doc">Returns titles of all windows known to the browser.</td>
</tr>
<tr>
<td class="kw"><a name="Go Back"></a>Go Back</td>
<td class="arg">dont_wait=</td>
<td class="doc">Simulates the user clicking the "back" button on their browser.<br />
<br />
See <a href="#introduction" class="name">introduction</a> for details about locating elements and about meaning of <span class="name">dont_wait</span> argument.</td>
</tr>
<tr>
<td class="kw"><a name="Go To"></a>Go To</td>
<td class="arg">url</td>
<td class="doc">Navigates the active browser instance to the provided URL.</td>
</tr>
<tr>
<td class="kw"><a name="Input Password"></a>Input Password</td>
<td class="arg">locator, text</td>
<td class="doc">Types the given password into text field identified by <span class="name">locator</span>.<br />
<br />
Difference between this keyword and <a href="#Input Text" class="name">Input Text</a> is that this keyword does not log the given password. See <a href="#introduction" class="name">introduction</a> for details about locating elements.</td>
</tr>
<tr>
<td class="kw"><a name="Input Text"></a>Input Text</td>
<td class="arg">locator, text</td>
<td class="doc">Types the given <span class="name">text</span> into text field identified by <span class="name">locator</span>.<br />
<br />
See <a href="#introduction" class="name">introduction</a> for details about locating elements.</td>
</tr>
<tr>
<td class="kw"><a name="List Selection Should Be"></a>List Selection Should Be</td>
<td class="arg">locator, *values</td>
<td class="doc">Verifies the selection of list identified by <span class="name">locator</span> is exactly <span class="name">*values</span>.<br />
<br />
If you want to test that no option is selected, simply give no <span class="name">values</span>. Key attributes for list 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>
</tr>
<tr>
<td class="kw"><a name="List Should Have No Selections"></a>List Should Have No Selections</td>
<td class="arg">locator</td>
<td class="doc">Verifies list identified by <span class="name">locator</span> has no selections.<br />
<br />
Key attributes for list are <span class="name">id</span> and <span class="name">name</span>. See <a href="#introduction" class="name">introduction</a> for more details on key attributes and locating elements.</td>
</tr>
<tr>
<td class="kw"><a name="Location Should Be"></a>Location Should Be</td>
<td class="arg">url</td>
<td class="doc">Verifies that current URL is exactly <span class="name">url</span>.</td>
</tr>
<tr>
<td class="kw"><a name="Location Should Contain"></a>Location Should Contain</td>
<td class="arg">expected</td>
<td class="doc">Verifies that current URL contains <span class="name">expected</span>.</td>
</tr>
<tr>
<td class="kw"><a name="Log Source"></a>Log Source</td>
<td class="arg">level=INFO</td>
<td class="doc">Logs and returns the entire html source of the current page or frame.<br />
<br />
<span class="name">level</span> defines the log level. Valid log levels are 'WARN', 'INFO' (the default), 'DEBUG' and 'TRACE'. In case <span class="name">level</span> is invalid, 'INFO' will be used.</td>
</tr>
<tr>
<td class="kw"><a name="Maximize Browser Window"></a>Maximize Browser Window</td>
<td class="arg"></td>
<td class="doc">Maximizes current browser window.</td>
</tr>
<tr>
<td class="kw"><a name="Mouse Down On Image"></a>Mouse Down On Image</td>
<td class="arg">locator</td>
<td class="doc">Simulates a mouse down event on an image.<br />
<br />
Key attributes for images are <span class="name">id</span>, <span class="name">src</span> and <span class="name">alt</span>. See <a href="#introduction" class="name">introduction</a> for details about locating elements.</td>
</tr>
<tr>
<td class="kw"><a name="Mouse Down On Link"></a>Mouse Down On Link</td>
<td class="arg">locator</td>
<td class="doc">Simulates a mouse down event on a link.<br />
<br />
Key attributes for links are <span class="name">id</span>, <span class="name">name</span>, <span class="name">href</span> and link text. See <a href="#introduction" class="name">introduction</a> for details about locating elements.</td>
</tr>
<tr>
<td class="kw"><a name="Open Browser"></a>Open Browser</td>
<td class="arg">url, browser=firefox, alias=None</td>
<td class="doc">Opens a new browser instance to given url.<br />
<br />
Possible already opened connections are cached.<br />
<br />
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.<br />
<br />
Optional alias is a alias for the browser instance and it can be used for switching between browsers similarly as the index. See <a href="#Switch Browser" class="name">Switch Browser</a> for more details about that.<br />
<br />
Possible values for <span class="name">browser</span> are all the values supported by Selenium and some aliases that are defined for convenience. The table below lists all the supported browsers.<br />
<br />
<table border="1" class="doc">
<tr>
<td>*firefox</td>
<td>FireFox</td>
</tr>
<tr>
<td>firefox</td>
<td>FireFox</td>
</tr>
<tr>
<td>ff</td>
<td>FireFox</td>
</tr>
<tr>
<td>*iexplore</td>
<td>Internet Explorer</td>
</tr>
<tr>
<td>ie</td>
<td>Internet Explorer</td>
</tr>
<tr>
<td>internetexplorer</td>
<td>Internet Explorer</td>
</tr>