Page 1 of 1

Getting InnerText from a Span

Posted: Wed Aug 10, 2016 6:11 pm
by GranPapi
Hey guys! I'm new to Ranorex and I'm looking forward to do the following:

I'm creating a module that uses the "validate" action, and need to validate that the value shown on a table is matches to a given text string; the value shown in the table is contained in a span -and it's contained on the "innertext" property

How can I get Ranorex to get that InnerText?

Thanks in advance!

Re: Getting InnerText from a Span

Posted: Thu Aug 11, 2016 1:56 pm
by Vega
While recording:

When you click validate and then click on an item, Ranorex spy will open and will highlight the selected element in the tree. Once you are sure this is the correct element press next. On the next screen you can choose what you are validating; you can see I have inner text selected:
validate.png
And here is what the generated step looks like in the action table of the recording:
validate2.png

Re: Getting InnerText from a Span

Posted: Thu Aug 11, 2016 2:26 pm
by odklizec
Hi,

Please post a Ranorex snapshot (not screenshot!) and the xpath to span element you are using.

Re: Getting InnerText from a Span

Posted: Fri Aug 12, 2016 5:39 pm
by GranPapi
Thanks for your replies, guys!

Vega, your answer helped me a lot! It's working now :D