Page 1 of 1

An element's type

Posted: Mon Jul 01, 2013 11:30 am
by bilgeautomation
Hello,

How can I evaluate an element's type from code using C#? For instance for a TextBlock is it possible to get the type?

Thanks in advance

Re: An element's type

Posted: Mon Jul 01, 2013 4:40 pm
by blackout
Can't you just add the element you want to check to your repository, then run a validate.istrue against the repo item 'type'?

e.g

Code: Select all

Validate.IsTrue(repo.folder.textbox.type.equals("test"));

Re: An element's type

Posted: Tue Jul 02, 2013 1:18 pm
by Support Team
Hello,

Do you want to get the Adapter type of your element?
You could achieve this with the following method:
Validate.IsTrue(firstName.GetType().ToString().Equals("Ranorex.Text"));
If this is not what you want, please describe which type you want to get.

Regards,
Markus (T)