Subversion-Projekte lars-tiefland.prado

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
<html>
2
<head>
3
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
4
<title>Selenium Reference</title>
5
</head>
6
<body>
7
<h1>Selenium Reference</h1>
8
<h2>Concepts</h2>
9
<p>A <strong>command</strong> is what tells Selenium what to do. Selenium commands come in three 'flavors': <strong>Actions</strong>, <strong>Accessors</strong> and <strong>Assertions</strong>.
10
	Each command call is one line in the test table of the form:</p>
11
<blockquote>
12
<table border="1" class="table">
13
<colgroup>
14
<col width="39%">
15
<col width="33%">
16
<col width="28%">
17
</colgroup>
18
<tbody valign="top">
19
<tr>
20
<td>command</td><td>target</td><td>value</td>
21
</tr>
22
</tbody>
23
</table>
24
</blockquote>
25
<p>
26
<strong>Actions</strong> are commands that generally manipulate the state of the application. They do things like "click this link" and "select that option". If an Action fails, or has an error, the execution of the current test is stopped.</p>
27
<p>Many Actions can be called with the "AndWait" suffix, e.g. "clickAndWait".
28
	This suffix tells Selenium that the action will cause the browser to make a call to the server,
29
	and that Selenium should wait for a new page to load.</p>
30
<p>
31
<strong>Accessors</strong> examine the state of the application and store the results in variables, e.g. "storeTitle".  They are also used to automatically generate Assertions.</p>
32
<p>
33
<strong>Assertions</strong> are like Accessors, but they verify that the state of the application conforms to what is expected. Examples include "make sure the page title is X" and "verify that this checkbox is checked".</p>
34
<p>All Selenium Assertions can be used in 3 modes: "assert", "verify", and "waitFor". For example, you can "assertText", "verifyText" and "waitForText".  When an "assert" fails, the test is aborted. When a "verify" fails, the test will continue execution, logging the failure.  This allows a single "assert" to ensure that the application is on the correct page, followed by a bunch of "verify" assertions to test form field values, labels, etc.</p>
35
<p>"waitFor" commands wait for some condition to become true (which can be useful for testing Ajax applications).
36
	They will succeed immediately if the condition is already true.
37
	However, they will fail and halt the test if the condition does not become true within the current timeout setting
38
	(see the <strong>setTimeout</strong> action below).
39
	</p>
40
<p>
41
<strong>Element Locators</strong> tell Selenium which HTML element a command refers to. Many commands require an Element Locator as the "target" attribute. Examples of Element Locators include "elementId" and "document.forms[0].element". These are described more clearly in the next section.</p>
42
<p>
43
<strong>Patterns</strong> are used for various reasons, e.g. to specify the expected value of an input field, or identify a select option.  Selenium supports various types of pattern, including regular-expressions, all of which are described in more detail below.</p>Defines an object that runs Selenium commands.
44
 
45
<h3>
46
<a name="locators"></a>Element Locators</h3>
47
<p>
48
Element Locators tell Selenium which HTML element a command refers to.
49
The format of a locator is:</p>
50
<blockquote>
51
<em>locatorType</em><strong>=</strong><em>argument</em>
52
</blockquote>
53
<p>
54
We support the following strategies for locating elements:
55
</p>
56
<blockquote>
57
<dl>
58
<dt>
59
<strong>identifier</strong>=<em>id</em>
60
</dt>
61
<dd>Select the element with the specified @id attribute. If no match is
62
found, select the first element whose @name attribute is <em>id</em>.
63
(This is normally the default; see below.)</dd>
64
<dt>
65
<strong>id</strong>=<em>id</em>
66
</dt>
67
<dd>Select the element with the specified @id attribute.</dd>
68
<dt>
69
<strong>name</strong>=<em>name</em>
70
</dt>
71
<dd>Select the first element with the specified @name attribute.</dd>
72
<dd>
73
<ul class="first last simple">
74
<li>username</li>
75
<li>name=username</li>
76
</ul>
77
</dd>
78
<dd>The name may optionally be followed by one or more <em>element-filters</em>, separated from the name by whitespace.  If the <em>filterType</em> is not specified, <strong>value</strong> is assumed.</dd>
79
<dd>
80
<ul class="first last simple">
81
<li>name=flavour value=chocolate</li>
82
</ul>
83
</dd>
84
<dt>
85
<strong>dom</strong>=<em>javascriptExpression</em>
86
</dt>
87
<dd>
88
<dd>Find an element using JavaScript traversal of the HTML Document Object
89
Model. DOM locators <em>must</em> begin with "document.".
90
<ul class="first last simple">
91
<li>dom=document.forms['myForm'].myDropdown</li>
92
<li>dom=document.images[56]</li>
93
</ul>
94
</dd>
95
</dd>
96
<dt>
97
<strong>xpath</strong>=<em>xpathExpression</em>
98
</dt>
99
<dd>Locate an element using an XPath expression.
100
<ul class="first last simple">
101
<li>xpath=//img[@alt='The image alt text']</li>
102
<li>xpath=//table[@id='table1']//tr[4]/td[2]</li>
103
</ul>
104
</dd>
105
<dt>
106
<strong>link</strong>=<em>textPattern</em>
107
</dt>
108
<dd>Select the link (anchor) element which contains text matching the
109
specified <em>pattern</em>.
110
<ul class="first last simple">
111
<li>link=The link text</li>
112
</ul>
113
</dd>
114
<dt>
115
<strong>css</strong>=<em>cssSelectorSyntax</em>
116
</dt>
117
<dd>Select the element using css selectors. Please refer to <a href="http://www.w3.org/TR/REC-CSS2/selector.html">CSS2 selectors</a>, <a href="http://www.w3.org/TR/2001/CR-css3-selectors-20011113/">CSS3 selectors</a> for more information. You can also check the TestCssLocators test in the selenium test suite for an example of usage, which is included in the downloaded selenium core package.
118
<ul class="first last simple">
119
<li>css=a[href="#id3"]</li>
120
<li>css=span#firstChild + span</li>
121
</ul>
122
</dd>
123
<dd>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). </dd>
124
</dl>
125
</blockquote>
126
<p>
127
Without an explicit locator prefix, Selenium uses the following default
128
strategies:
129
</p>
130
<ul class="simple">
131
<li>
132
<strong>dom</strong>, for locators starting with "document."</li>
133
<li>
134
<strong>xpath</strong>, for locators starting with "//"</li>
135
<li>
136
<strong>identifier</strong>, otherwise</li>
137
</ul>
138
<h3>
139
<a name="element-filters">Element Filters</a>
140
</h3>
141
<blockquote>
142
<p>Element filters can be used with a locator to refine a list of candidate elements.  They are currently used only in the 'name' element-locator.</p>
143
<p>Filters look much like locators, ie.</p>
144
<blockquote>
145
<em>filterType</em><strong>=</strong><em>argument</em>
146
</blockquote>
147
<p>Supported element-filters are:</p>
148
<p>
149
<strong>value=</strong><em>valuePattern</em>
150
</p>
151
<blockquote>
152
Matches elements based on their values.  This is particularly useful for refining a list of similarly-named toggle-buttons.</blockquote>
153
<p>
154
<strong>index=</strong><em>index</em>
155
</p>
156
<blockquote>
157
Selects a single element based on its position in the list (offset from zero).</blockquote>
158
</blockquote>
159
<h3>
160
<a name="patterns"></a>String-match Patterns</h3>
161
<p>
162
Various Pattern syntaxes are available for matching string values:
163
</p>
164
<blockquote>
165
<dl>
166
<dt>
167
<strong>glob:</strong><em>pattern</em>
168
</dt>
169
<dd>Match a string against a "glob" (aka "wildmat") pattern. "Glob" is a
170
kind of limited regular-expression syntax typically used in command-line
171
shells. In a glob pattern, "*" represents any sequence of characters, and "?"
172
represents any single character. Glob patterns match against the entire
173
string.</dd>
174
<dt>
175
<strong>regexp:</strong><em>regexp</em>
176
</dt>
177
<dd>Match a string using a regular-expression. The full power of JavaScript
178
regular-expressions is available.</dd>
179
<dt>
180
<strong>exact:</strong><em>string</em>
181
</dt>
182
<dd>Match a string exactly, verbatim, without any of that fancy wildcard
183
stuff.</dd>
184
</dl>
185
</blockquote>
186
<p>
187
If no pattern prefix is specified, Selenium assumes that it's a "glob"
188
pattern.
189
</p>
190
<h2>Selenium Actions</h2>
191
<dl>
192
<dt>
193
<strong><a name="addSelection"></a>addSelection
194
		(
195
			locator,optionLocator
196
		)
197
	</strong>
198
</dt>
199
<dd>Add a selection to the set of selected options in a multi-select element using an option locator.
200
 
201
@see #doSelect for details of option locators<p>Arguments:</p>
202
<ul>
203
<li>locator - an <a href="#locators">element locator</a> identifying a multi-select box</li>
204
<li>optionLocator - an option locator (a label by default)</li>
205
</ul>
206
</dd>
207
<br>
208
<dt>
209
<strong><a name="answerOnNextPrompt"></a>answerOnNextPrompt
210
		(
211
			answer
212
		)
213
	</strong>
214
</dt>
215
<dd>Instructs Selenium to return the specified answer string in response to
216
the next JavaScript prompt [window.prompt()].<p>Arguments:</p>
217
<ul>
218
<li>answer - the answer to give in response to the prompt pop-up</li>
219
</ul>
220
</dd>
221
<br>
222
<dt>
223
<strong><a name="check"></a>check
224
		(
225
			locator
226
		)
227
	</strong>
228
</dt>
229
<dd>Check a toggle-button (checkbox/radio)<p>Arguments:</p>
230
<ul>
231
<li>locator - an <a href="#locators">element locator</a>
232
</li>
233
</ul>
234
</dd>
235
<br>
236
<dt>
237
<strong><a name="chooseCancelOnNextConfirmation"></a>chooseCancelOnNextConfirmation
238
		(
239
 
240
		)
241
	</strong>
242
</dt>
243
<dd>By default, Selenium's overridden window.confirm() function will
244
return true, as if the user had manually clicked OK.  After running
245
this command, the next call to confirm() will return false, as if
246
the user had clicked Cancel.</dd>
247
<br>
248
<dt>
249
<strong><a name="click"></a>click
250
		(
251
			locator
252
		)
253
	</strong>
254
</dt>
255
<dd>Clicks on a link, button, checkbox or radio button. If the click action
256
causes a new page to load (like a link usually does), call
257
waitForPageToLoad.<p>Arguments:</p>
258
<ul>
259
<li>locator - an element locator</li>
260
</ul>
261
</dd>
262
<br>
263
<dt>
264
<strong><a name="clickAt"></a>clickAt
265
		(
266
			locator,coordString
267
		)
268
	</strong>
269
</dt>
270
<dd>Clicks on a link, button, checkbox or radio button. If the click action
271
causes a new page to load (like a link usually does), call
272
waitForPageToLoad.
273
 
274
Beware of http://jira.openqa.org/browse/SEL-280, which will lead some event handlers to
275
get null event arguments.  Read the bug for more details, including a workaround.<p>Arguments:</p>
276
<ul>
277
<li>locator - an element locator</li>
278
<li>coordString - specifies the x,y position (i.e. - 10,20) of the mouse      event relative to the element returned by the locator.</li>
279
</ul>
280
</dd>
281
<br>
282
<dt>
283
<strong><a name="close"></a>close
284
		(
285
 
286
		)
287
	</strong>
288
</dt>
289
<dd>Simulates the user clicking the "close" button in the titlebar of a popup
290
window or tab.</dd>
291
<br>
292
<dt>
293
<strong><a name="createCookie"></a>createCookie
294
		(
295
			nameValuePair,optionsString
296
		)
297
	</strong>
298
</dt>
299
<dd>Create a new cookie whose path and domain are same with those of current page
300
under test, unless you specified a path for this cookie explicitly.<p>Arguments:</p>
301
<ul>
302
<li>nameValuePair - name and value of the cookie in a format "name=value"</li>
303
<li>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.</li>
304
</ul>
305
</dd>
306
<br>
307
<dt>
308
<strong><a name="deleteCookie"></a>deleteCookie
309
		(
310
			name,path
311
		)
312
	</strong>
313
</dt>
314
<dd>Delete a named cookie with specified path.<p>Arguments:</p>
315
<ul>
316
<li>name - the name of the cookie to be deleted</li>
317
<li>path - the path property of the cookie to be deleted</li>
318
</ul>
319
</dd>
320
<br>
321
<dt>
322
<strong><a name="dragdrop"></a>dragdrop
323
		(
324
			locator,movementsString
325
		)
326
	</strong>
327
</dt>
328
<dd>Drags an element a certain distance and then drops it
329
Beware of http://jira.openqa.org/browse/SEL-280, which will lead some event handlers to
330
get null event arguments.  Read the bug for more details, including a workaround.<p>Arguments:</p>
331
<ul>
332
<li>locator - an element locator</li>
333
<li>movementsString - offset in pixels from the current location to which the element should be moved, e.g., "+70,-300"</li>
334
</ul>
335
</dd>
336
<br>
337
<dt>
338
<strong><a name="fireEvent"></a>fireEvent
339
		(
340
			locator,eventName
341
		)
342
	</strong>
343
</dt>
344
<dd>Explicitly simulate an event, to trigger the corresponding "on<em>event</em>"
345
handler.<p>Arguments:</p>
346
<ul>
347
<li>locator - an <a href="#locators">element locator</a>
348
</li>
349
<li>eventName - the event name, e.g. "focus" or "blur"</li>
350
</ul>
351
</dd>
352
<br>
353
<dt>
354
<strong><a name="goBack"></a>goBack
355
		(
356
 
357
		)
358
	</strong>
359
</dt>
360
<dd>Simulates the user clicking the "back" button on their browser.</dd>
361
<br>
362
<dt>
363
<strong><a name="keyDown"></a>keyDown
364
		(
365
			locator,keySequence
366
		)
367
	</strong>
