How do I use the NextSibling property?

Class library usage, coding and language questions.
User avatar
Aracknid
Posts: 342
Joined: Tue Aug 10, 2010 3:23 pm
Location: Toronto, Ontario, Canada

How do I use the NextSibling property?

Post by Aracknid » Mon Aug 15, 2011 7:40 pm

I've got a DIVTag object and I want to assign the next sibling of this object to another new obj.

I get an error when I try this:
oDIVTag as Ranorex.DivTag
oNextTag as Ranorex.DivTag

oDIVTag = "/div[@id='someid']"
oNextTag = oDIVTag.NextSibling
For the sake of the example, the oDIVTag is a valid and found object. I know that all the elemnts on the same level as this object are all DIVs.

How to I assign the next one to the oNextTag ?

Thanks,

Aracknid

User avatar
Aracknid
Posts: 342
Joined: Tue Aug 10, 2010 3:23 pm
Location: Toronto, Ontario, Canada

Re: How do I use the NextSibling property?

Post by Aracknid » Mon Aug 15, 2011 7:56 pm

OK, never mind. I solved my own problem by doing this...
oDIVTag as Ranorex.DivTag
oNextTag as Ranorex.DivTag

oDIVTag = "/div[@id='someid']"
oNextTag = oDIVTag.NextSibling.As(of Ranorex.DivTag)()
Thanks,

Aracknid

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

Re: How do I use the NextSibling property?

Post by Support Team » Tue Aug 16, 2011 9:35 am

Hi,

You can use the following-sibling attribute also in your RxPath. Therefore take a look to following link
http://www.ranorex.com/blog/ranorexpath ... fy_Sibling

Regards,
Peter
Ranorex Team
.
Image