12-25-2013, 09:38 AM
(This post was last modified: 12-27-2013, 09:03 PM by EnthusiasticLearner.)
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
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?
Thanks in Advance
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