how to retrieve z-index of a divTag

Class library usage, coding and language questions.
hobli
Posts: 57
Joined: Thu Jul 30, 2009 1:15 am

how to retrieve z-index of a divTag

Post by hobli » Tue Jun 29, 2010 8:39 am

Hi,

I would like to check the z-index of div layers in a webpage, the web page is using style attribute z-index of div to define it's layer position (z index), could you pls provide me any hint on how to retrieve this attribute value from divTag?

thanks a lot

Code: Select all

<div style="z-index: 4" id="mydiv">this is my layer</div>

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

Re: how to retrieve z-index of a divTag

Post by Support Team » Tue Jun 29, 2010 8:52 am

Hi,

There are two ways to get the style attribute of your tag.
First you can use the indexer of your WebElement
yourTag["yourAttribute"];
http://www.ranorex.com/Documentation/Ra ... t_Item.htm

or you can use the GetAttributeValue() method of the Element class
yourTag.Element.GetAttributeValue("yourAttribute");
http://www.ranorex.com/Documentation/Ra ... eValue.htm

Regards,
Peter
Ranorex Support Team
.
Image