09-24-2010, 12:06 AM
I want to get the Class Name of the cell Object from a table. Mean to say i want to return the class name whether it's a checkbox, editbox, list, button etc.
Get the ClassName of the cell object from a Table.
|
09-24-2010, 12:06 AM
I want to get the Class Name of the cell Object from a table. Mean to say i want to return the class name whether it's a checkbox, editbox, list, button etc.
Hi
1st Approach: Use 'ChildItem' method to get the class. Code: Set WebEditObj = Browser("Browser").Page("Page").WebTable("Sortable table").ChildItem(Row,Column,"WebEdit",0) 2nd Approach: Use 'GetROProperty'. Code: strClassName = Browser("Browser").Page("Page").WebTable("Table").GetROProperty("Class") ~Regards
09-24-2010, 11:31 PM
Thanks for your answer.
But i want to return the class of the cell object. In your 1st example you are clearly mentioned class as "WebEdit' and in the 2nd example will return "Table".
09-25-2010, 07:12 PM
Hi,
Actually "micclass" is the must entered property for "childobject" approch.And for the GetROproperty method it's mandatory to define the ClassType. Normally we get the other property with the help of ClassType.So this case seems little strange. May you please be more specific to your requirement?
09-27-2010, 11:35 PM
(This post was last modified: 09-27-2010, 11:36 PM by guin.anirban.)
The requirement is like i want to write a function for table that will return the Class Name of the particular cell if i pass the row and column number. Obviously if and only if that Class to that particular cell exists.
09-29-2010, 11:29 AM
Hi Saket,
can you please help me on this query?
10-08-2010, 11:40 AM
Hi All,
Is there any update on my query?
10-08-2010, 11:49 AM
Hi anirban,
Are you able to get the data of each cell using "GetCellData" method in this case???
10-08-2010, 11:29 PM
I think we are getting confused whether you want the micclass (QTP object type), the CSS class (the value of the element's class attribute), or the input type (the value of an input element's type attribute). Here is code to check each cell of a table and return several types of information about the first child of each cell. I assume you could customize it if you needed to check all the cell children and that you can remove the parts you aren't interested in. This code was tested with the attached HTML file (see attachment) after adding the table to the Object Repository and renaming it "Table". I do not think this code will work for nested tables, so beware. The reason is that the ChildObjects function returns child objects for any hierarchy so it would potentially return rows and columns nested inside the parent table if there are any, so again beware.
Quote:Set rowDesc = Description.Create |
« Next Oldest | Next Newest »
|