Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Counting no. of rows for a wbfgrid in a web based application
#1
Solved: 11 Years, 4 Months, 3 Weeks ago
Hi all,

I am trying to record a web based application,
1) Using QTP 9.5 on one page I am not able to select objects or record on button objects in a wbfgrid which in turn comes lower in the hierarchy of Webtables. I have used .rowcount and getcelldata methods but it does not return the number of rows.

2) Also to use Descriptive programming for webtables up in the hierarchy , they have similar properties. Is there a way to distinguish between them so as to get the count of exact webtable?

3) All buttons on a particular page have similar properties so QTP is just clicking the button based on x,y co-ordinates is there any way I can tie up a particular button with the text in front of it, so that unique button will only be selected.


My questions are little complicated, I will reply any counter questions to make the problem more clearer, thanks you for your patience
Reply
#2
Solved: 11 Years, 4 Months, 3 Weeks ago
Normally, when the objects are created dynamically this problem may exist...you will be able to overcome these types of issue by using the Ordinal identifier - INDEX. Try including index property eg.
Code:
Browser("..").Page("..").Frame("..").Webbutton("html tag:=INPUT", "html id:=ok", "index:=0")
Code:
Browser("..").Page("..").Frame("..").Webbutton("html tag:=INPUT", "html id:=ok", "index:=1")
etc..
Reply
#3
Solved: 11 Years, 4 Months, 3 Weeks ago Question 
Hi MR21135,

Can we record and insert a checkpoint for the data generated in a Div based grid view in any web page.

I have tried this but didn't work...

----------------------------
Code:
Dim i,rows,total

rows=Browser("..").Page("..").WebTable("..").GetROProperty("rows")

For i=2 to rows
    if Browser("..").Page("..").WebTable("..").GetROProperty("rows").GetCellData(i,1)="value" Then
    total = total +1
    End if
    msgbox "No rows present"
    total = 0
Next

msgbox total

-----------------------------
here the WebTable is not able to recognize the gridview displayed in the page...

Thanks... Smile & waiting for reply
Reply
#4
Solved: 11 Years, 4 Months, 3 Weeks ago
Hi,
You will not be able to use this statement
Code:
"Browser("..").Page("..").WebTable("..").GetROProperty("rows").GetCellData(i,1)"
to generate rowwise loop instead use INDEX.

here in this case you need to increment i value according to the rows for example if you have two columns and two rows then
the index would be

C1 C2
R1 0 1
R2 2 3

just try

Code:
Dim i,rows,total

rows=Browser("..").Page("..").WebTable("..").GetROProperty("rowcount")

For i=0 to rows Step 2
    if Browser("..").Page("..").WebTable("html tag:=TD","index:="&i).GetROProperty("innertext")="value" Then
            total = total +1
             Else
            msgbox "No rows present"
            total = 0
             End If
Next
msgbox total

one more thing you can also use
Code:
.GetCellData(i,1) instead of GetROProperty("innertext")

Hope i would have answered you.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  webfile web object not identified at runtime in a java application saila123 1 2,840 02-11-2015, 08:23 PM
Last Post: Kirill
  How to Delete Rows with duplicate values in 1 columns in excel thru QTP. arpan 0 2,852 02-09-2015, 08:47 PM
Last Post: arpan
Smile find out of spelling error in Web application deveshbhatt29 1 2,244 01-10-2014, 05:10 PM
Last Post: Maheep_bhambri
  How to get center data value in a odd number of rows and columns web table ... sai rajesh 0 2,836 11-13-2013, 10:24 PM
Last Post: sai rajesh
  to count the number of used rows in a particular column sujaravi123 3 11,224 06-12-2013, 03:17 PM
Last Post: sujaravi123

Forum Jump:


Users browsing this thread: 2 Guest(s)