Technology specific object identification, supported applications, web technologies, and 3rd party controls.
-
boris0dev
- Posts: 18
- Joined: Fri Nov 09, 2018 11:28 am
Post
by boris0dev » Fri Nov 09, 2018 11:41 am
I've created a user code method:
public void IsValueNumberInRange(RepoItemInfo element, int start, int end)
{
System.Diagnostics.Debug.WriteLine("Value of the element " + element.ToString());
}
I'm calling the user code in my recording and select as RepoItemInfo an arbitrary repository item.

- Capto_Capture 2018-11-09_11-29-43_AM.png (20.14 KiB) Viewed 1738 times
Problem: I want to get the InnerText of the element.
How can I achieve this?
Thanks for your help
-
odklizec
- Ranorex Guru

- Posts: 6360
- Joined: Mon Aug 13, 2012 9:54 am
- Location: Zilina, Slovakia
Post
by odklizec » Fri Nov 09, 2018 1:08 pm
Hi,
Try something like this:
string elementStringVal = element.CreateAdapter<Unknown>().Element.GetAttributeValueText("InnerText").ToString();
Pavel Kudrys
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
-
boris0dev
- Posts: 18
- Joined: Fri Nov 09, 2018 11:28 am
Post
by boris0dev » Fri Nov 09, 2018 1:59 pm
Thanks, this was the solution, except that CreateAdapter<Unknown>() expects at least 1 argument (bool)
-
odklizec
- Ranorex Guru

- Posts: 6360
- Joined: Mon Aug 13, 2012 9:54 am
- Location: Zilina, Slovakia
Post
by odklizec » Fri Nov 09, 2018 2:02 pm
Hi,
Yes, you are right! I wrote it from memory and forgot about bool parameter

Pavel Kudrys
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