Changes for page Selenium Command Examples

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

From version 14.1
edited by Kieran Kelleher
on 2007/11/29 11:20
Change comment: There is no comment for this version
To version 18.1
edited by Kieran Kelleher
on 2007/11/30 14:12
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -1,23 +1,21 @@
1 -Click a link having css class 'sel//create//team'
1 +== Using XPath Expressions as Locators ==
2 2  
3 -| clickAndWait | ~/~/a@class='sel//create//team' |
3 +=== Examples ===
4 4  
5 -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'
5 +Click a link having css class 'sel//create//team'
6 6  
7 -| addSelection | ~/~/select@class='sel//browser//list' | value=0
8 -
7 +| clickAndWait | ~/~/a@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 | ~/~/select@class='sel//browser//list' | value=0 |
9 9  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'
10 -
11 -| addSelection | ~/~/select@class='sel//browser//list' | value=2
12 -
11 +| addSelection | ~/~/select@class='sel//browser//list' | value=2 |
13 13  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'
14 -
15 -| addSelection | ~/~/select@class='sel//browser//list' | label=John Murphy
16 -
13 +| addSelection | ~/~/select@class='sel//browser//list' | label=John Murphy |
17 17  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"
18 -
19 -|storeValue|~/~/input[[interwiki:class='sel_EditTeam_teamName':]]|var//EditTeam//teamName
20 -
15 +| storeValue | ~/~/input@class='sel//EditTeam//teamName' | var//EditTeam//teamName |
21 21  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 |
22 22  
23 -|clickAndWait|link=${{var_EditTeam_teamName}}{{/var_EditTeam_teamName}}|
19 +=== XPath Resources ===
20 +
21 +* [[http://www.w3schools.com/xpath/xpath_syntax.asp]]