Changes for page Selenium Command Examples

Last modified by Kieran Kelleher on 2008/07/02 15:10

From version 20.1
edited by Kieran Kelleher
on 2008/07/02 15:10
Change comment: There is no comment for this version
To version 21.1
edited by Kieran Kelleher
on 2008/07/02 15:10
Change comment: There is no comment for this version

Summary

Details

Page properties
Parent
... ... @@ -1,0 +1,1 @@
1 +How to Develop Selenium Tests
Content
... ... @@ -2,24 +2,86 @@
2 2  
3 3  === Examples ===
4 4  
5 -Click a link having css class 'sel//create//team'
5 +Click a link having css class 'sel_create_team'
6 6  
7 -| clickAndWait | ~/~/aWONDER:@class='sel//create//team' | |
8 -Add the first element of a list browser (aka. 'select' element) to the current selections. The list browser is identified by css class 'sel//browser//list'
9 -| addSelection | ~/~/selectWONDER:@class='sel//browser//list' | value=0 |
10 -Add the third element of a list browser (aka. 'select' element) to the current selections. The list browser is identified by css class 'sel//browser//list'
11 -| addSelection | ~/~/selectWONDER:@class='sel//browser//list' | value=2 |
12 -Add the item named "John Murphy" of a list browser (aka. 'select' element) to the current selections. The list browser is identified by css class 'sel//browser//list'
13 -| addSelection | ~/~/selectWONDER:@class='sel//browser//list' | label=John Murphy |
14 -Store the current value of an input field into a script variable. The input field is identified by the css class "sel//EditTeam//teamName" and we are storing the current field value into a script variable named "var//EditTeam//teamName"
15 -| storeValue | ~/~/inputWONDER:@class='sel//EditTeam//teamName' | var//EditTeam//teamName |
7 +|(((
8 +clickAndWait
9 +)))|(((
10 +~/~/a[WONDER:@class='sel_create_team']
11 +)))|(((
12 +
13 +)))
14 +
15 +Add the first element of a list browser (aka. 'select' element) to the current selections. The list browser is identified by css class 'sel_browser_list'
16 +
17 +|(((
18 +addSelection
19 +)))|(((
20 +~/~/select[WONDER:@class='sel_browser_list']
21 +)))|(((
22 +value=0
23 +)))
24 +
25 +Add the third element of a list browser (aka. 'select' element) to the current selections. The list browser is identified by css class 'sel_browser_list'
26 +
27 +|(((
28 +addSelection
29 +)))|(((
30 +~/~/select[WONDER:@class='sel_browser_list']
31 +)))|(((
32 +value=2
33 +)))
34 +
35 +Add the item named "John Murphy" of a list browser (aka. 'select' element) to the current selections. The list browser is identified by css class 'sel_browser_list'
36 +
37 +|(((
38 +addSelection
39 +)))|(((
40 +~/~/select[WONDER:@class='sel_browser_list']
41 +)))|(((
42 +label=John Murphy
43 +)))
44 +
45 +Store the current value of an input field into a script variable. The input field is identified by the css class "sel_EditTeam_teamName" and we are storing the current field value into a script variable named "var_EditTeam_teamName"
46 +
47 +|(((
48 +storeValue
49 +)))|(((
50 +~/~/input[WONDER:@class='sel_EditTeam_teamName']
51 +)))|(((
52 +var_EditTeam_teamName
53 +)))
54 +
16 16  Use a stored variable later in the script (on a different page or whatever) to click a dynamic hyperlink that uses the stored value as the hyperlink text
17 -| clickAndWait | link=$var//EditTeam//teamName | |
18 -Type the value 'abc' in the input field having class 'sel//input'//
19 -| type | ~/~/inputWONDER:@class='sel//input' //| abc |
56 +
57 +|(((
58 +clickAndWait
59 +)))|(((
60 +link=${var_EditTeam_teamName}
61 +)))|(((
62 +
63 +)))
64 +
65 +Type the value 'abc' in the input field having class 'sel_input'
66 +
67 +|(((
68 +type
69 +)))|(((
70 +~/~/input[WONDER:@class='sel_input']
71 +)))|(((
72 +abc
73 +)))
74 +
20 20  Store the value 'abc' in a script variable named var1
21 -|store|abc|var1
22 22  
77 +|(((
78 +store
79 +)))|(((
80 +abc
81 +)))|(((
82 +var1
83 +)))
84 +
23 23  === XPath Resources ===
24 24  
25 -* [[http://www.w3schools.com/xpath/xpath_syntax.asp]]
87 +* [[http:~~/~~/www.w3schools.com/xpath/xpath_syntax.asp>>url:http://www.w3schools.com/xpath/xpath_syntax.asp||shape="rect"]]