I need to validate a popup by using part of the message.
I have tried following the example in the Ranorex manual where the examples are like: button[@text~'sample[0-9]']
note the text is entered as an attribute by the @text. This not working where the Div I am searching for has the text as innerText.
I change the search path to use text() instead which is working for me.
/dom[@domain=$WebUIURL]//div[#'simpleDialogContent'][text()~'Modifying the Secondary']
I also tried [@innertext~''Modifying the Secondary'] which also worked.
What is the difference in RxPath between @text, text() and @innertext from a Ranorex viewpoint?
I have used Selenium for years and for standard XPath, text() is the usual form.
Web object identification via Text with Regex
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Web object identification via Text with Regex
Hi CWhiting,
Great question! @text and text() essentially do the same thing except that @text will use the "text" attribute if available. If a "text" attribute isn't available, it is going to use the text() method and look for something that is text, such as the InnerText on an HTML object. @Innertext will look at the actual "InnerText" attribute.
I hope this helps!
Cheers,
Ned
Great question! @text and text() essentially do the same thing except that @text will use the "text" attribute if available. If a "text" attribute isn't available, it is going to use the text() method and look for something that is text, such as the InnerText on an HTML object. @Innertext will look at the actual "InnerText" attribute.
I hope this helps!
Cheers,
Ned