Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to get selected childitem in webtable?
#1
Not Solved
Hi,

In web application, webtable (wbfgrid) is displayed with 5th column containing 7 different values in non-editable boxes. QTP identifies these as 'WebElement'.
I have selected one of the values (which is highlighted in blue after selection) in each row.
Now I want to fetch the selected value. But I am not finding any distinguishing property between selected and non-selected value.

Following snippet of code is tried to fetch the webelement value

Code:
Set myWebTable = browser("title:=.*").page("title:=.*").wbfgrid("html id:=.*Grid")
a = myWebTable.ChildItem(2, 5, "WebElement", 0).getroproperty("innertext")
Please help

Thanks
Rupali
Reply
#2
Not Solved
Just to add more info on this...
e.g.
Following values are displayed in webelement boxes of column no. 5
val1 val2 val3 val4

Assume val2 is selected before and when I save the changes and come back to this page, val2 box is highlighted.

If i execute the below code, I will get the below output.

Code:
Set myWebTable = browser("title:=.*").page("title:=.*").wbfgrid("html id:=.*Grid")
For index = 2 to 8
a = myWebTable.ChildItem(2, 5, "WebElement", index).getroproperty("innertext")
print a
Next

o/p:
val1
val2
val3
val4

I want to retrieve the value which is already selected i.e. val2. How will I get that?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  SWF grid is identified by QTP as swfobject - how to access a childitem of a cell?? raparthiqa 0 5,016 02-05-2015, 01:47 PM
Last Post: raparthiqa
Question How to write “blindly” to whatever object is selected D2010 4 3,744 08-04-2010, 03:29 PM
Last Post: D2010

Forum Jump:


Users browsing this thread: 1 Guest(s)