Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QTP Unable to differentiate WebTable in Application - Solved
#1
Solved: 10 Years, 4 Months ago
I am working on an application where there are two different web tables displayed.

The second web table is detail description of the first web table so it displays when we select a row in the first web table. In other words, Each row in the first table is selectable and when selected corresponds to the second web table

The problem now I am facing is retrieving data from second web table for different entity of first one since all the property of the web table are similar expect the below property

"html ID" which corresponds to - "DetailParty_randomno"

This random number is the one which defines the uniqueness of the second web table, which can be retrieved from the first web table though it isn't found in the properties section when we use the Object spy. I can see this random number when I view the source code of the page. It's displayed as value entity in the tr tag

Value entity looks like "Party_randomno"

My question is if there a way to retrieve this value for each row and then use it in identifying the second web table?

However I did try to read from second table by hard coding "html id" in webtable property to see if it's being read but it didn't work So my second question is with respect to the correctness of the below descriptive programming code. Is there something else I need to include/exclude in the WebTable property to find uniqueness.

I also did my research and found that it's useful to use index but I am not aware on how to find the index of a web table? That explanation would also help me in my learning

Code:
Set ObjTable = Browser("name :=" &BrowserPage).Page("name := " & BrowserPage).WebTable("class:= Web_Table", "class name:= WebTable" , "html id:= DetailParty_7")


Update

I found a solution for one of my two problems in an another forum

1. Getting the Value Id - Solved
2. Parsing it to WT2 to uniquely identify it

For the first problem below is the solution. However my descriptive programming(first and last line) in the below is not working. Can you help me correct it?

Code:
BrowserPage = Browser("micClass:=Browser").GetROProperty("name")
Set desc = Description.Create()
desc("html tag").Value = "tr"
Set Rows = Browser("B").Page("P").Webtable("WT").ChildObjects(desc)
RoCounter = Rows.Count-1
For valuecount = 0 To RoCounter
    id=  rows(i).Object.GetAttribute("value")
Next
'When the right ID is got, parsing it in the below for WT2 Identification Id would be Party_1, Party_3 and so on. However for web table 2 html id needs to have "Detail" word in front of it
Set ObjTable = Browser("name :=" &BrowserPage).Page("name := " & BrowserPage).WebTable("class:= Web_Table", "html id:= Detail" &id)

Thanks in Advance
Reply


Messages In This Thread
QTP Unable to differentiate WebTable in Application - Solved - by EnthusiasticLearner - 12-25-2013, 09:38 AM
Reply to Basanth - by EnthusiasticLearner - 12-27-2013, 01:23 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Link in a webtable in a webtable Soulwalker 1 2,693 07-19-2017, 01:44 PM
Last Post: Ankur
  How to identify dynamic webtable as unique in QTP? sudheendramurthy 4 18,078 02-23-2016, 06:16 PM
Last Post: vinod123
  Unable to click on WebButton in WebTable srach84 1 2,898 02-09-2015, 09:07 PM
Last Post: arpan
  Webtable actions are not getting recorded, but ObjectSpy is able to identify webtable sahilarora2000 2 3,628 06-13-2014, 04:27 PM
Last Post: vinod123
  Identifying a WebGrid using Div Tag - Solved EnthusiasticLearner 2 3,347 01-06-2014, 09:27 PM
Last Post: EnthusiasticLearner

Forum Jump:


Users browsing this thread: 1 Guest(s)