how to retrieve z-index of a divTag

Class library usage, coding and language questions.
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


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: 11737
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


There are two ways to get the style attribute of your tag.
First you can use the indexer of your WebElement
yourTag["yourAttribute"]; ... t_Item.htm

or you can use the GetAttributeValue() method of the Element class
yourTag.Element.GetAttributeValue("yourAttribute"); ... eValue.htm

Ranorex Support Team