Reputation: 223
For example, how would you store the text of the following:
<div class="value">ABC</div>
<div class="value">123</div>
In the IDE I would have:
Command ::: Target : : : Value
storeText : : : ????? : : : Key1
storeText : : : ????? : : : Key2
I want to store the ABC as key1 and the 123 as Key2 so how do I make my target point to the correct element. Is there a way to index such as class=value[0] and class=value[1] to do this?
Upvotes: 1
Views: 2096
Reputation: 937
If you have fire bug add-on of the Firefox installed you can do the following:
Upvotes: 0
Reputation: 1821
Also you could use storeText : : : //div[@class='value'][last()] : : : Key2
Please see following link for details http://zvon.org/xxl/XPathTutorial/General/examples.html
Upvotes: 0
Reputation: 9019
You can use xpath for the Target:
Command : : : Target : : : Value
storeText : : : //div[@class='value'][1] : : : Key1
storeText : : : //div[@class='value'][2] : : : Key2
The [n]
is an index that will return the nth match.
Upvotes: 1