How do I use the NextSibling property? : Automation API

How do I use the NextSibling property?

Class library usage, coding and language questions.

How do I use the NextSibling property?

Postby Aracknid » Mon Aug 15, 2011 8: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: 126
Joined: Tue Aug 10, 2010 4:23 pm
Location: Toronto, Ontario, Canada

Re: How do I use the NextSibling property?

Postby Aracknid » Mon Aug 15, 2011 8: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
Aracknid
 
Posts: 126
Joined: Tue Aug 10, 2010 4:23 pm
Location: Toronto, Ontario, Canada

Re: How do I use the NextSibling property?

Postby Support Team » Tue Aug 16, 2011 10: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
User avatar
Support Team
Site Admin
 
Posts: 4844
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria


Return to Automation API

Who is online

Users browsing this forum: Support Team and 0 guests