Hi,
I am trying to retrieve value of InnetText from a repository element. (C#)
I have a repo element and its xpath looks is this:
/dom[@domain='10.31.160.99:6010']//div[#'ScrollPane#3']/div[2]/div/div[1]/div[4]/span[@innertext='22295505']
In UserCode file I want to retrieve value of innertext field and pass it on to a different function that perform further tests.
I am looking for API which does something like:
String value = Ranorex.GetAttribute(repo.ICMUAT.SpanTag22295505Info, "InnerText");
I am from java background so pls don't mind syntax.
Regards,
Ravi
How to retrieve attribute value
Re: How to retrieve attribute value
Hi,
The code you are looking for looks like this:
BTW, if you are not sure how to create some code, you can always record an action or manually add an action to the recording table (see the list of available actions > here <) and then convert the selected action (or even multiple actions) into user code. Just right click the selected action(s) and from the appeared menu select "Convert to User Code". In this way you can quickly learn the code behind basic actions or even rapid prototyping things, even without a deep knowledge of coding
Hope this helps?
The code you are looking for looks like this:
Code: Select all
string strValue = repo.ICMUAT.SpanTag22295505Info.GetAttributeValueText("InnerText");

Hope this helps?
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration