We can test the elements and their immediate elements using CSS.
If your element is in this format.
<span id="firstChild">first child <a>second child</a></span>
String str = selenium.getText("css=div#combinatorTest > span");
String str = selenium.getText("css=div#combinatorTest > span>a");
<a class="class1 class2 class3">this is the element</a>
You can use below code for verifying the element or storing the text in the element.
Verifying element in RC
verifyTrue(selenium.isElementPresent("css=a[class~=\"class2\"]"));
Verifying element in IDE
<tr>
<td>verifyElementPresent</td>
<td>css=a[class~="class2"]</td>
<td></td>
</tr>
storing element text in a variable using RC
String str = selenium.getText("css=a[class~=\"class3\"]");
storing element text in a variable using IDE
<tr>
<td>storeText</td>
<td>css=a[class~="class3"]</td>
<td>str</td>
</tr>
<div id="combinatorTest">this is the parent element. <span id="firstChild">this is a child element <a>and grandson element</a></span>, <span>another child element</span>, <span>last child element<span></span></span></div>
How to store the text of preceding combinator element in RC to store "another chile element"
String str = selenium.getText("css=span#firstChild + span");
to store "last child element"
String str = selenium.getText("css=span#firstChild + span + span");
How to store the text of preceding combinator element in IDEto store "another chile element"
<tr>
<td>storeText</td>
<td>css=span#firstChild + span</td>
<td>str</td>
</tr>
to store "last child element"
<tr>
<td>storeText</td>
<td>css=span#firstChild + span + span </td>
<td>str</td>
</tr>
Currently it sounds like Wordpress is the top blogging platform available right now.
ReplyDelete(from what I've read) Is that what you are using on your blog?
Check out my web page ... filing bankruptcy in florida
It’s difficult to get knowledgeable folks on this topic, but the truth is be understood as what happens you’re preaching about! Thanks. What are some of the cheapest places to travel to in the world? From Asia to Africa and Europe, Things to do 's got budget breakdowns for the cheapest places.
ReplyDeleteoff white outlet
ReplyDeletesupreme t shirt
cheap kyrie shoes
kyrie spongebob
off white
off white
a bathing ape
air jordan
off white outlet
hermes online sale