An element's type

Ask general questions here.
bilgeautomation
Posts: 1
Joined: Mon Jul 01, 2013 11:28 am

An element's type

Post by bilgeautomation » Mon Jul 01, 2013 11:30 am

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

blackout
Posts: 14
Joined: Thu Mar 14, 2013 10:07 am

Re: An element's type

Post by blackout » Mon Jul 01, 2013 4:40 pm

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"));

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: An element's type

Post by Support Team » Tue Jul 02, 2013 1:18 pm

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)
.
Image