368
</dt>
369
<dd>Simulates a user pressing a key (without releasing it yet).<p>Arguments:</p>
370
<ul>
371
<li>locator - an <a href="#locators">element locator</a>
372
</li>
373
<li>keySequence - Either be a string("\" followed by the numeric keycode  of the key to be pressed, normally the ASCII value of that key), or a single  character. For example: "w", "\119".</li>
374
</ul>
375
</dd>
376
<br>
377
<dt>
378
<strong><a name="keyPress"></a>keyPress
379
		(
380
			locator,keySequence
381
		)
382
	</strong>
383
</dt>
384
<dd>Simulates a user pressing and releasing a key.<p>Arguments:</p>
385
<ul>
386
<li>locator - an <a href="#locators">element locator</a>
387
</li>
388
<li>keySequence - Either be a string("\" followed by the numeric keycode  of the key to be pressed, normally the ASCII value of that key), or a single  character. For example: "w", "\119".</li>
389
</ul>
390
</dd>
391
<br>
392
<dt>
393
<strong><a name="keyUp"></a>keyUp
394
		(
395
			locator,keySequence
396
		)
397
	</strong>
398
</dt>
399
<dd>Simulates a user releasing a key.<p>Arguments:</p>
400
<ul>
401
<li>locator - an <a href="#locators">element locator</a>
402
</li>
403
<li>keySequence - Either be a string("\" followed by the numeric keycode  of the key to be pressed, normally the ASCII value of that key), or a single  character. For example: "w", "\119".</li>
404
</ul>
405
</dd>
406
<br>
407
<dt>
408
<strong><a name="mouseDown"></a>mouseDown
409
		(
410
			locator
411
		)
412
	</strong>
413
</dt>
414
<dd>Simulates a user pressing the mouse button (without releasing it yet) on
415
the specified element.<p>Arguments:</p>
416
<ul>
417
<li>locator - an <a href="#locators">element locator</a>
418
</li>
419
</ul>
420
</dd>
421
<br>
422
<dt>
423
<strong><a name="mouseDownAt"></a>mouseDownAt
424
		(
425
			locator,coordString
426
		)
427
	</strong>
428
</dt>
429
<dd>Simulates a user pressing the mouse button (without releasing it yet) on
430
the specified element.
431
 
432
Beware of http://jira.openqa.org/browse/SEL-280, which will lead some event handlers to
433
get null event arguments.  Read the bug for more details, including a workaround.<p>Arguments:</p>
434
<ul>
435
<li>locator - an <a href="#locators">element locator</a>
436
</li>
437
<li>coordString - specifies the x,y position (i.e. - 10,20) of the mouse      event relative to the element returned by the locator.</li>
438
</ul>
439
</dd>
440
<br>
441
<dt>
442
<strong><a name="mouseMove"></a>mouseMove
443
		(
444
			locator
445
		)
446
	</strong>
447
</dt>
448
<dd>Simulates a user pressing the mouse button (without releasing it yet) on
449
the specified element.<p>Arguments:</p>
450
<ul>
451
<li>locator - an <a href="#locators">element locator</a>
452
</li>
453
</ul>
454
</dd>
455
<br>
456
<dt>
457
<strong><a name="mouseMoveAt"></a>mouseMoveAt
458
		(
459
			locator,coordString
460
		)
461
	</strong>
462
</dt>
463
<dd>Simulates a user pressing the mouse button (without releasing it yet) on
464
the specified element.
465
 
466
Beware of http://jira.openqa.org/browse/SEL-280, which will lead some event handlers to
467
get null event arguments.  Read the bug for more details, including a workaround.<p>Arguments:</p>
468
<ul>
469
<li>locator - an <a href="#locators">element locator</a>
470
</li>
471
<li>coordString - specifies the x,y position (i.e. - 10,20) of the mouse      event relative to the element returned by the locator.</li>
472
</ul>
473
</dd>
474
<br>
475
<dt>
476
<strong><a name="mouseOut"></a>mouseOut
477
		(
478
			locator
479
		)
480
	</strong>
481
</dt>
482
<dd>Simulates a user moving the mouse pointer away from the specified element.<p>Arguments:</p>
483
<ul>
484
<li>locator - an <a href="#locators">element locator</a>
485
</li>
486
</ul>
487
</dd>
488
<br>
489
<dt>
490
<strong><a name="mouseOver"></a>mouseOver
491
		(
492
			locator
493
		)
494
	</strong>
495
</dt>
496
<dd>Simulates a user hovering a mouse over the specified element.<p>Arguments:</p>
497
<ul>
498
<li>locator - an <a href="#locators">element locator</a>
499
</li>
500
</ul>
501
</dd>
502
<br>
503
<dt>
504
<strong><a name="mouseUp"></a>mouseUp
505
		(
506
			locator
507
		)
508
	</strong>
509
</dt>
510
<dd>Simulates a user pressing the mouse button (without releasing it yet) on
511
the specified element.<p>Arguments:</p>
512
<ul>
513
<li>locator - an <a href="#locators">element locator</a>
514
</li>
515
</ul>
516
</dd>
517
<br>
518
<dt>
519
<strong><a name="mouseUpAt"></a>mouseUpAt
520
		(
521
			locator,coordString
522
		)
523
	</strong>
524
</dt>
525
<dd>Simulates a user pressing the mouse button (without releasing it yet) on
526
the specified element.
527
 
528
Beware of http://jira.openqa.org/browse/SEL-280, which will lead some event handlers to
529
get null event arguments.  Read the bug for more details, including a workaround.<p>Arguments:</p>
530
<ul>
531
<li>locator - an <a href="#locators">element locator</a>
532
</li>
533
<li>coordString - specifies the x,y position (i.e. - 10,20) of the mouse      event relative to the element returned by the locator.</li>
534
</ul>
535
</dd>
536
<br>
537
<dt>
538
<strong><a name="open"></a>open
539
		(
540
			url
541
		)
542
	</strong>
543
</dt>
544
<dd>Opens an URL in the test frame. This accepts both relative and absolute
545
URLs.
546
 
547
The "open" command waits for the page to load before proceeding,
548
ie. the "AndWait" suffix is implicit.
549
 
550
<em>Note</em>: The URL must be on the same domain as the runner HTML
551
due to security restrictions in the browser (Same Origin Policy). If you
552
need to open an URL on another domain, use the Selenium Server to start a
553
new browser session on that domain.<p>Arguments:</p>
554
<ul>
555
<li>url - the URL to open; may be relative or absolute</li>
556
</ul>
557
</dd>
558
<br>
559
<dt>
560
<strong><a name="refresh"></a>refresh
561
		(
562
 
563
		)
564
	</strong>
565
</dt>
566
<dd>Simulates the user clicking the "Refresh" button on their browser.</dd>
567
<br>
568
<dt>
569
<strong><a name="removeSelection"></a>removeSelection
570
		(
571
			locator,optionLocator
572
		)
573
	</strong>
574
</dt>
575
<dd>Remove a selection from the set of selected options in a multi-select element using an option locator.
576
 
577
@see #doSelect for details of option locators<p>Arguments:</p>
578
<ul>
579
<li>locator - an <a href="#locators">element locator</a> identifying a multi-select box</li>
580
<li>optionLocator - an option locator (a label by default)</li>
581
</ul>
582
</dd>
583
<br>
584
<dt>
585
<strong><a name="select"></a>select
586
		(
587
			selectLocator,optionLocator
588
		)
589
	</strong>
590
</dt>
591
<dd>Select an option from a drop-down using an option locator.
592
 
593
<p>
594
Option locators provide different ways of specifying options of an HTML
595
Select element (e.g. for selecting a specific option, or for asserting
596
that the selected option satisfies a specification). There are several
597
forms of Select Option Locator.
598
</p>
599
<dl>
600
<dt>
601
<strong>label</strong>=<em>labelPattern</em>
602
</dt>
603
<dd>matches options based on their labels, i.e. the visible text. (This
604
is the default.)
605
<ul class="first last simple">
606
<li>label=regexp:^[Oo]ther</li>
607
</ul>
608
</dd>
609
<dt>
610
<strong>value</strong>=<em>valuePattern</em>
611
</dt>
612
<dd>matches options based on their values.
613
<ul class="first last simple">
614
<li>value=other</li>
615
</ul>
616
</dd>
617
<dt>
618
<strong>id</strong>=<em>id</em>
619
</dt>
620
<dd>matches options based on their ids.
621
<ul class="first last simple">
622
<li>id=option1</li>
623
</ul>
624
</dd>
625
<dt>
626
<strong>index</strong>=<em>index</em>
627
</dt>
628
<dd>matches an option based on its index (offset from zero).
629
<ul class="first last simple">
630
<li>index=2</li>
631
</ul>
632
</dd>
633
</dl>
634
<p>
635
If no option locator prefix is provided, the default behaviour is to match on <strong>label</strong>.
636
</p>
637
<p>Arguments:</p>
638
<ul>
639
<li>selectLocator - an <a href="#locators">element locator</a> identifying a drop-down menu</li>
640
<li>optionLocator - an option locator (a label by default)</li>
641
</ul>
642
</dd>
643
<br>
644
<dt>
645
<strong><a name="selectFrame"></a>selectFrame
646
		(
647
			locator
648
		)
649
	</strong>
650
</dt>
651
<dd>Selects a frame within the current window.  (You may invoke this command
652
multiple times to select nested frames.)  To select the parent frame, use
653
"relative=parent" as a locator; to select the top frame, use "relative=top".
654
 
655
<p>You may also use a DOM expression to identify the frame you want directly,
656
like this: <code>dom=frames["main"].frames["subframe"]</code>
657
</p>
658
<p>Arguments:</p>
659
<ul>
660
<li>locator - an <a href="#locators">element locator</a> identifying a frame or iframe</li>
661
</ul>
662
</dd>
663
<br>
664
<dt>
665
<strong><a name="selectWindow"></a>selectWindow
666
		(
667
			windowID
668
		)
669
	</strong>
670
</dt>
671
<dd>Selects a popup window; once a popup window has been selected, all
672
commands go to that window. To select the main window again, use "null"
673
as the target.<p>Arguments:</p>
674
<ul>
675
<li>windowID - the JavaScript window ID of the window to select</li>
676
</ul>
677
</dd>
678
<br>
679
<dt>
680
<strong><a name="setContext"></a>setContext
681
		(
682
			context,logLevelThreshold
683
		)
684
	</strong>
685
</dt>
686
<dd>Writes a message to the status bar and adds a note to the browser-side
687
log.
688
 
689
<p>If logLevelThreshold is specified, set the threshold for logging
690
to that level (debug, info, warn, error).</p>
691
<p>(Note that the browser-side logs will <i>not</i> be sent back to the
692
server, and are invisible to the Client Driver.)</p>
693
<p>Arguments:</p>
694
<ul>
695
<li>context - the message to be sent to the browser</li>
696
<li>logLevelThreshold - one of "debug", "info", "warn", "error", sets the threshold for browser-side logging</li>
697
</ul>
698
</dd>
699
<br>
700
<dt>
701
<strong><a name="setCursorPosition"></a>setCursorPosition
702
		(
703
			locator,position
704
		)
705
	</strong>
706
</dt>
707
<dd>Moves the text cursor to the specified position in the given input element or textarea.
708
This method will fail if the specified element isn't an input element or textarea.<p>Arguments:</p>
709
<ul>
710
<li>locator - an <a href="#locators">element locator</a> pointing to an input element or textarea</li>
711
<li>position - the numerical position of the cursor in the field; position should be 0 to move the position to the beginning of the field.  You can also set the cursor to -1 to move it to the end of the field.</li>
712
</ul>
713
</dd>
714
<br>
715
<dt>
716
<strong><a name="setTimeout"></a>setTimeout
717
		(
718
			timeout
719
		)
720
	</strong>
721
</dt>
722
<dd>Specifies the amount of time that Selenium will wait for actions to complete.
723
 
724
<p>Actions that require waiting include "open" and the "waitFor*" actions.</p>
725
The default timeout is 30 seconds.<p>Arguments:</p>
726
<ul>
727
<li>timeout - a timeout in milliseconds, after which the action will return with an error</li>
728
</ul>
729
</dd>
730
<br>
731
<dt>
732
<strong><a name="submit"></a>submit
733
		(
734
			formLocator
735
		)
736
	</strong>
737
</dt>
738
<dd>Submit the specified form. This is particularly useful for forms without
739
submit buttons, e.g. single-input "Search" forms.<p>Arguments:</p>
740
<ul>
741
<li>formLocator - an <a href="#locators">element locator</a> for the form you want to submit</li>
742
</ul>
743
</dd>
744
<br>
745
<dt>
746
<strong><a name="type"></a>type
747
		(
748
			locator,value
749
		)
750
	</strong>
751
</dt>
752
<dd>Sets the value of an input field, as though you typed it in.
753
 
754
<p>Can also be used to set the value of combo boxes, check boxes, etc. In these cases,
755
value should be the value of the option selected, not the visible text.</p>
756
<p>Arguments:</p>
757
<ul>
758
<li>locator - an <a href="#locators">element locator</a>
759
</li>
760
<li>value - the value to type</li>
761
</ul>
762
</dd>
763
<br>
764
<dt>
765
<strong><a name="uncheck"></a>uncheck
766
		(
767
			locator
768
		)
769
	</strong>
770
</dt>
771
<dd>Uncheck a toggle-button (checkbox/radio)<p>Arguments:</p>
772
<ul>
773
<li>locator - an <a href="#locators">element locator</a>
774
</li>
775
</ul>
776
</dd>
777
<br>
778
<dt>
779
<strong><a name="waitForCondition"></a>waitForCondition
780
		(
781
			script,timeout
782
		)
783
	</strong>
784
</dt>
785
<dd>Runs the specified JavaScript snippet repeatedly until it evaluates to "true".
786
The snippet may have multiple lines, but only the result of the last line
787
will be considered.
788
 
789
<p>Note that, by default, the snippet will be run in the runner's test window, not in the window
790
of your application.  To get the window of your application, you can use
791
the JavaScript snippet <code>selenium.browserbot.getCurrentWindow()</code>, and then
792
run your JavaScript in there</p>
793
<p>Arguments:</p>
794
<ul>
795
<li>script - the JavaScript snippet to run</li>
796
<li>timeout - a timeout in milliseconds, after which this command will return with an error</li>
797
</ul>
798
</dd>
799
<br>
800
<dt>
801
<strong><a name="waitForPageToLoad"></a>waitForPageToLoad
802
		(
803
			timeout
804
		)
805
	</strong>
806
</dt>
807
<dd>Waits for a new page to load.
808
 
809
<p>You can use this command instead of the "AndWait" suffixes, "clickAndWait", "selectAndWait", "typeAndWait" etc.
810
(which are only available in the JS API).</p>
811
<p>Selenium constantly keeps track of new pages loading, and sets a "newPageLoaded"
812
flag when it first notices a page load.  Running any other Selenium command after
813
turns the flag to false.  Hence, if you want to wait for a page to load, you must
814
wait immediately after a Selenium command that caused a page-load.</p>
815
<p>Arguments:</p>
816
<ul>
817
<li>timeout - a timeout in milliseconds, after which this command will return with an error</li>
818
</ul>
819
</dd>
820
<br>
821
<dt>
822
<strong><a name="waitForPopUp"></a>waitForPopUp
823
		(
824
			windowID,timeout
825
		)
826
	</strong>
827
</dt>
828
<dd>Waits for a popup window to appear and load up.<p>Arguments:</p>
829
<ul>
830
<li>windowID - the JavaScript window ID of the window that will appear</li>
831
<li>timeout - a timeout in milliseconds, after which the action will return with an error</li>
832
</ul>
833
</dd>
834
<br>
835
<dt>
836
<strong><a name="windowFocus"></a>windowFocus
837
		(
838
			windowName
839
		)
840
	</strong>
841
</dt>
842
<dd>Gives focus to a window<p>Arguments:</p>
843
<ul>
844
<li>windowName - name of the window to be given focus</li>
845
</ul>
846
</dd>
847
<br>
848
<dt>
849
<strong><a name="windowMaximize"></a>windowMaximize
850
		(
851
			windowName
852
		)
853
	</strong>
854
</dt>
855
<dd>Resize window to take up the entire screen<p>Arguments:</p>
856
<ul>
857
<li>windowName - name of the window to be enlarged</li>
858
</ul>
859
</dd>
860
<br>
861
</dl>
862
<h2>Selenium Accessors</h2>
863
<dl>
864
<dt>
865
<strong><a name="storeAlert"></a>storeAlert
866
 
867
		(
868
 
869
			variableName
870
		)
871
 
872
	</strong>
873
</dt>
874
<dd>Retrieves the message of a JavaScript alert generated during the previous action, or fail if there were no alerts.
875
 
876
<p>Getting an alert has the same effect as manually clicking OK. If an
877
alert is generated but you do not get/verify it, the next Selenium action
878
will fail.</p>
879
<p>NOTE: under Selenium, JavaScript alerts will NOT pop up a visible alert
880
dialog.</p>
881
<p>NOTE: Selenium does NOT support JavaScript alerts that are generated in a
882
page's onload() event handler. In this case a visible dialog WILL be
883
generated and Selenium will hang until someone manually clicks OK.</p>
884
<p>
885
<dl>
886
<dt>Returns: </dt>
887
<dd>The message of the most recent JavaScript alert</dd>
888
</dl>
889
</p>
890
<p>Related Assertions, automatically generated:</p>
891
<ul>
892
<li>assertAlert
893
				(
894
					<a href="#patterns">pattern</a>
895
				)
896
			</li>
897
<li>assertNotAlert
898
				(
899
					<a href="#patterns">pattern</a>
900
				)
901
			</li>
902
<li>verifyAlert
903
				(
904
					<a href="#patterns">pattern</a>
905
				)
906
			</li>
907
<li>verifyNotAlert
908
				(
909
					<a href="#patterns">pattern</a>
910
				)
911
			</li>
912
<li>waitForAlert
913
				(
914
					<a href="#patterns">pattern</a>
915
				)
916
			</li>
917
<li>waitForNotAlert
918
				(
919
					<a href="#patterns">pattern</a>
920
				)
921
			</li>
922
</ul>
923
</dd>
924
<br>
925
<dt>
926
<strong><a name="storeAllButtons"></a>storeAllButtons
927
 
928
		(
929
 
930
			variableName
931
		)
932
 
933
	</strong>
934
</dt>
935
<dd>Returns the IDs of all buttons on the page.
936
 
937
<p>If a given button has no ID, it will appear as "" in this array.</p>
938
<p>
939
<dl>
940
<dt>Returns: </dt>
941
<dd>the IDs of all buttons on the page</dd>
942
</dl>
943
</p>
944
<p>Related Assertions, automatically generated:</p>
945
<ul>
946
<li>assertAllButtons
947
				(
948
					<a href="#patterns">pattern</a>
949
				)
950
			</li>
951
<li>assertNotAllButtons
952
				(
953
					<a href="#patterns">pattern</a>
954
				)
955
			</li>
956
<li>verifyAllButtons
957
				(
958
					<a href="#patterns">pattern</a>
959
				)
960
			</li>
961
<li>verifyNotAllButtons
962
				(
963
					<a href="#patterns">pattern</a>
964
				)
965
			</li>
966
<li>waitForAllButtons
967
				(
968
					<a href="#patterns">pattern</a>
969
				)
970
			</li>
971
<li>waitForNotAllButtons
972
				(
973
					<a href="#patterns">pattern</a>
974
				)
975
			</li>
976
</ul>
977
</dd>
978
<br>
979
<dt>
980
<strong><a name="storeAllFields"></a>storeAllFields
981
 
982
		(
983
 
984
			variableName
985
		)
986
 
987
	</strong>
988
</dt>
989
<dd>Returns the IDs of all input fields on the page.
990
 
991
<p>If a given field has no ID, it will appear as "" in this array.</p>
992
<p>
993
<dl>
994
<dt>Returns: </dt>
995
<dd>the IDs of all field on the page</dd>
996
</dl>
997
</p>
998
<p>Related Assertions, automatically generated:</p>
999
<ul>
1000
<li>assertAllFields
1001
				(
1002
					<a href="#patterns">pattern</a>
1003
				)
1004
			</li>
1005
<li>assertNotAllFields
1006
				(
1007
					<a href="#patterns">pattern</a>
1008
				)
1009
			</li>
1010
<li>verifyAllFields
1011
				(
1012
					<a href="#patterns">pattern</a>
1013
				)
1014
			</li>
1015
<li>verifyNotAllFields
1016
				(
1017
					<a href="#patterns">pattern</a>
1018
				)
1019
			</li>
1020
<li>waitForAllFields
1021
				(
1022
					<a href="#patterns">pattern</a>
1023
				)
1024
			</li>
1025
<li>waitForNotAllFields
1026
				(
1027
					<a href="#patterns">pattern</a>
1028
				)
1029
			</li>
1030
</ul>
1031
</dd>
1032
<br>
1033
<dt>
1034
<strong><a name="storeAllLinks"></a>storeAllLinks
1035
 
1036
		(
1037
 
1038
			variableName
1039
		)
1040
 
1041
	</strong>
1042
</dt>
1043
<dd>Returns the IDs of all links on the page.
1044
 
1045
<p>If a given link has no ID, it will appear as "" in this array.</p>
1046
<p>
1047
<dl>
1048
<dt>Returns: </dt>
1049
<dd>the IDs of all links on the page</dd>
1050
</dl>
1051
</p>
1052
<p>Related Assertions, automatically generated:</p>
1053
<ul>
1054
<li>assertAllLinks
1055
				(
1056
					<a href="#patterns">pattern</a>
1057
				)
1058
			</li>
1059
<li>assertNotAllLinks
1060
				(
1061
					<a href="#patterns">pattern</a>
1062
				)
1063
			</li>
1064
<li>verifyAllLinks
1065
				(
1066
					<a href="#patterns">pattern</a>
1067
				)
1068
			</li>
1069
<li>verifyNotAllLinks
1070
				(
1071
					<a href="#patterns">pattern</a>
1072
				)
1073
			</li>
1074
<li>waitForAllLinks
1075
				(
1076
					<a href="#patterns">pattern</a>
1077
				)
1078
			</li>
1079
<li>waitForNotAllLinks
1080
				(
1081
					<a href="#patterns">pattern</a>
1082
				)
1083
			</li>
1084
</ul>
1085
</dd>
1086
<br>
1087
<dt>
1088
<strong><a name="storeAllWindowIds"></a>storeAllWindowIds
1089
 
1090
		(
1091
 
1092
			variableName
1093
		)
1094
 
1095
	</strong>
1096
</dt>
1097
<dd>Returns the IDs of all windows that the browser knows about.<p>
1098
<dl>
1099
<dt>Returns: </dt>
1100
<dd>the IDs of all windows that the browser knows about.</dd>
1101
</dl>
1102
</p>
1103
<p>Related Assertions, automatically generated:</p>
1104
<ul>
1105
<li>assertAllWindowIds
1106
				(
1107
					<a href="#patterns">pattern</a>
1108
				)
1109
			</li>
1110
<li>assertNotAllWindowIds
1111
				(
1112
					<a href="#patterns">pattern</a>
1113
				)
1114
			</li>
1115
<li>verifyAllWindowIds
1116
				(
1117
					<a href="#patterns">pattern</a>
1118
				)
1119
			</li>
1120
<li>verifyNotAllWindowIds
1121
				(
1122
					<a href="#patterns">pattern</a>
1123
				)
1124
			</li>
1125
<li>waitForAllWindowIds
1126
				(
1127
					<a href="#patterns">pattern</a>
1128
				)
1129
			</li>
1130
<li>waitForNotAllWindowIds
1131
				(
1132
					<a href="#patterns">pattern</a>
1133
				)
1134
			</li>
1135
</ul>
1136
</dd>
1137
<br>
1138
<dt>
1139
<strong><a name="storeAllWindowNames"></a>storeAllWindowNames
1140
 
1141
		(
1142
 
1143
			variableName
1144
		)
1145
 
1146
	</strong>
1147
</dt>
1148
<dd>Returns the names of all windows that the browser knows about.<p>
1149
<dl>
1150
<dt>Returns: </dt>
1151
<dd>the names of all windows that the browser knows about.</dd>
1152
</dl>
1153
</p>
1154
<p>Related Assertions, automatically generated:</p>
1155
<ul>
1156
<li>assertAllWindowNames
1157
				(
1158
					<a href="#patterns">pattern</a>
1159
				)
1160
			</li>
1161
<li>assertNotAllWindowNames
1162
				(
1163
					<a href="#patterns">pattern</a>
1164
				)
1165
			</li>
1166
<li>verifyAllWindowNames
1167
				(
1168
					<a href="#patterns">pattern</a>
1169
				)
1170
			</li>
1171
<li>verifyNotAllWindowNames
1172
				(
1173
					<a href="#patterns">pattern</a>
1174
				)
1175
			</li>
1176
<li>waitForAllWindowNames
1177
				(
1178
					<a href="#patterns">pattern</a>
1179
				)
1180
			</li>
1181
<li>waitForNotAllWindowNames
1182
				(
1183
					<a href="#patterns">pattern</a>
1184
				)
1185
			</li>
1186
</ul>
1187
</dd>
1188
<br>
1189
<dt>
1190
<strong><a name="storeAllWindowTitles"></a>storeAllWindowTitles
1191
 
1192
		(
1193
 
1194
			variableName
1195
		)
1196
 
1197
	</strong>
1198
</dt>
1199
<dd>Returns the titles of all windows that the browser knows about.<p>
1200
<dl>
1201
<dt>Returns: </dt>
1202
<dd>the titles of all windows that the browser knows about.</dd>
1203
</dl>
1204
</p>
1205
<p>Related Assertions, automatically generated:</p>
1206
<ul>
1207
<li>assertAllWindowTitles
1208
				(
1209
					<a href="#patterns">pattern</a>
1210
				)
1211
			</li>
1212
<li>assertNotAllWindowTitles
1213
				(
1214
					<a href="#patterns">pattern</a>
1215
				)
1216
			</li>
1217
<li>verifyAllWindowTitles
1218
				(
1219
					<a href="#patterns">pattern</a>
1220
				)
1221
			</li>
1222
<li>verifyNotAllWindowTitles
1223
				(
1224
					<a href="#patterns">pattern</a>
1225
				)
1226
			</li>
1227
<li>waitForAllWindowTitles
1228
				(
1229
					<a href="#patterns">pattern</a>
1230
				)
1231
			</li>
1232
<li>waitForNotAllWindowTitles
1233
				(
1234
					<a href="#patterns">pattern</a>
1235
				)
1236
			</li>
1237
</ul>
1238
</dd>
1239
<br>
1240
<dt>
1241
<strong><a name="storeAttribute"></a>storeAttribute
1242
 
1243
		(
1244
			attributeLocator,
1245
 
1246
			variableName
1247
		)
1248
 
1249
	</strong>
1250
</dt>
1251
<dd>Gets the value of an element attribute.
1252
 
1253
Beware of http://jira.openqa.org/browse/SEL-280, which will lead some event handlers to
1254
get null event arguments.  Read the bug for more details, including a workaround.<p>Arguments:</p>
1255
<ul>
1256
<li>attributeLocator - an element locator followed by an</li>
1257
<li>variableName -
1258
                    the name of a <a href="#storedVars">variable</a> in which the result is to be stored.
1259
                </li>
1260
</ul>
1261
<p>
1262
<dl>
1263
<dt>Returns: </dt>
1264
<dd>the value of the specified attribute</dd>
1265
</dl>
1266
</p>
1267
<p>Related Assertions, automatically generated:</p>
1268
<ul>
1269
<li>assertAttribute
1270
				(
1271
					attributeLocator, <a href="#patterns">pattern</a>
1272
				)
1273
			</li>
1274
<li>assertNotAttribute
1275
				(
1276
					attributeLocator, <a href="#patterns">pattern</a>
1277
				)
1278
			</li>
1279
<li>verifyAttribute
1280
				(
1281
					attributeLocator, <a href="#patterns">pattern</a>
1282
				)
1283
			</li>
1284
<li>verifyNotAttribute
1285
				(
1286
					attributeLocator, <a href="#patterns">pattern</a>
1287
				)
1288
			</li>
1289
<li>waitForAttribute
1290
				(
1291
					attributeLocator, <a href="#patterns">pattern</a>
1292
				)
1293
			</li>
1294
<li>waitForNotAttribute
1295
				(
1296
					attributeLocator, <a href="#patterns">pattern</a>
1297
				)
1298
			</li>
1299
</ul>
1300
</dd>
1301
<br>
1302
<dt>
1303
<strong><a name="storeAttributeFromAllWindows"></a>storeAttributeFromAllWindows
1304
 
1305
		(
1306
			attributeName,
1307
 
1308
			variableName
1309
		)
1310
 
1311
	</strong>
1312
</dt>
1313
<dd>Returns every instance of some attribute from all known windows.<p>Arguments:</p>
1314
<ul>
1315
<li>attributeName - name of an attribute on the windows</li>
1316
<li>variableName -
1317
                    the name of a <a href="#storedVars">variable</a> in which the result is to be stored.
1318
                </li>
1319
</ul>
1320
<p>
1321
<dl>
1322
<dt>Returns: </dt>
1323
<dd>the set of values of this attribute from all known windows.</dd>
1324
</dl>
1325
</p>
1326
<p>Related Assertions, automatically generated:</p>
1327
<ul>
1328
<li>assertAttributeFromAllWindows
1329
				(
1330
					attributeName, <a href="#patterns">pattern</a>
1331
				)
1332
			</li>
1333
<li>assertNotAttributeFromAllWindows
1334
				(
1335
					attributeName, <a href="#patterns">pattern</a>
1336
				)
1337
			</li>
1338
<li>verifyAttributeFromAllWindows
1339
				(
1340
					attributeName, <a href="#patterns">pattern</a>
1341
				)
1342
			</li>
1343
<li>verifyNotAttributeFromAllWindows
1344
				(
1345
					attributeName, <a href="#patterns">pattern</a>
1346
				)
1347
			</li>
1348
<li>waitForAttributeFromAllWindows
1349
				(
1350
					attributeName, <a href="#patterns">pattern</a>
1351
				)
1352
			</li>
1353
<li>waitForNotAttributeFromAllWindows
1354
				(
1355
					attributeName, <a href="#patterns">pattern</a>
1356
				)
1357
			</li>
1358
</ul>
1359
</dd>
1360
<br>
1361
<dt>
1362
<strong><a name="storeBodyText"></a>storeBodyText
1363
 
1364
		(
1365
 
1366
			variableName
1367
		)
1368
 
1369
	</strong>
1370
</dt>
1371
<dd>Gets the entire text of the page.<p>
1372
<dl>
1373
<dt>Returns: </dt>
1374
<dd>the entire text of the page</dd>
1375
</dl>
1376
</p>
1377
<p>Related Assertions, automatically generated:</p>
1378
<ul>
1379
<li>assertBodyText
1380
				(
1381
					<a href="#patterns">pattern</a>
1382
				)
1383
			</li>
1384
<li>assertNotBodyText
1385
				(
1386
					<a href="#patterns">pattern</a>
1387
				)
1388
			</li>
1389
<li>verifyBodyText
1390
				(
1391
					<a href="#patterns">pattern</a>
1392
				)
1393
			</li>
1394
<li>verifyNotBodyText
1395
				(
1396
					<a href="#patterns">pattern</a>
1397
				)
1398
			</li>
1399
<li>waitForBodyText
1400
				(
1401
					<a href="#patterns">pattern</a>
1402
				)
1403
			</li>
1404
<li>waitForNotBodyText
1405
				(
1406
					<a href="#patterns">pattern</a>
1407
				)
1408
			</li>
1409
</ul>
1410
</dd>
1411
<br>
1412
<dt>
1413
<strong><a name="storeConfirmation"></a>storeConfirmation
1414
 
1415
		(
1416
 
1417
			variableName
1418
		)
1419
 
1420
	</strong>
1421
</dt>
1422
<dd>Retrieves the message of a JavaScript confirmation dialog generated during
1423
the previous action.
1424
 
1425
<p>
1426
By default, the confirm function will return true, having the same effect
1427
as manually clicking OK. This can be changed by prior execution of the
1428
chooseCancelOnNextConfirmation command. If an confirmation is generated
1429
but you do not get/verify it, the next Selenium action will fail.
1430
</p>
1431
<p>
1432
NOTE: under Selenium, JavaScript confirmations will NOT pop up a visible
1433
dialog.
1434
</p>
1435
<p>
1436
NOTE: Selenium does NOT support JavaScript confirmations that are
1437
generated in a page's onload() event handler. In this case a visible
1438
dialog WILL be generated and Selenium will hang until you manually click
1439
OK.
1440
</p>
1441
<p>
1442
<dl>
1443
<dt>Returns: </dt>
1444
<dd>the message of the most recent JavaScript confirmation dialog</dd>
1445
</dl>
1446
</p>
1447
<p>Related Assertions, automatically generated:</p>
1448
<ul>
1449
<li>assertConfirmation
1450
				(
1451
					<a href="#patterns">pattern</a>
1452
				)
1453
			</li>
1454
<li>assertNotConfirmation
1455
				(
1456
					<a href="#patterns">pattern</a>
1457
				)
1458
			</li>
1459
<li>verifyConfirmation
1460
				(
1461
					<a href="#patterns">pattern</a>
1462
				)
1463
			</li>
1464
<li>verifyNotConfirmation
1465
				(
1466
					<a href="#patterns">pattern</a>
1467
				)
1468
			</li>
1469
<li>waitForConfirmation
1470
				(
1471
					<a href="#patterns">pattern</a>
1472
				)
1473
			</li>
1474
<li>waitForNotConfirmation
1475
				(
1476
					<a href="#patterns">pattern</a>
1477
				)
1478
			</li>
1479
</ul>
1480
</dd>
1481
<br>
1482
<dt>
1483
<strong><a name="storeCookie"></a>storeCookie
1484
 
1485
		(
1486
 
1487
			variableName
1488
		)
1489
 
1490
	</strong>
1491
</dt>
1492
<dd>Return all cookies of the current page under test.<p>
1493
<dl>
1494
<dt>Returns: </dt>
1495
<dd>all cookies of the current page under test</dd>
1496
</dl>
1497
</p>
1498
<p>Related Assertions, automatically generated:</p>
1499
<ul>
1500
<li>assertCookie
1501
				(
1502
					<a href="#patterns">pattern</a>
1503
				)
1504
			</li>
1505
<li>assertNotCookie
1506
				(
1507
					<a href="#patterns">pattern</a>
1508
				)
1509
			</li>
1510
<li>verifyCookie
1511
				(
1512
					<a href="#patterns">pattern</a>
1513
				)
1514
			</li>
1515
<li>verifyNotCookie
1516
				(
1517
					<a href="#patterns">pattern</a>
1518
				)
1519
			</li>
1520
<li>waitForCookie
1521
				(
1522
					<a href="#patterns">pattern</a>
1523
				)
1524
			</li>
1525
<li>waitForNotCookie
1526
				(
1527
					<a href="#patterns">pattern</a>
1528
				)
1529
			</li>
1530
</ul>
1531
</dd>
1532
<br>
1533
<dt>
1534
<strong><a name="storeCursorPosition"></a>storeCursorPosition
1535
 
1536
		(
1537
			locator,
1538
 
1539
			variableName
1540
		)
1541
 
1542
	</strong>
1543
</dt>
1544
<dd>Retrieves the text cursor position in the given input element or textarea; beware, this may not work perfectly on all browsers.
1545
 
1546
<p>Specifically, if the cursor/selection has been cleared by JavaScript, this command will tend to
1547
return the position of the last location of the cursor, even though the cursor is now gone from the page.  This is filed as <a href="http://jira.openqa.org/browse/SEL-243">SEL-243</a>.</p>
1548
This method will fail if the specified element isn't an input element or textarea, or there is no cursor in the element.<p>Arguments:</p>
1549
<ul>
1550
<li>locator - an <a href="#locators">element locator</a> pointing to an input element or textarea</li>
1551
<li>variableName -
1552
                    the name of a <a href="#storedVars">variable</a> in which the result is to be stored.
1553
                </li>
1554
</ul>
1555
<p>
1556
<dl>
1557
<dt>Returns: </dt>
1558
<dd>the numerical position of the cursor in the field</dd>
1559
</dl>
1560
</p>
1561
<p>Related Assertions, automatically generated:</p>
1562
<ul>
1563
<li>assertCursorPosition
1564
				(
1565
					locator, <a href="#patterns">pattern</a>
1566
				)
1567
			</li>
1568
<li>assertNotCursorPosition
1569
				(
1570
					locator, <a href="#patterns">pattern</a>
1571
				)
1572
			</li>
1573
<li>verifyCursorPosition
1574
				(
1575
					locator, <a href="#patterns">pattern</a>
1576
				)
1577
			</li>
1578
<li>verifyNotCursorPosition
1579
				(
1580
					locator, <a href="#patterns">pattern</a>
1581
				)
1582
			</li>
1583
<li>waitForCursorPosition
1584
				(
1585
					locator, <a href="#patterns">pattern</a>
1586
				)
1587
			</li>
1588
<li>waitForNotCursorPosition
1589
				(
1590
					locator, <a href="#patterns">pattern</a>
1591
				)
1592
			</li>
1593
</ul>
1594
</dd>
1595
<br>
1596
<dt>
1597
<strong><a name="storeElementHeight"></a>storeElementHeight
1598
 
1599
		(
1600
			locator,
1601
 
1602
			variableName
1603
		)
1604
 
1605
	</strong>
1606
</dt>
1607
<dd>Retrieves the height of an element<p>Arguments:</p>
1608
<ul>
1609
<li>locator - an <a href="#locators">element locator</a> pointing to an element</li>
1610
<li>variableName -
1611
                    the name of a <a href="#storedVars">variable</a> in which the result is to be stored.
1612
                </li>
1613
</ul>
1614
<p>
1615
<dl>
1616
<dt>Returns: </dt>
1617
<dd>height of an element in pixels</dd>
1618
</dl>
1619
</p>
1620
<p>Related Assertions, automatically generated:</p>
1621
<ul>
1622
<li>assertElementHeight
1623
				(
1624
					locator, <a href="#patterns">pattern</a>
1625
				)
1626
			</li>
1627
<li>assertNotElementHeight
1628
				(
1629
					locator, <a href="#patterns">pattern</a>
1630
				)
1631
			</li>
1632
<li>verifyElementHeight
1633
				(
1634
					locator, <a href="#patterns">pattern</a>
1635
				)
1636
			</li>
1637
<li>verifyNotElementHeight
1638
				(
1639
					locator, <a href="#patterns">pattern</a>
1640
				)
1641
			</li>
1642
<li>waitForElementHeight
1643
				(
1644
					locator, <a href="#patterns">pattern</a>
1645
				)
1646
			</li>
1647
<li>waitForNotElementHeight
1648
				(
1649
					locator, <a href="#patterns">pattern</a>
1650
				)
1651
			</li>
1652
</ul>
1653
</dd>
1654
<br>
1655
<dt>
1656
<strong><a name="storeElementIndex"></a>storeElementIndex
1657
 
1658
		(
1659
			locator,
1660
 
1661
			variableName
1662
		)
1663
 
1664
	</strong>
1665
</dt>
1666
<dd>Get the relative index of an element to its parent (starting from 0). The comment node and empty text node
1667
will be ignored.<p>Arguments:</p>
1668
<ul>
1669
<li>locator - an <a href="#locators">element locator</a> pointing to an element</li>
1670
<li>variableName -
1671
                    the name of a <a href="#storedVars">variable</a> in which the result is to be stored.
1672
                </li>
1673
</ul>
1674
<p>
1675
<dl>
1676
<dt>Returns: </dt>
1677
<dd>of relative index of the element to its parent (starting from 0)</dd>
1678
</dl>
1679
</p>
1680
<p>Related Assertions, automatically generated:</p>
1681
<ul>
1682
<li>assertElementIndex
1683
				(
1684
					locator, <a href="#patterns">pattern</a>
1685
				)
1686
			</li>
1687
<li>assertNotElementIndex
1688
				(
1689
					locator, <a href="#patterns">pattern</a>
1690
				)
1691
			</li>
1692
<li>verifyElementIndex
1693
				(
1694
					locator, <a href="#patterns">pattern</a>
1695
				)
1696
			</li>
1697
<li>verifyNotElementIndex
1698
				(
1699
					locator, <a href="#patterns">pattern</a>
1700
				)
1701
			</li>
1702
<li>waitForElementIndex
1703
				(
1704
					locator, <a href="#patterns">pattern</a>
1705
				)
1706
			</li>
1707
<li>waitForNotElementIndex
1708
				(
1709
					locator, <a href="#patterns">pattern</a>
1710
				)
1711
			</li>
1712
</ul>
1713
</dd>
1714
<br>
1715
<dt>
1716
<strong><a name="storeElementPositionLeft"></a>storeElementPositionLeft
1717
 
1718
		(
1719
			locator,
1720
 
1721
			variableName
1722
		)
1723
 
1724
	</strong>
1725
</dt>
1726
<dd>Retrieves the horizontal position of an element<p>Arguments:</p>
1727
<ul>
1728
<li>locator - an <a href="#locators">element locator</a> pointing to an element OR an element itself</li>
1729
<li>variableName -
1730
                    the name of a <a href="#storedVars">variable</a> in which the result is to be stored.
1731
                </li>
1732
</ul>
1733
<p>
1734
<dl>
1735
<dt>Returns: </dt>
1736
<dd>of pixels from the edge of the frame.</dd>
1737
</dl>
1738
</p>
1739
<p>Related Assertions, automatically generated:</p>
1740
<ul>
1741
<li>assertElementPositionLeft
1742
				(
1743
					locator, <a href="#patterns">pattern</a>
1744
				)
1745
			</li>
1746
<li>assertNotElementPositionLeft
1747
				(
1748
					locator, <a href="#patterns">pattern</a>
1749
				)
1750
			</li>
1751
<li>verifyElementPositionLeft
1752
				(
1753
					locator, <a href="#patterns">pattern</a>
1754
				)
1755
			</li>
1756
<li>verifyNotElementPositionLeft
1757
				(
1758
					locator, <a href="#patterns">pattern</a>
1759
				)
1760
			</li>
1761
<li>waitForElementPositionLeft
1762
				(
1763
					locator, <a href="#patterns">pattern</a>
1764
				)
1765
			</li>
1766
<li>waitForNotElementPositionLeft
1767
				(
1768
					locator, <a href="#patterns">pattern</a>
1769
				)
1770
			</li>
1771
</ul>
1772
</dd>
1773
<br>
1774
<dt>
1775
<strong><a name="storeElementPositionTop"></a>storeElementPositionTop
1776
 
1777
		(
1778
			locator,
1779
 
1780
			variableName
1781
		)
1782
 
1783
	</strong>
1784
</dt>
1785
<dd>Retrieves the vertical position of an element<p>Arguments:</p>
1786
<ul>
1787
<li>locator - an <a href="#locators">element locator</a> pointing to an element OR an element itself</li>
1788
<li>variableName -
1789
                    the name of a <a href="#storedVars">variable</a> in which the result is to be stored.
1790
                </li>
1791
</ul>
1792
<p>
1793
<dl>
1794
<dt>Returns: </dt>
1795
<dd>of pixels from the edge of the frame.</dd>
1796
</dl>
1797
</p>
1798
<p>Related Assertions, automatically generated:</p>
1799
<ul>
1800
<li>assertElementPositionTop
1801
				(
1802
					locator, <a href="#patterns">pattern</a>
1803
				)
1804
			</li>
1805
<li>assertNotElementPositionTop
1806
				(
1807
					locator, <a href="#patterns">pattern</a>
1808
				)
1809
			</li>
1810
<li>verifyElementPositionTop
1811
				(
1812
					locator, <a href="#patterns">pattern</a>
1813
				)
1814
			</li>
1815
<li>verifyNotElementPositionTop
1816
				(
1817
					locator, <a href="#patterns">pattern</a>
1818
				)
1819
			</li>
1820
<li>waitForElementPositionTop
1821
				(
1822
					locator, <a href="#patterns">pattern</a>
1823
				)
1824
			</li>
1825
<li>waitForNotElementPositionTop
1826
				(
1827
					locator, <a href="#patterns">pattern</a>
1828
				)
1829
			</li>
1830
</ul>
1831
</dd>
1832
<br>
1833
<dt>
1834
<strong><a name="storeElementWidth"></a>storeElementWidth
1835
 
1836
		(
1837
			locator,
1838
 
1839
			variableName
1840
		)
1841
 
1842
	</strong>
1843
</dt>
1844
<dd>Retrieves the width of an element<p>Arguments:</p>
1845
<ul>
1846
<li>locator - an <a href="#locators">element locator</a> pointing to an element</li>
1847
<li>variableName -
1848
                    the name of a <a href="#storedVars">variable</a> in which the result is to be stored.
1849
                </li>
1850
</ul>
1851
<p>
1852
<dl>
1853
<dt>Returns: </dt>
1854
<dd>width of an element in pixels</dd>
1855
</dl>
1856
</p>
1857
<p>Related Assertions, automatically generated:</p>
1858
<ul>
1859
<li>assertElementWidth
1860
				(
1861
					locator, <a href="#patterns">pattern</a>
1862
				)
1863
			</li>
1864
<li>assertNotElementWidth
1865
				(
1866
					locator, <a href="#patterns">pattern</a>
1867
				)
1868
			</li>
1869
<li>verifyElementWidth
1870
				(
1871
					locator, <a href="#patterns">pattern</a>
1872
				)
1873
			</li>
1874
<li>verifyNotElementWidth
1875
				(
1876
					locator, <a href="#patterns">pattern</a>
1877
				)
1878
			</li>
1879
<li>waitForElementWidth
1880
				(
1881
					locator, <a href="#patterns">pattern</a>
1882
				)
1883
			</li>
1884
<li>waitForNotElementWidth
1885
				(
1886
					locator, <a href="#patterns">pattern</a>
1887
				)
1888
			</li>
1889
</ul>
1890
</dd>
1891
<br>
1892
<dt>
1893
<strong><a name="storeEval"></a>storeEval
1894
 
1895
		(
1896
			script,
1897
 
1898
			variableName
1899
		)
1900
 
1901
	</strong>
1902
</dt>
1903
<dd>Gets the result of evaluating the specified JavaScript snippet.  The snippet may
1904
have multiple lines, but only the result of the last line will be returned.
1905
 
1906
<p>Note that, by default, the snippet will run in the context of the "selenium"
1907
object itself, so <code>this</code> will refer to the Selenium object, and <code>window</code> will
1908
refer to the top-level runner test window, not the window of your application.</p>
1909
<p>If you need a reference to the window of your application, you can refer
1910
to <code>this.browserbot.getCurrentWindow()</code> and if you need to use
1911
a locator to refer to a single element in your application page, you can
1912
use <code>this.page().findElement("foo")</code> where "foo" is your locator.</p>
1913
<p>Arguments:</p>
1914
<ul>
1915
<li>script - the JavaScript snippet to run</li>
1916
<li>variableName -
1917
                    the name of a <a href="#storedVars">variable</a> in which the result is to be stored.
1918
                </li>
1919
</ul>
1920
<p>
1921
<dl>
1922
<dt>Returns: </dt>
1923
<dd>the results of evaluating the snippet</dd>
1924
</dl>
1925
</p>
1926
<p>Related Assertions, automatically generated:</p>
1927
<ul>
1928
<li>assertEval
1929
				(
1930
					script, <a href="#patterns">pattern</a>
1931
				)
1932
			</li>
1933
<li>assertNotEval
1934
				(
1935
					script, <a href="#patterns">pattern</a>
1936
				)
1937
			</li>
1938
<li>verifyEval
1939
				(
1940
					script, <a href="#patterns">pattern</a>
1941
				)
1942
			</li>
1943
<li>verifyNotEval
1944
				(
1945
					script, <a href="#patterns">pattern</a>
1946
				)
1947
			</li>
1948
<li>waitForEval
1949
				(
1950
					script, <a href="#patterns">pattern</a>
1951
				)
1952
			</li>
1953
<li>waitForNotEval
1954
				(
1955
					script, <a href="#patterns">pattern</a>
1956
				)
1957
			</li>
1958
</ul>
1959
</dd>
1960
<br>
1961
<dt>
1962
<strong><a name="storeExpression"></a>storeExpression
1963
 
1964
		(
1965
			expression,
1966
 
1967
			variableName
1968
		)
1969
 
1970
	</strong>
1971
</dt>
1972
<dd>Returns the specified expression.
1973
 
1974
<p>This is useful because of JavaScript preprocessing.
1975
It is used to generate commands like assertExpression and waitForExpression.</p>
1976
<p>Arguments:</p>
1977
<ul>
1978
<li>expression - the value to return</li>
1979
<li>variableName -
1980
                    the name of a <a href="#storedVars">variable</a> in which the result is to be stored.
1981
                </li>
1982
</ul>
1983
<p>
1984
<dl>
1985
<dt>Returns: </dt>
1986
<dd>the value passed in</dd>
1987
</dl>
1988
</p>
1989
<p>Related Assertions, automatically generated:</p>
1990
<ul>
1991
<li>assertExpression
1992
				(
1993
					expression, <a href="#patterns">pattern</a>
1994
				)
1995
			</li>
1996
<li>assertNotExpression
1997
				(
1998
					expression, <a href="#patterns">pattern</a>
1999
				)
2000
			</li>
2001
<li>verifyExpression
2002
				(
2003
					expression, <a href="#patterns">pattern</a>
2004
				)
2005
			</li>
2006
<li>verifyNotExpression
2007
				(
2008
					expression, <a href="#patterns">pattern</a>
2009
				)
2010
			</li>
2011
<li>waitForExpression
2012
				(
2013
					expression, <a href="#patterns">pattern</a>
2014
				)
2015
			</li>
2016
<li>waitForNotExpression
2017
				(
2018
					expression, <a href="#patterns">pattern</a>
2019
				)
2020
			</li>
2021
</ul>
2022
</dd>
2023
<br>
2024
<dt>
2025
<strong><a name="storeHtmlSource"></a>storeHtmlSource
2026
 
2027
		(
2028
 
2029
			variableName
2030
		)
2031
 
2032
	</strong>
2033
</dt>
2034
<dd>Returns the entire HTML source between the opening and
2035
closing "html" tags.<p>
2036
<dl>
2037
<dt>Returns: </dt>
2038
<dd>the entire HTML source</dd>
2039
</dl>
2040
</p>
2041
<p>Related Assertions, automatically generated:</p>
2042
<ul>
2043
<li>assertHtmlSource
2044
				(
2045
					<a href="#patterns">pattern</a>
2046
				)
2047
			</li>
2048
<li>assertNotHtmlSource
2049
				(
2050
					<a href="#patterns">pattern</a>
2051
				)
2052
			</li>
2053
<li>verifyHtmlSource
2054
				(
2055
					<a href="#patterns">pattern</a>
2056
				)
2057
			</li>
2058
<li>verifyNotHtmlSource
2059
				(
2060
					<a href="#patterns">pattern</a>
2061
				)
2062
			</li>
2063
<li>waitForHtmlSource
2064
				(
2065
					<a href="#patterns">pattern</a>
2066
				)
2067
			</li>
2068
<li>waitForNotHtmlSource
2069
				(
2070
					<a href="#patterns">pattern</a>
2071
				)
2072
			</li>
2073
</ul>
2074
</dd>
2075
<br>
2076
<dt>
2077
<strong><a name="storeLocation"></a>storeLocation
2078
 
2079
		(
2080
 
2081
			variableName
2082
		)
2083
 
2084
	</strong>
2085
</dt>
2086
<dd>Gets the absolute URL of the current page.<p>
2087
<dl>
2088
<dt>Returns: </dt>
2089
<dd>the absolute URL of the current page</dd>
2090
</dl>
2091
</p>
2092
<p>Related Assertions, automatically generated:</p>
2093
<ul>
2094
<li>assertLocation
2095
				(
2096
					<a href="#patterns">pattern</a>
2097
				)
2098
			</li>
2099
<li>assertNotLocation
2100
				(
2101
					<a href="#patterns">pattern</a>
2102
				)
2103
			</li>
2104
<li>verifyLocation
2105
				(
2106
					<a href="#patterns">pattern</a>
2107
				)
2108
			</li>
2109
<li>verifyNotLocation
2110
				(
2111
					<a href="#patterns">pattern</a>
2112
				)
2113
			</li>
2114
<li>waitForLocation
2115
				(
2116
					<a href="#patterns">pattern</a>
2117
				)
2118
			</li>
2119
<li>waitForNotLocation
2120
				(
2121
					<a href="#patterns">pattern</a>
2122
				)
2123
			</li>
2124
</ul>
2125
</dd>
2126
<br>
2127
<dt>
2128
<strong><a name="storeLogMessages"></a>storeLogMessages
2129
 
2130
		(
2131
 
2132
			variableName
2133
		)
2134
 
2135
	</strong>
2136
</dt>
2137
<dd>Return the contents of the log.
2138
 
2139
<p>This is a placeholder intended to make the code generator make this API
2140
available to clients.  The selenium server will intercept this call, however,
2141
and return its recordkeeping of log messages since the last call to this API.
2142
Thus this code in JavaScript will never be called.</p>
2143
<p>The reason I opted for a servercentric solution is to be able to support
2144
multiple frames served from different domains, which would break a
2145
centralized JavaScript logging mechanism under some conditions.</p>
2146
<p>
2147
<dl>
2148
<dt>Returns: </dt>
2149
<dd>all log messages seen since the last call to this API</dd>
2150
</dl>
2151
</p>
2152
<p>Related Assertions, automatically generated:</p>
2153
<ul>
2154
<li>assertLogMessages
2155
				(
2156
					<a href="#patterns">pattern</a>
2157
				)
2158
			</li>
2159
<li>assertNotLogMessages
2160
				(
2161
					<a href="#patterns">pattern</a>
2162
				)
2163
			</li>
2164
<li>verifyLogMessages
2165
				(
2166
					<a href="#patterns">pattern</a>
2167
				)
2168
			</li>
2169
<li>verifyNotLogMessages
2170
				(
2171
					<a href="#patterns">pattern</a>
2172
				)
2173
			</li>
2174
<li>waitForLogMessages
2175
				(
2176
					<a href="#patterns">pattern</a>
2177
				)
2178
			</li>
2179
<li>waitForNotLogMessages
2180
				(
2181
					<a href="#patterns">pattern</a>
2182
				)
2183
			</li>
2184
</ul>
2185
</dd>
2186
<br>
2187
<dt>
2188
<strong><a name="storePrompt"></a>storePrompt
2189
 
2190
		(
2191
 
2192
			variableName
2193
		)
2194
 
2195
	</strong>
2196
</dt>
2197
<dd>Retrieves the message of a JavaScript question prompt dialog generated during
2198
the previous action.
2199
 
2200
<p>Successful handling of the prompt requires prior execution of the
2201
answerOnNextPrompt command. If a prompt is generated but you
2202
do not get/verify it, the next Selenium action will fail.</p>
2203
<p>NOTE: under Selenium, JavaScript prompts will NOT pop up a visible
2204
dialog.</p>
2205
<p>NOTE: Selenium does NOT support JavaScript prompts that are generated in a
2206
page's onload() event handler. In this case a visible dialog WILL be
2207
generated and Selenium will hang until someone manually clicks OK.</p>
2208
<p>
2209
<dl>
2210
<dt>Returns: </dt>
2211
<dd>the message of the most recent JavaScript question prompt</dd>
2212
</dl>
2213
</p>
2214
<p>Related Assertions, automatically generated:</p>
2215
<ul>
2216
<li>assertPrompt
2217
				(
2218
					<a href="#patterns">pattern</a>
2219
				)
2220
			</li>
2221
<li>assertNotPrompt
2222
				(
2223
					<a href="#patterns">pattern</a>
2224
				)
2225
			</li>
2226
<li>verifyPrompt
2227
				(
2228
					<a href="#patterns">pattern</a>
2229
				)
2230
			</li>
2231
<li>verifyNotPrompt
2232
				(
2233
					<a href="#patterns">pattern</a>
2234
				)
2235
			</li>
2236
<li>waitForPrompt
2237
				(
2238
					<a href="#patterns">pattern</a>
2239
				)
2240
			</li>
2241
<li>waitForNotPrompt
2242
				(
2243
					<a href="#patterns">pattern</a>
2244
				)
2245
			</li>
2246
</ul>
2247
</dd>
2248
<br>
2249
<dt>
2250
<strong><a name="storeSelectedId"></a>storeSelectedId
2251
 
2252
		(
2253
			selectLocator,
2254
 
2255
			variableName
2256
		)
2257
 
2258
	</strong>
2259
</dt>
2260
<dd>Gets option element ID for selected option in the specified select element.<p>Arguments:</p>
2261
<ul>
2262
<li>selectLocator - an <a href="#locators">element locator</a> identifying a drop-down menu</li>
2263
<li>variableName -
2264
                    the name of a <a href="#storedVars">variable</a> in which the result is to be stored.
2265
                </li>
2266
</ul>
2267
<p>
2268
<dl>
2269
<dt>Returns: </dt>
2270
<dd>the selected option ID in the specified select drop-down</dd>
2271
</dl>
2272
</p>
2273
<p>Related Assertions, automatically generated:</p>
2274
<ul>
2275
<li>assertSelectedId
2276
				(
2277
					selectLocator, <a href="#patterns">pattern</a>
2278
				)
2279
			</li>
2280
<li>assertNotSelectedId
2281
				(
2282
					selectLocator, <a href="#patterns">pattern</a>
2283
				)
2284
			</li>
2285
<li>verifySelectedId
2286
				(
2287
					selectLocator, <a href="#patterns">pattern</a>
2288
				)
2289
			</li>
2290
<li>verifyNotSelectedId
2291
				(
2292
					selectLocator, <a href="#patterns">pattern</a>
2293
				)
2294
			</li>
2295
<li>waitForSelectedId
2296
				(
2297
					selectLocator, <a href="#patterns">pattern</a>
2298
				)
2299
			</li>
2300
<li>waitForNotSelectedId
2301
				(
2302
					selectLocator, <a href="#patterns">pattern</a>
2303
				)
2304
			</li>
2305
</ul>
2306
</dd>
2307
<br>
2308
<dt>
2309
<strong><a name="storeSelectedIds"></a>storeSelectedIds
2310
 
2311
		(
2312
			selectLocator,
2313
 
2314
			variableName
2315
		)
2316
 
2317
	</strong>
2318
</dt>
2319
<dd>Gets all option element IDs for selected options in the specified select or multi-select element.<p>Arguments:</p>
2320
<ul>
2321
<li>selectLocator - an <a href="#locators">element locator</a> identifying a drop-down menu</li>
2322
<li>variableName -
2323
                    the name of a <a href="#storedVars">variable</a> in which the result is to be stored.
2324
                </li>
2325
</ul>
2326
<p>
2327
<dl>
2328
<dt>Returns: </dt>
2329
<dd>an array of all selected option IDs in the specified select drop-down</dd>
2330
</dl>
2331
</p>
2332
<p>Related Assertions, automatically generated:</p>
2333
<ul>
2334
<li>assertSelectedIds
2335
				(
2336
					selectLocator, <a href="#patterns">pattern</a>
2337
				)
2338
			</li>
2339
<li>assertNotSelectedIds
2340
				(
2341
					selectLocator, <a href="#patterns">pattern</a>
2342
				)
2343
			</li>
2344
<li>verifySelectedIds
2345
				(
2346
					selectLocator, <a href="#patterns">pattern</a>
2347
				)
2348
			</li>
2349
<li>verifyNotSelectedIds
2350
				(
2351
					selectLocator, <a href="#patterns">pattern</a>
2352
				)
2353
			</li>
2354
<li>waitForSelectedIds
2355
				(
2356
					selectLocator, <a href="#patterns">pattern</a>
2357
				)
2358
			</li>
2359
<li>waitForNotSelectedIds
2360
				(
2361
					selectLocator, <a href="#patterns">pattern</a>
2362
				)
2363
			</li>
2364
</ul>
2365
</dd>
2366
<br>
2367
<dt>
2368
<strong><a name="storeSelectedIndex"></a>storeSelectedIndex
2369
 
2370
		(
2371
			selectLocator,
2372
 
2373
			variableName
2374
		)
2375
 
2376
	</strong>
2377
</dt>
2378
<dd>Gets option index (option number, starting at 0) for selected option in the specified select element.<p>Arguments:</p>
2379
<ul>
2380
<li>selectLocator - an <a href="#locators">element locator</a> identifying a drop-down menu</li>
2381
<li>variableName -
2382
                    the name of a <a href="#storedVars">variable</a> in which the result is to be stored.
2383
                </li>
2384
</ul>
2385
<p>
2386
<dl>
2387
<dt>Returns: </dt>
2388
<dd>the selected option index in the specified select drop-down</dd>
2389
</dl>
2390
</p>
2391
<p>Related Assertions, automatically generated:</p>
2392
<ul>
2393
<li>assertSelectedIndex
2394
				(
2395
					selectLocator, <a href="#patterns">pattern</a>
2396
				)
2397
			</li>
2398
<li>assertNotSelectedIndex
2399
				(
2400
					selectLocator, <a href="#patterns">pattern</a>
2401
				)
2402
			</li>
2403
<li>verifySelectedIndex
2404
				(
2405
					selectLocator, <a href="#patterns">pattern</a>
2406
				)
2407
			</li>
2408
<li>verifyNotSelectedIndex
2409
				(
2410
					selectLocator, <a href="#patterns">pattern</a>
2411
				)
2412
			</li>
2413
<li>waitForSelectedIndex
2414
				(
2415
					selectLocator, <a href="#patterns">pattern</a>
2416
				)
2417
			</li>
2418
<li>waitForNotSelectedIndex
2419
				(
2420
					selectLocator, <a href="#patterns">pattern</a>
2421
				)
2422
			</li>
2423
</ul>
2424
</dd>
2425
<br>
2426
<dt>
2427
<strong><a name="storeSelectedIndexes"></a>storeSelectedIndexes
2428
 
2429
		(
2430
			selectLocator,
2431
 
2432
			variableName
2433
		)
2434
 
2435
	</strong>
2436
</dt>
2437
<dd>Gets all option indexes (option number, starting at 0) for selected options in the specified select or multi-select element.<p>Arguments:</p>
2438
<ul>
2439
<li>selectLocator - an <a href="#locators">element locator</a> identifying a drop-down menu</li>
2440
<li>variableName -
2441
                    the name of a <a href="#storedVars">variable</a> in which the result is to be stored.
2442
                </li>
2443
</ul>
2444
<p>
2445
<dl>
2446
<dt>Returns: </dt>
2447
<dd>an array of all selected option indexes in the specified select drop-down</dd>
2448
</dl>
2449
</p>
2450
<p>Related Assertions, automatically generated:</p>
2451
<ul>
2452
<li>assertSelectedIndexes
2453
				(
2454
					selectLocator, <a href="#patterns">pattern</a>
2455
				)
2456
			</li>
2457
<li>assertNotSelectedIndexes
2458
				(
2459
					selectLocator, <a href="#patterns">pattern</a>
2460
				)
2461
			</li>
2462
<li>verifySelectedIndexes
2463
				(
2464
					selectLocator, <a href="#patterns">pattern</a>
2465
				)
2466
			</li>
2467
<li>verifyNotSelectedIndexes
2468
				(
2469
					selectLocator, <a href="#patterns">pattern</a>
2470
				)
2471
			</li>
2472
<li>waitForSelectedIndexes
2473
				(
2474
					selectLocator, <a href="#patterns">pattern</a>
2475
				)
2476
			</li>
2477
<li>waitForNotSelectedIndexes
2478
				(
2479
					selectLocator, <a href="#patterns">pattern</a>
2480
				)
2481
			</li>
2482
</ul>
2483
</dd>
2484
<br>
2485
<dt>
2486
<strong><a name="storeSelectedLabel"></a>storeSelectedLabel
2487
 
2488
		(
2489
			selectLocator,
2490
 
2491
			variableName
2492
		)
2493
 
2494
	</strong>
2495
</dt>
2496
<dd>Gets option label (visible text) for selected option in the specified select element.<p>Arguments:</p>
2497
<ul>
2498
<li>selectLocator - an <a href="#locators">element locator</a> identifying a drop-down menu</li>
2499
<li>variableName -
2500
                    the name of a <a href="#storedVars">variable</a> in which the result is to be stored.
2501
                </li>
2502
</ul>
2503
<p>
2504
<dl>
2505
<dt>Returns: </dt>
2506
<dd>the selected option label in the specified select drop-down</dd>
2507
</dl>
2508
</p>
2509
<p>Related Assertions, automatically generated:</p>
2510
<ul>
2511
<li>assertSelectedLabel
2512
				(
2513
					selectLocator, <a href="#patterns">pattern</a>
2514
				)
2515
			</li>
2516
<li>assertNotSelectedLabel
2517
				(
2518
					selectLocator, <a href="#patterns">pattern</a>
2519
				)
2520
			</li>
2521
<li>verifySelectedLabel
2522
				(
2523
					selectLocator, <a href="#patterns">pattern</a>
2524
				)
2525
			</li>
2526
<li>verifyNotSelectedLabel
2527
				(
2528
					selectLocator, <a href="#patterns">pattern</a>
2529
				)
2530
			</li>
2531
<li>waitForSelectedLabel
2532
				(
2533
					selectLocator, <a href="#patterns">pattern</a>
2534
				)
2535
			</li>
2536
<li>waitForNotSelectedLabel
2537
				(
2538
					selectLocator, <a href="#patterns">pattern</a>
2539
				)
2540
			</li>
2541
</ul>
2542
</dd>
2543
<br>
2544
<dt>
2545
<strong><a name="storeSelectedLabels"></a>storeSelectedLabels
2546
 
2547
		(
2548
			selectLocator,
2549
 
2550
			variableName
2551
		)
2552
 
2553
	</strong>
2554
</dt>
2555
<dd>Gets all option labels (visible text) for selected options in the specified select or multi-select element.<p>Arguments:</p>
2556
<ul>
2557
<li>selectLocator - an <a href="#locators">element locator</a> identifying a drop-down menu</li>
2558
<li>variableName -
2559
                    the name of a <a href="#storedVars">variable</a> in which the result is to be stored.
2560
                </li>
2561
</ul>
2562
<p>
2563
<dl>
2564
<dt>Returns: </dt>
2565
<dd>an array of all selected option labels in the specified select drop-down</dd>
2566
</dl>
2567
</p>
2568
<p>Related Assertions, automatically generated:</p>
2569
<ul>
2570
<li>assertSelectedLabels
2571
				(
2572
					selectLocator, <a href="#patterns">pattern</a>
2573
				)
2574
			</li>
2575
<li>assertNotSelectedLabels
2576
				(
2577
					selectLocator, <a href="#patterns">pattern</a>
2578
				)
2579
			</li>
2580
<li>verifySelectedLabels
2581
				(
2582
					selectLocator, <a href="#patterns">pattern</a>
2583
				)
2584
			</li>
2585
<li>verifyNotSelectedLabels
2586
				(
2587
					selectLocator, <a href="#patterns">pattern</a>
2588
				)
2589
			</li>
2590
<li>waitForSelectedLabels
2591
				(
2592
					selectLocator, <a href="#patterns">pattern</a>
2593
				)
2594
			</li>
2595
<li>waitForNotSelectedLabels
2596
				(
2597
					selectLocator, <a href="#patterns">pattern</a>
2598
				)
2599
			</li>
2600
</ul>
2601
</dd>
2602
<br>
2603
<dt>
2604
<strong><a name="storeSelectedValue"></a>storeSelectedValue
2605
 
2606
		(
2607
			selectLocator,
2608
 
2609
			variableName
2610
		)
2611
 
2612
	</strong>
2613
</dt>
2614
<dd>Gets option value (value attribute) for selected option in the specified select element.<p>Arguments:</p>
2615
<ul>
2616
<li>selectLocator - an <a href="#locators">element locator</a> identifying a drop-down menu</li>
2617
<li>variableName -
2618
                    the name of a <a href="#storedVars">variable</a> in which the result is to be stored.
2619
                </li>
2620
</ul>
2621
<p>
2622
<dl>
2623
<dt>Returns: </dt>
2624
<dd>the selected option value in the specified select drop-down</dd>
2625
</dl>
2626
</p>
2627
<p>Related Assertions, automatically generated:</p>
2628
<ul>
2629
<li>assertSelectedValue
2630
				(
2631
					selectLocator, <a href="#patterns">pattern</a>
2632
				)
2633
			</li>
2634
<li>assertNotSelectedValue
2635
				(
2636
					selectLocator, <a href="#patterns">pattern</a>
2637
				)
2638
			</li>
2639
<li>verifySelectedValue
2640
				(
2641
					selectLocator, <a href="#patterns">pattern</a>
2642
				)
2643
			</li>
2644
<li>verifyNotSelectedValue
2645
				(
2646
					selectLocator, <a href="#patterns">pattern</a>
2647
				)
2648
			</li>
2649
<li>waitForSelectedValue
2650
				(
2651
					selectLocator, <a href="#patterns">pattern</a>
2652
				)
2653
			</li>
2654
<li>waitForNotSelectedValue
2655
				(
2656
					selectLocator, <a href="#patterns">pattern</a>
2657
				)
2658
			</li>
2659
</ul>
2660
</dd>
2661
<br>
2662
<dt>
2663
<strong><a name="storeSelectedValues"></a>storeSelectedValues
2664
 
2665
		(
2666
			selectLocator,
2667
 
2668
			variableName
2669
		)
2670
 
2671
	</strong>
2672
</dt>
2673
<dd>Gets all option values (value attributes) for selected options in the specified select or multi-select element.<p>Arguments:</p>
2674
<ul>
2675
<li>selectLocator - an <a href="#locators">element locator</a> identifying a drop-down menu</li>
2676
<li>variableName -
2677
                    the name of a <a href="#storedVars">variable</a> in which the result is to be stored.
2678
                </li>
2679
</ul>
2680
<p>
2681
<dl>
2682
<dt>Returns: </dt>
2683
<dd>an array of all selected option values in the specified select drop-down</dd>
2684
</dl>
2685
</p>
2686
<p>Related Assertions, automatically generated:</p>
2687
<ul>
2688
<li>assertSelectedValues
2689
				(
2690
					selectLocator, <a href="#patterns">pattern</a>
2691
				)
2692
			</li>
2693
<li>assertNotSelectedValues
2694
				(
2695
					selectLocator, <a href="#patterns">pattern</a>
2696
				)
2697
			</li>
2698
<li>verifySelectedValues
2699
				(
2700
					selectLocator, <a href="#patterns">pattern</a>
2701
				)
2702
			</li>
2703
<li>verifyNotSelectedValues
2704
				(
2705
					selectLocator, <a href="#patterns">pattern</a>
2706
				)
2707
			</li>
2708
<li>waitForSelectedValues
2709
				(
2710
					selectLocator, <a href="#patterns">pattern</a>
2711
				)
2712
			</li>
2713
<li>waitForNotSelectedValues
2714
				(
2715
					selectLocator, <a href="#patterns">pattern</a>
2716
				)
2717
			</li>
2718
</ul>
2719
</dd>
2720
<br>
2721
<dt>
2722
<strong><a name="storeSelectOptions"></a>storeSelectOptions
2723
 
2724
		(
2725
			selectLocator,
2726
 
2727
			variableName
2728
		)
2729
 
2730
	</strong>
2731
</dt>
2732
<dd>Gets all option labels in the specified select drop-down.<p>Arguments:</p>
2733
<ul>
2734
<li>selectLocator - an <a href="#locators">element locator</a> identifying a drop-down menu</li>
2735
<li>variableName -
2736
                    the name of a <a href="#storedVars">variable</a> in which the result is to be stored.
2737
                </li>
2738
</ul>
2739
<p>
2740
<dl>
2741
<dt>Returns: </dt>
2742
<dd>an array of all option labels in the specified select drop-down</dd>
2743
</dl>
2744
</p>
2745
<p>Related Assertions, automatically generated:</p>
2746
<ul>
2747
<li>assertSelectOptions
2748
				(
2749
					selectLocator, <a href="#patterns">pattern</a>
2750
				)
2751
			</li>
2752
<li>assertNotSelectOptions
2753
				(
2754
					selectLocator, <a href="#patterns">pattern</a>
2755
				)
2756
			</li>
2757
<li>verifySelectOptions
2758
				(
2759
					selectLocator, <a href="#patterns">pattern</a>
2760
				)
2761
			</li>
2762
<li>verifyNotSelectOptions
2763
				(
2764
					selectLocator, <a href="#patterns">pattern</a>
2765
				)
2766
			</li>
2767
<li>waitForSelectOptions
2768
				(
2769
					selectLocator, <a href="#patterns">pattern</a>
2770
				)
2771
			</li>
2772
<li>waitForNotSelectOptions
2773
				(
2774
					selectLocator, <a href="#patterns">pattern</a>
2775
				)
2776
			</li>
2777
</ul>
2778
</dd>
2779
<br>
2780
<dt>
2781
<strong><a name="storeTable"></a>storeTable
2782
 
2783
		(
2784
			tableCellAddress,
2785
 
2786
			variableName
2787
		)
2788
 
2789
	</strong>
2790
</dt>
2791
<dd>Gets the text from a cell of a table. The cellAddress syntax
2792
tableLocator.row.column, where row and column start at 0.<p>Arguments:</p>
2793
<ul>
2794
<li>tableCellAddress - a cell address, e.g. "foo.1.4"</li>
2795
<li>variableName -
2796
                    the name of a <a href="#storedVars">variable</a> in which the result is to be stored.
2797
                </li>
2798
</ul>
2799
<p>
2800
<dl>
2801
<dt>Returns: </dt>
2802
<dd>the text from the specified cell</dd>
2803
</dl>
2804
</p>
2805
<p>Related Assertions, automatically generated:</p>
2806
<ul>
2807
<li>assertTable
2808
				(
2809
					tableCellAddress, <a href="#patterns">pattern</a>
2810
				)
2811
			</li>
2812
<li>assertNotTable
2813
				(
2814
					tableCellAddress, <a href="#patterns">pattern</a>
2815
				)
2816
			</li>
2817
<li>verifyTable
2818
				(
2819
					tableCellAddress, <a href="#patterns">pattern</a>
2820
				)
2821
			</li>
2822
<li>verifyNotTable
2823
				(
2824
					tableCellAddress, <a href="#patterns">pattern</a>
2825
				)
2826
			</li>
2827
<li>waitForTable
2828
				(
2829
					tableCellAddress, <a href="#patterns">pattern</a>
2830
				)
2831
			</li>
2832
<li>waitForNotTable
2833
				(
2834
					tableCellAddress, <a href="#patterns">pattern</a>
2835
				)
2836
			</li>
2837
</ul>
2838
</dd>
2839
<br>
2840
<dt>
2841
<strong><a name="storeText"></a>storeText
2842
 
2843
		(
2844
			locator,
2845
 
2846
			variableName
2847
		)
2848
 
2849
	</strong>
2850
</dt>
2851
<dd>Gets the text of an element. This works for any element that contains
2852
text. This command uses either the textContent (Mozilla-like browsers) or
2853
the innerText (IE-like browsers) of the element, which is the rendered
2854
text shown to the user.<p>Arguments:</p>
2855
<ul>
2856
<li>locator - an <a href="#locators">element locator</a>
2857
</li>
2858
<li>variableName -
2859
                    the name of a <a href="#storedVars">variable</a> in which the result is to be stored.
2860
                </li>
2861
</ul>
2862
<p>
2863
<dl>
2864
<dt>Returns: </dt>
2865
<dd>the text of the element</dd>
2866
</dl>
2867
</p>
2868
<p>Related Assertions, automatically generated:</p>
2869
<ul>
2870
<li>assertText
2871
				(
2872
					locator, <a href="#patterns">pattern</a>
2873
				)
2874
			</li>
2875
<li>assertNotText
2876
				(
2877
					locator, <a href="#patterns">pattern</a>
2878
				)
2879
			</li>
2880
<li>verifyText
2881
				(
2882
					locator, <a href="#patterns">pattern</a>
2883
				)
2884
			</li>
2885
<li>verifyNotText
2886
				(
2887
					locator, <a href="#patterns">pattern</a>
2888
				)
2889
			</li>
2890
<li>waitForText
2891
				(
2892
					locator, <a href="#patterns">pattern</a>
2893
				)
2894
			</li>
2895
<li>waitForNotText
2896
				(
2897
					locator, <a href="#patterns">pattern</a>
2898
				)
2899
			</li>
2900
</ul>
2901
</dd>
2902
<br>
2903
<dt>
2904
<strong><a name="storeTitle"></a>storeTitle
2905
 
2906
		(
2907
 
2908
			variableName
2909
		)
2910
 
2911
	</strong>
2912
</dt>
2913
<dd>Gets the title of the current page.<p>
2914
<dl>
2915
<dt>Returns: </dt>
2916
<dd>the title of the current page</dd>
2917
</dl>
2918
</p>
2919
<p>Related Assertions, automatically generated:</p>
2920
<ul>
2921
<li>assertTitle
2922
				(
2923
					<a href="#patterns">pattern</a>
2924
				)
2925
			</li>
2926
<li>assertNotTitle
2927
				(
2928
					<a href="#patterns">pattern</a>
2929
				)
2930
			</li>
2931
<li>verifyTitle
2932
				(
2933
					<a href="#patterns">pattern</a>
2934
				)
2935
			</li>
2936
<li>verifyNotTitle
2937
				(
2938
					<a href="#patterns">pattern</a>
2939
				)
2940
			</li>
2941
<li>waitForTitle
2942
				(
2943
					<a href="#patterns">pattern</a>
2944
				)
2945
			</li>
2946
<li>waitForNotTitle
2947
				(
2948
					<a href="#patterns">pattern</a>
2949
				)
2950
			</li>
2951
</ul>
2952
</dd>
2953
<br>
2954
<dt>
2955
<strong><a name="storeValue"></a>storeValue
2956
 
2957
		(
2958
			locator,
2959
 
2960
			variableName
2961
		)
2962
 
2963
	</strong>
2964
</dt>
2965
<dd>Gets the (whitespace-trimmed) value of an input field (or anything else with a value parameter).
2966
For checkbox/radio elements, the value will be "on" or "off" depending on
2967
whether the element is checked or not.<p>Arguments:</p>
2968
<ul>
2969
<li>locator - an <a href="#locators">element locator</a>
2970
</li>
2971
<li>variableName -
2972
                    the name of a <a href="#storedVars">variable</a> in which the result is to be stored.
2973
                </li>
2974
</ul>
2975
<p>
2976
<dl>
2977
<dt>Returns: </dt>
2978
<dd>the element value, or "on/off" for checkbox/radio elements</dd>
2979
</dl>
2980
</p>
2981
<p>Related Assertions, automatically generated:</p>
2982
<ul>
2983
<li>assertValue
2984
				(
2985
					locator, <a href="#patterns">pattern</a>
2986
				)
2987
			</li>
2988
<li>assertNotValue
2989
				(
2990
					locator, <a href="#patterns">pattern</a>
2991
				)
2992
			</li>
2993
<li>verifyValue
2994
				(
2995
					locator, <a href="#patterns">pattern</a>
2996
				)
2997
			</li>
2998
<li>verifyNotValue
2999
				(
3000
					locator, <a href="#patterns">pattern</a>
3001
				)
3002
			</li>
3003
<li>waitForValue
3004
				(
3005
					locator, <a href="#patterns">pattern</a>
3006
				)
3007
			</li>
3008
<li>waitForNotValue
3009
				(
3010
					locator, <a href="#patterns">pattern</a>
3011
				)
3012
			</li>
3013
</ul>
3014
</dd>
3015
<br>
3016
<dt>
3017
<strong><a name="storeWhetherThisFrameMatchFrameExpression"></a>storeWhetherThisFrameMatchFrameExpression
3018
 
3019
		(
3020
			currentFrameString,
3021
target,
3022
 
3023
			variableName
3024
		)
3025
 
3026
	</strong>
3027
</dt>
3028
<dd>Determine whether current/locator identify the frame containing this running code.
3029
 
3030
<p>This is useful in proxy injection mode, where this code runs in every
3031
browser frame and window, and sometimes the selenium server needs to identify
3032
the "current" frame.  In this case, when the test calls selectFrame, this
3033
routine is called for each frame to figure out which one has been selected.
3034
The selected frame will return true, while all others will return false.</p>
3035
<p>Arguments:</p>
3036
<ul>
3037
<li>currentFrameString - starting frame</li>
3038
<li>target - new frame (which might be relative to the current one)</li>
3039
<li>variableName -
3040
                    the name of a <a href="#storedVars">variable</a> in which the result is to be stored.
3041
                </li>
3042
</ul>
3043
<p>
3044
<dl>
3045
<dt>Returns: </dt>
3046
<dd>true if the new frame is this code's window</dd>
3047
</dl>
3048
</p>
3049
<p>Related Assertions, automatically generated:</p>
3050
<ul>
3051
<li>assertWhetherThisFrameMatchFrameExpression
3052
				(
3053
					currentFrameString, target
3054
				)
3055
			</li>
3056
<li>assertNotWhetherThisFrameMatchFrameExpression
3057
				(
3058
					currentFrameString, target
3059
				)
3060
			</li>
3061
<li>verifyWhetherThisFrameMatchFrameExpression
3062
				(
3063
					currentFrameString, target
3064
				)
3065
			</li>
3066
<li>verifyNotWhetherThisFrameMatchFrameExpression
3067
				(
3068
					currentFrameString, target
3069
				)
3070
			</li>
3071
<li>waitForWhetherThisFrameMatchFrameExpression
3072
				(
3073
					currentFrameString, target
3074
				)
3075
			</li>
3076
<li>waitForNotWhetherThisFrameMatchFrameExpression
3077
				(
3078
					currentFrameString, target
3079
				)
3080
			</li>
3081
</ul>
3082
</dd>
3083
<br>
3084
<dt>
3085
<strong><a name="storeAlertPresent"></a>storeAlertPresent
3086
 
3087
		(
3088
 
3089
			variableName
3090
		)
3091
 
3092
	</strong>
3093
</dt>
3094
<dd>Has an alert occurred?
3095
 
3096
<p>
3097
This function never throws an exception
3098
</p>
3099
<p>
3100
<dl>
3101
<dt>Returns: </dt>
3102
<dd>true if there is an alert</dd>
3103
</dl>
3104
</p>
3105
<p>Related Assertions, automatically generated:</p>
3106
<ul>
3107
<li>assertAlertPresent
3108
				(
3109
 
3110
				)
3111
			</li>
3112
<li>assertAlertNotPresent
3113
				(
3114
 
3115
				)
3116
			</li>
3117
<li>verifyAlertPresent
3118
				(
3119
 
3120
				)
3121
			</li>
3122
<li>verifyAlertNotPresent
3123
				(
3124
 
3125
				)
3126
			</li>
3127
<li>waitForAlertPresent
3128
				(
3129
 
3130
				)
3131
			</li>
3132
<li>waitForAlertNotPresent
3133
				(
3134
 
3135
				)
3136
			</li>
3137
</ul>
3138
</dd>
3139
<br>
3140
<dt>
3141
<strong><a name="storeChecked"></a>storeChecked
3142
 
3143
		(
3144
			locator,
3145
 
3146
			variableName
3147
		)
3148
 
3149
	</strong>
3150
</dt>
3151
<dd>Gets whether a toggle-button (checkbox/radio) is checked.  Fails if the specified element doesn't exist or isn't a toggle-button.<p>Arguments:</p>
3152
<ul>
3153
<li>locator - an <a href="#locators">element locator</a> pointing to a checkbox or radio button</li>
3154
<li>variableName -
3155
                    the name of a <a href="#storedVars">variable</a> in which the result is to be stored.
3156
                </li>
3157
</ul>
3158
<p>
3159
<dl>
3160
<dt>Returns: </dt>
3161
<dd>true if the checkbox is checked, false otherwise</dd>
3162
</dl>
3163
</p>
3164
<p>Related Assertions, automatically generated:</p>
3165
<ul>
3166
<li>assertChecked
3167
				(
3168
					locator
3169
				)
3170
			</li>
3171
<li>assertNotChecked
3172
				(
3173
					locator
3174
				)
3175
			</li>
3176
<li>verifyChecked
3177
				(
3178
					locator
3179
				)
3180
			</li>
3181
<li>verifyNotChecked
3182
				(
3183
					locator
3184
				)
3185
			</li>
3186
<li>waitForChecked
3187
				(
3188
					locator
3189
				)
3190
			</li>
3191
<li>waitForNotChecked
3192
				(
3193
					locator
3194
				)
3195
			</li>
3196
</ul>
3197
</dd>
3198
<br>
3199
<dt>
3200
<strong><a name="storeConfirmationPresent"></a>storeConfirmationPresent
3201
 
3202
		(
3203
 
3204
			variableName
3205
		)
3206
 
3207
	</strong>
3208
</dt>
3209
<dd>Has confirm() been called?
3210
 
3211
<p>
3212
This function never throws an exception
3213
</p>
3214
<p>
3215
<dl>
3216
<dt>Returns: </dt>
3217
<dd>true if there is a pending confirmation</dd>
3218
</dl>
3219
</p>
3220
<p>Related Assertions, automatically generated:</p>
3221
<ul>
3222
<li>assertConfirmationPresent
3223
				(
3224
 
3225
				)
3226
			</li>
3227
<li>assertConfirmationNotPresent
3228
				(
3229
 
3230
				)
3231
			</li>
3232
<li>verifyConfirmationPresent
3233
				(
3234
 
3235
				)
3236
			</li>
3237
<li>verifyConfirmationNotPresent
3238
				(
3239
 
3240
				)
3241
			</li>
3242
<li>waitForConfirmationPresent
3243
				(
3244
 
3245
				)
3246
			</li>
3247
<li>waitForConfirmationNotPresent
3248
				(
3249
 
3250
				)
3251
			</li>
3252
</ul>
3253
</dd>
3254
<br>
3255
<dt>
3256
<strong><a name="storeEditable"></a>storeEditable
3257
 
3258
		(
3259
			locator,
3260
 
3261
			variableName
3262
		)
3263
 
3264
	</strong>
3265
</dt>
3266
<dd>Determines whether the specified input element is editable, ie hasn't been disabled.
3267
This method will fail if the specified element isn't an input element.<p>Arguments:</p>
3268
<ul>
3269
<li>locator - an <a href="#locators">element locator</a>
3270
</li>
3271
<li>variableName -
3272
                    the name of a <a href="#storedVars">variable</a> in which the result is to be stored.
3273
                </li>
3274
</ul>
3275
<p>
3276
<dl>
3277
<dt>Returns: </dt>
3278
<dd>true if the input element is editable, false otherwise</dd>
3279
</dl>
3280
</p>
3281
<p>Related Assertions, automatically generated:</p>
3282
<ul>
3283
<li>assertEditable
3284
				(
3285
					locator
3286
				)
3287
			</li>
3288
<li>assertNotEditable
3289
				(
3290
					locator
3291
				)
3292
			</li>
3293
<li>verifyEditable
3294
				(
3295
					locator
3296
				)
3297
			</li>
3298
<li>verifyNotEditable
3299
				(
3300
					locator
3301
				)
3302
			</li>
3303
<li>waitForEditable
3304
				(
3305
					locator
3306
				)
3307
			</li>
3308
<li>waitForNotEditable
3309
				(
3310
					locator
3311
				)
3312
			</li>
3313
</ul>
3314
</dd>
3315
<br>
3316
<dt>
3317
<strong><a name="storeElementPresent"></a>storeElementPresent
3318
 
3319
		(
3320
			locator,
3321
 
3322
			variableName
3323
		)
3324
 
3325
	</strong>
3326
</dt>
3327
<dd>Verifies that the specified element is somewhere on the page.<p>Arguments:</p>
3328
<ul>
3329
<li>locator - an <a href="#locators">element locator</a>
3330
</li>
3331
<li>variableName -
3332
                    the name of a <a href="#storedVars">variable</a> in which the result is to be stored.
3333
                </li>
3334
</ul>
3335
<p>
3336
<dl>
3337
<dt>Returns: </dt>
3338
<dd>true if the element is present, false otherwise</dd>
3339
</dl>
3340
</p>
3341
<p>Related Assertions, automatically generated:</p>
3342
<ul>
3343
<li>assertElementPresent
3344
				(
3345
					locator
3346
				)
3347
			</li>
3348
<li>assertElementNotPresent
3349
				(
3350
					locator
3351
				)
3352
			</li>
3353
<li>verifyElementPresent
3354
				(
3355
					locator
3356
				)
3357
			</li>
3358
<li>verifyElementNotPresent
3359
				(
3360
					locator
3361
				)
3362
			</li>
3363
<li>waitForElementPresent
3364
				(
3365
					locator
3366
				)
3367
			</li>
3368
<li>waitForElementNotPresent
3369
				(
3370
					locator
3371
				)
3372
			</li>
3373
</ul>
3374
</dd>
3375
<br>
3376
<dt>
3377
<strong><a name="storeOrdered"></a>storeOrdered
3378
 
3379
		(
3380
			locator1,
3381
locator2,
3382
 
3383
			variableName
3384
		)
3385
 
3386
	</strong>
3387
</dt>
3388
<dd>Check if these two elements have same parent and are ordered. Two same elements will
3389
not be considered ordered.<p>Arguments:</p>
3390
<ul>
3391
<li>locator1 - an <a href="#locators">element locator</a> pointing to the first element</li>
3392
<li>locator2 - an <a href="#locators">element locator</a> pointing to the second element</li>
3393
<li>variableName -
3394
                    the name of a <a href="#storedVars">variable</a> in which the result is to be stored.
3395
                </li>
3396
</ul>
3397
<p>
3398
<dl>
3399
<dt>Returns: </dt>
3400
<dd>true if two elements are ordered and have same parent, false otherwise</dd>
3401
</dl>
3402
</p>
3403
<p>Related Assertions, automatically generated:</p>
3404
<ul>
3405
<li>assertOrdered
3406
				(
3407
					locator1, locator2
3408
				)
3409
			</li>
3410
<li>assertNotOrdered
3411
				(
3412
					locator1, locator2
3413
				)
3414
			</li>
3415
<li>verifyOrdered
3416
				(
3417
					locator1, locator2
3418
				)
3419
			</li>
3420
<li>verifyNotOrdered
3421
				(
3422
					locator1, locator2
3423
				)
3424
			</li>
3425
<li>waitForOrdered
3426
				(
3427
					locator1, locator2
3428
				)
3429
			</li>
3430
<li>waitForNotOrdered
3431
				(
3432
					locator1, locator2
3433
				)
3434
			</li>
3435
</ul>
3436
</dd>
3437
<br>
3438
<dt>
3439
<strong><a name="storePromptPresent"></a>storePromptPresent
3440
 
3441
		(
3442
 
3443
			variableName
3444
		)
3445
 
3446
	</strong>
3447
</dt>
3448
<dd>Has a prompt occurred?
3449
 
3450
<p>
3451
This function never throws an exception
3452
</p>
3453
<p>
3454
<dl>
3455
<dt>Returns: </dt>
3456
<dd>true if there is a pending prompt</dd>
3457
</dl>
3458
</p>
3459
<p>Related Assertions, automatically generated:</p>
3460
<ul>
3461
<li>assertPromptPresent
3462
				(
3463
 
3464
				)
3465
			</li>
3466
<li>assertPromptNotPresent
3467
				(
3468
 
3469
				)
3470
			</li>
3471
<li>verifyPromptPresent
3472
				(
3473
 
3474
				)
3475
			</li>
3476
<li>verifyPromptNotPresent
3477
				(
3478
 
3479
				)
3480
			</li>
3481
<li>waitForPromptPresent
3482
				(
3483
 
3484
				)
3485
			</li>
3486
<li>waitForPromptNotPresent
3487
				(
3488
 
3489
				)
3490
			</li>
3491
</ul>
3492
</dd>
3493
<br>
3494
<dt>
3495
<strong><a name="storeSomethingSelected"></a>storeSomethingSelected
3496
 
3497
		(
3498
			selectLocator,
3499
 
3500
			variableName
3501
		)
3502
 
3503
	</strong>
3504
</dt>
3505
<dd>Determines whether some option in a drop-down menu is selected.<p>Arguments:</p>
3506
<ul>
3507
<li>selectLocator - an <a href="#locators">element locator</a> identifying a drop-down menu</li>
3508
<li>variableName -
3509
                    the name of a <a href="#storedVars">variable</a> in which the result is to be stored.
3510
                </li>
3511
</ul>
3512
<p>
3513
<dl>
3514
<dt>Returns: </dt>
3515
<dd>true if some option has been selected, false otherwise</dd>
3516
</dl>
3517
</p>
3518
<p>Related Assertions, automatically generated:</p>
3519
<ul>
3520
<li>assertSomethingSelected
3521
				(
3522
					selectLocator
3523
				)
3524
			</li>
3525
<li>assertNotSomethingSelected
3526
				(
3527
					selectLocator
3528
				)
3529
			</li>
3530
<li>verifySomethingSelected
3531
				(
3532
					selectLocator
3533
				)
3534
			</li>
3535
<li>verifyNotSomethingSelected
3536
				(
3537
					selectLocator
3538
				)
3539
			</li>
3540
<li>waitForSomethingSelected
3541
				(
3542
					selectLocator
3543
				)
3544
			</li>
3545
<li>waitForNotSomethingSelected
3546
				(
3547
					selectLocator
3548
				)
3549
			</li>
3550
</ul>
3551
</dd>
3552
<br>
3553
<dt>
3554
<strong><a name="storeTextPresent"></a>storeTextPresent
3555
 
3556
		(
3557
			pattern,
3558
 
3559
			variableName
3560
		)
3561
 
3562
	</strong>
3563
</dt>
3564
<dd>Verifies that the specified text pattern appears somewhere on the rendered page shown to the user.<p>Arguments:</p>
3565
<ul>
3566
<li>pattern - a <a href="#patterns">pattern</a> to match with the text of the page</li>
3567
<li>variableName -
3568
                    the name of a <a href="#storedVars">variable</a> in which the result is to be stored.
3569
                </li>
3570
</ul>
3571
<p>
3572
<dl>
3573
<dt>Returns: </dt>
3574
<dd>true if the pattern matches the text, false otherwise</dd>
3575
</dl>
3576
</p>
3577
<p>Related Assertions, automatically generated:</p>
3578
<ul>
3579
<li>assertTextPresent
3580
				(
3581
					pattern
3582
				)
3583
			</li>
3584
<li>assertTextNotPresent
3585
				(
3586
					pattern
3587
				)
3588
			</li>
3589
<li>verifyTextPresent
3590
				(
3591
					pattern
3592
				)
3593
			</li>
3594
<li>verifyTextNotPresent
3595
				(
3596
					pattern
3597
				)
3598
			</li>
3599
<li>waitForTextPresent
3600
				(
3601
					pattern
3602
				)
3603
			</li>
3604
<li>waitForTextNotPresent
3605
				(
3606
					pattern
3607
				)
3608
			</li>
3609
</ul>
3610
</dd>
3611
<br>
3612
<dt>
3613
<strong><a name="storeVisible"></a>storeVisible
3614
 
3615
		(
3616
			locator,
3617
 
3618
			variableName
3619
		)
3620
 
3621
	</strong>
3622
</dt>
3623
<dd>Determines if the specified element is visible. An
3624
element can be rendered invisible by setting the CSS "visibility"
3625
property to "hidden", or the "display" property to "none", either for the
3626
element itself or one if its ancestors.  This method will fail if
3627
the element is not present.<p>Arguments:</p>
3628
<ul>
3629
<li>locator - an <a href="#locators">element locator</a>
3630
</li>
3631
<li>variableName -
3632
                    the name of a <a href="#storedVars">variable</a> in which the result is to be stored.
3633
                </li>
3634
</ul>
3635
<p>
3636
<dl>
3637
<dt>Returns: </dt>
3638
<dd>true if the specified element is visible, false otherwise</dd>
3639
</dl>
3640
</p>
3641
<p>Related Assertions, automatically generated:</p>
3642
<ul>
3643
<li>assertVisible
3644
				(
3645
					locator
3646
				)
3647
			</li>
3648
<li>assertNotVisible
3649
				(
3650
					locator
3651
				)
3652
			</li>
3653
<li>verifyVisible
3654
				(
3655
					locator
3656
				)
3657
			</li>
3658
<li>verifyNotVisible
3659
				(
3660
					locator
3661
				)
3662
			</li>
3663
<li>waitForVisible
3664
				(
3665
					locator
3666
				)
3667
			</li>
3668
<li>waitForNotVisible
3669
				(
3670
					locator
3671
				)
3672
			</li>
3673
</ul>
3674
</dd>
3675
<br>
3676
</dl>
3677
<h2>
3678
<a name="parameter-construction-and-variables">Parameter construction and Variables</a>
3679
</h2>
3680
<blockquote>
3681
<p>All Selenium command parameters can be constructed using both simple
3682
	variable substitution as well as full javascript. Both of these
3683
	mechanisms can access previously stored variables, but do so using
3684
	different syntax.</p>
3685
<p>
3686
<a name="storedVars"></a><strong>Stored Variables</strong>
3687
</p>
3688
<p>The commands <em>store</em>, <em>storeValue</em> and <em>storeText</em> can be used to store a variable
3689
	value for later access. Internally, these variables are stored in a map called "storedVars",
3690
	with values keyed by the variable name. These commands are documented in the command reference.</p>
3691
<p>
3692
<strong>Variable substitution</strong>
3693
</p>
3694
<p>Variable substitution provides a simple way to include a previously stored variable in a
3695
	command parameter. This is a simple mechanism, by which the variable to substitute is indicated
3696
	by ${variableName}. Multiple variables can be substituted, and intermixed with static text.</p>
3697
<p>Example:</p>
3698
<blockquote>
3699
<table border="1" class="table">
3700
<colgroup>
3701
<col width="18%">
3702
<col width="36%">
3703
<col width="45%">
3704
</colgroup>
3705
<tbody valign="top">
3706
<tr>
3707
<td>store</td><td>Mr</td><td>title</td>
3708
</tr>
3709
<tr>
3710
<td>storeValue</td><td>nameField</td><td>surname</td>
3711
</tr>
3712
<tr>
3713
<td>store</td><td>${title} ${surname}</td><td>fullname</td>
3714
</tr>
3715
<tr>
3716
<td>type</td><td>textElement</td><td>Full name is: ${fullname}</td>
3717
</tr>
3718
</tbody>
3719
</table>
3720
</blockquote>
3721
<p>
3722
<strong>Javascript evaluation</strong>
3723
</p>
3724
<p>Javascript evaluation provides the full power of javascript in constructing a command parameter.
3725
	To use this mechanism, the <em>entire</em> parameter value must be prefixed by
3726
	'javascript{' with a trailing '}'. The text inside the braces is evaluated as a javascript expression,
3727
	and can access previously stored variables using the <em>storedVars</em> map detailed above.
3728
	Note that variable substitution cannot be combined with javascript evaluation.</p>
3729
<p>Example:</p>
3730
<blockquote>
3731
<table border="1" class="table">
3732
<colgroup>
3733
<col width="9%">
3734
<col width="44%">
3735
<col width="46%">
3736
</colgroup>
3737
<tbody valign="top">
3738
<tr>
3739
<td>store</td><td>javascript{'merchant' + (new Date()).getTime()}</td><td>merchantId</td>
3740
</tr>
3741
<tr>
3742
<td>type</td><td>textElement</td><td>javascript{storedVars['merchantId'].toUpperCase()}</td>
3743
</tr>
3744
</tbody>
3745
</table>
3746
</blockquote>
3747
</blockquote>
3748
<div class="section" id="extending-selenium">
3749
<h2>
3750
<a name="extending-selenium">Extending Selenium</a>
3751
</h2>
3752
<blockquote>
3753
<p>It can be quite simple to extend Selenium, adding your own actions, assertions and locator-strategies.
3754
	This is done with javascript by adding methods to the Selenium object prototype, and the PageBot
3755
	object prototype. On startup, Selenium will automatically look through methods on these prototypes,
3756
	using name patterns to recognise which ones are actions, assertions and locators.</p>
3757
<p>The following examples try to give an indication of how Selenium can be extended with javascript.</p>
3758
</blockquote>
3759
<p>
3760
<strong>Actions</strong>
3761
</p>
3762
<blockquote>
3763
<p>All <em>doFoo</em> methods on the Selenium prototype are added as actions. For each action <em>foo</em> there
3764
	is also an action <em>fooAndWait</em> registered. An action method can take up to 2 parameters, which
3765
	will be passed the second and third column values in the test.</p>
3766
<p>Example: Add a "typeRepeated" action to Selenium, which types the text twice into a text box.</p>
3767
<pre class="literal-block">
3768
	Selenium.prototype.doTypeRepeated = function(locator, text) {
3769
	    // All locator-strategies are automatically handled by "findElement"
3770
	    var element = this.page().findElement(locator);
3771
 
3772
	    // Create the text to type
3773
	    var valueToType = text + text;
3774
 
3775
	    // Replace the element text with the new text
3776
	    this.page().replaceText(element, valueToType);
3777
	};
3778
	</pre>
3779
</blockquote>
3780
<p>
3781
<strong>Accessors/Assertions</strong>
3782
</p>
3783
<blockquote>
3784
<p>All <em>getFoo</em> and <em>isFoo</em> methods on the Selenium prototype are added as accessors (storeFoo). For each accessor there
3785
	is an <em>assertFoo</em>, <em>verifyFoo</em> and <em>waitForFoo</em> registered. An assert method can take up to 2 parameters, which
3786
	will be passed the second and third column values in the test.  You can also define your own assertions literally
3787
	as simple "assert" methods, which will also auto-generate "verify" and "waitFor" commands.</p>
3788
<p>Example: Add a <em>valueRepeated</em> assertion, that makes sure that the element value
3789
	consists of the supplied text repeated. The 2 commands that would be available in tests would be
3790
	<em>assertValueRepeated</em> and <em>verifyValueRepeated</em>.</p>
3791
<pre class="literal-block">
3792
	Selenium.prototype.assertValueRepeated = function(locator, text) {
3793
	    // All locator-strategies are automatically handled by "findElement"
3794
	    var element = this.page().findElement(locator);
3795
 
3796
	    // Create the text to verify
3797
	    var expectedValue = text + text;
3798
 
3799
	    // Get the actual element value
3800
	    var actualValue = element.value;
3801
 
3802
	    // Make sure the actual value matches the expected
3803
	    Assert.matches(expectedValue, actualValue);
3804
	};
3805
	</pre>
3806
</blockquote>
3807
<p>
3808
<strong>Automatic availability of storeFoo, assertFoo, assertNotFoo, waitForFoo and waitForNotFoo for every getFoo</strong>
3809
</p>
3810
<blockquote>
3811
<p>All <em>getFoo</em> and <em>isFoo</em> methods on the Selenium prototype automatically result in the availability
3812
	of storeFoo, assertFoo, assertNotFoo, verifyFoo, verifyNotFoo, waitForFoo, and waitForNotFoo commands.</p>
3813
<p>Example, if you add a getTextLength() method, the following commands will automatically be available:
3814
	storeTextLength, assertTextLength, assertNotTextLength, verifyTextLength, verifyNotTextLength, waitForTextLength, and waitForNotTextLength commands.</p>
3815
<pre class="literal-block">
3816
	Selenium.prototype.getTextLength = function(locator, text) {
3817
	    return this.getText(locator).length;
3818
	};
3819
	</pre>
3820
<p>Also note that the <em>assertValueRepeated</em> method described above could have been implemented using
3821
	isValueRepeated, with the added benefit of also automatically getting assertNotValueRepeated, storeValueRepeated,
3822
	waitForValueRepeated and waitForNotValueRepeated.</p>
3823
</blockquote>
3824
<p>
3825
<strong>Locator Strategies</strong>
3826
</p>
3827
<blockquote>
3828
<p>All <em>locateElementByFoo</em> methods on the PageBot prototype are added as locator-strategies. A locator strategy takes 2 parameters, the first being the locator string (minus the prefix), and the second being the document in which to search.</p>
3829
<p>Example: Add a "valuerepeated=" locator, that finds the first element a value attribute equal to the the supplied value repeated.</p>
3830
<pre class="literal-block">
3831
	// The "inDocument" is a the document you are searching.
3832
	PageBot.prototype.locateElementByValueRepeated = function(text, inDocument) {
3833
	    // Create the text to search for
3834
	    var expectedValue = text + text;
3835
 
3836
	    // Loop through all elements, looking for ones that have
3837
	    // a value === our expected value
3838
	    var allElements = inDocument.getElementsByTagName("*");
3839
	    for (var i = 0; i &lt; allElements.length; i++) {
3840
	        var testElement = allElements[i];
3841
	        if (testElement.value &amp;&amp; testElement.value === expectedValue) {
3842
	            return testElement;
3843
	        }
3844
	    }
3845
	    return null;
3846
	};
3847
	</pre>
3848
</blockquote>
3849
<p>
3850
<strong>user-extensions.js</strong>
3851
</p>
3852
<blockquote>
3853
<p>By default, Selenium looks for a file called "user-extensions.js", and loads the javascript code found in that file. This file provides a convenient location for adding features to Selenium, without needing to modify the core Selenium sources.</p>
3854
<p>In the standard distibution, this file does not exist. Users can create this file and place their extension code in this common location, removing the need to modify the Selenium sources, and hopefully assisting with the upgrade process.</p>
3855
</blockquote>
3856
</div>
3857
</body>
3858
</html>