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

this is what i wrote and get fail

    <td>css=#first &gt; span</td>
  • This should have been a new question not an edit of an older one that this question should actually be. I've flagged both moderator and OP to revert changes and post this as a separate question. Commented May 17, 2017 at 13:20
  • user25686, What is it that you're trying to do, and how do the other two questions you wrote fit in? I'd love to help solve your problem but I need more info. :-)
    – corsiKa
    Commented May 17, 2017 at 14:20

1 Answer 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

  • I have a problem when the word shares is not found is fail the test I want it to pass on
    – user25686
    Commented May 17, 2017 at 12:55
  • Would that not be a different test then?
    – dvniel
    Commented May 17, 2017 at 12:58
  • It's the same test ,I just got stuck with how I find the word but it stumbles my test
    – user25686
    Commented May 17, 2017 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. Commented May 17, 2017 at 13:17
  • Ok I וunderstand I open a new question
    – user25686
    Commented May 17, 2017 at 13:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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