Get the ClassName of the cell object from a Table. - Printable Version +- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums) +-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP) +--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming) +--- Thread: Get the ClassName of the cell object from a Table. (/Thread-Get-the-ClassName-of-the-cell-object-from-a-Table) |
Get the ClassName of the cell object from a Table. - guin.anirban - 09-24-2010 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. RE: Get the ClassName of the cell object from a Table. - QTPLearn - 09-24-2010 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 RE: Get the ClassName of the cell object from a Table. - guin.anirban - 09-24-2010 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". RE: Get the ClassName of the cell object from a Table. - A.Saini - 09-25-2010 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? RE: Get the ClassName of the cell object from a Table. - guin.anirban - 09-27-2010 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. RE: Get the ClassName of the cell object from a Table. - guin.anirban - 09-29-2010 Hi Saket, can you please help me on this query? RE: Get the ClassName of the cell object from a Table. - guin.anirban - 10-08-2010 Hi All, Is there any update on my query? RE: Get the ClassName of the cell object from a Table. - A.Saini - 10-08-2010 Hi anirban, Are you able to get the data of each cell using "GetCellData" method in this case??? RE: Get the ClassName of the cell object from a Table. - cdesserich - 10-08-2010 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 |