Hi all,
I need to get FlavorElement,Name property (see snapshot below)
I tried with
string name = item.FlavorElement.Name;
but I can't access it that way
Do you have any idea how to handle this?
Thanks.
How to get FlavorElement.Name property?
How to get FlavorElement.Name property?
You do not have the required permissions to view the files attached to this post.
Re: How to get FlavorElement.Name property?
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
Re: How to get FlavorElement.Name property?
Yes, I get 'WPF' when I try that.
I've managed to get a workaround with
This gets me what I need but it's not very elegant solution
I've managed to get a workaround with
Code: Select all
string name = item.ToString(); // this returns {Text:Engineer}
// and then I do search/replace
name = name.Replace("{Text:",string.Empty);
name = name.Replace("}",string.Empty);
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: How to get FlavorElement.Name property?
Hello marasanov,
I would suggest taking a look at the corresponding element with Ranorex Spy.
In my sample, the value for the 'Name'-attribute of the TextBlock-element is 'Engineer'.
You can read this value using the GetAttributeValueText()-method for the corresponding element.
Please let me know if you need more information.
Regards,
Johannes
I would suggest taking a look at the corresponding element with Ranorex Spy.
In my sample, the value for the 'Name'-attribute of the TextBlock-element is 'Engineer'.
You can read this value using the GetAttributeValueText()-method for the corresponding element.
Code: Select all
string name = repo.<Form>.<TextBlock>.Element.GetAttributeValueText("Name");
Regards,
Johannes
You do not have the required permissions to view the files attached to this post.
-
- Posts: 14
- Joined: Thu Nov 02, 2017 2:55 pm
Re: How to get FlavorElement.Name property?
HI,
I struggled just as you to get the 'Name' property from Flavorelement.
I got there using this:
I think you could use a string also.
Hope this helps to get a more 'practical' solution to your problem.
Best regards,
Dominic
I struggled just as you to get the 'Name' property from Flavorelement.
I got there using this:
Code: Select all
var CurText = ((Ranorex.Plugin.MsaaFlavorElement)cell.Element.FlavorElement).Name;
Hope this helps to get a more 'practical' solution to your problem.
Best regards,
Dominic