Micro Focus QTP (UFT) Forums
Identifying a WebGrid using Div Tag - Solved - 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: Identifying a WebGrid using Div Tag - Solved (/Thread-Identifying-a-WebGrid-using-Div-Tag-Solved)



Identifying a WebGrid using Div Tag - Solved - EnthusiasticLearner - 01-06-2014

I have the following html tag for a Web Grid. How do I use it to identify this Webgrid using the unique Div ID in QTP. I need to use this div id as it's the only unique identifier.

Code:
<div id="UniqueID"class="rowdetail" width="100%">
<table class="datagrid" width="100%">
<tr><th colspan="2" style="text-align: center">TableName</th></tr>
<tr><td width="25%"> ....</td></tr>
</table></div>

Let me know if you need more details. I did search the forum and the internet but with no help so created a thread to serve the purpose. Any help is highly appreciated

Solution

Code:
Browser("B").Page("P").WebElement("html id:=UniqueID").WebTable("html tag:=TABLE").RowCount()



RE: Identifying a WebGrid using Div Tag - supputuri - 01-06-2014

Hey, I belive the div will be identified as WebElement.

Try to add object in OR (ADD OBJECT) and then you can work on that. Let me know if you need any further help on this.


RE: Identifying a WebGrid using Div Tag - EnthusiasticLearner - 01-06-2014

Thanks for your input. Probably this is the reason my various trail and error ended up in all errors.

Is there anyway I will be able to identify it rather as a WebGrid or Web Table as inner-tag of the div is a Table. It would be easier to retrieve data from the grid/table by iterating then after

Edit: I was able to solve it with help of another friend. Solution has been updated in the OP. Thanks