xpath example

17 views
Skip to first unread message

fabienlroy

unread,
Aug 22, 2017, 9:15:15 AM8/22/17
to CasperJS
Hello,

I need to find some text using xpath and test the text value.

I tried "fetchText" to no availabe.

Thanks for any pointer.

Fabien

Ken Soh

unread,
Aug 22, 2017, 11:42:25 PM8/22/17
to CasperJS
For xpath getting text you can use text(), below are 2 examples - 

//*[text()="some_string"]
//*[contains(text(),"some_string")]

This is how xpath can be used in CasperJS - http://docs.casperjs.org/en/latest/selectors.html#index-2
Reply all
Reply to author
Forward
0 new messages