Hi,
I am searching for a label control at runtime using text[@controltext='Text'], After searching the control i want to fetch value of @controlname property as string. Please guide me how i can i perfrom this task.
How can i fetch ControlName at runtime ??
-
- Posts: 6
- Joined: Fri Feb 18, 2011 1:11 pm
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: How can i fetch ControlName at runtime ??
Hi,
to get out the attribute "controlname" from a control you can use following method from Control class:
Control.GetPropertyValue(string name)
Kind regards,
Tobias
Support Team
to get out the attribute "controlname" from a control you can use following method from Control class:
Control.GetPropertyValue(string name)
Kind regards,
Tobias
Support Team
-
- Posts: 6
- Joined: Fri Feb 18, 2011 1:11 pm
Re: How can i fetch ControlName at runtime ??
Hi,
Thanks for the prompt reply. Can you please provide sample code.
Thanks for the prompt reply. Can you please provide sample code.
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: How can i fetch ControlName at runtime ??
Hi,
please, read the corresponding section in the Ranorex User Guide:
http://www.ranorex.com/support/user-gui ... apter.html
BTW you can also use the Name attribute directly:
Tobias
Support Team
please, read the corresponding section in the Ranorex User Guide:
http://www.ranorex.com/support/user-gui ... apter.html
BTW you can also use the Name attribute directly:
Control yourControl = "Path/to/your/text[@controltext='Text']"; String yourString = yourControl.Name;Regards,
Tobias
Support Team