2
<span> 50 Line 1 shares $ 22.60 </span> 

this is what i wrote and get fail

<tr>
    <td>verifyText</td>
    <td>css=#first &gt; span</td>
    <td>shares</td>
</tr>
1

Use "contains" like this:

assertElementPresent css=span:contains('shares')

Note that 'span' in unlikely to be unique however (there are almost certainly lots of them on the page). So you will need to look at the surrounding structure to see what tags will be better for isolating these elements. You could use span[which_one] but it would be better to use other markup such as form#change_shares span:contains('shares') (actual code will depend on stuff not shown by you) to specifically uniquely isolate the area of page you wish to target

| improve this answer | |
  • I have a problem when the word shares is not found is fail the test I want it to pass on – user25686 May 17 '17 at 12:55
  • Would that not be a different test then? – trashpanda May 17 '17 at 12:58
  • It's the same test ,I just got stuck with how I find the word but it stumbles my test – user25686 May 17 '17 at 12:59
  • You are supposed to accept my answer and then post that as a separate question. You should revert the above changes to the question and do that. Remember this site is a place for the many people with the same problem so it's important to get this right even if you have been helped. I may ask moderator to revert question change also. – Michael Durrant May 17 '17 at 13:17
  • Ok I וunderstand I open a new question – user25686 May 17 '17 at 13:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.