In a webtable, lets say there are 10 records and 1 column.
let say "image" is available for 1st,2nd and 3rd records and
4th onwards image is not available. How to recognise for
that cell image is available or not?
Answers were Sorted based on User's Feedback
Answer / sandipgami84
Hi, U need to pass only column no, for which column u want
to check, image is exist or not, cop below function and Pass
your 'Column No' as a perameter
Public Function isGridImageExist(Column_No)
Dim Browser_Page
Set Browser_Page = Browser("title:=.*").page("title:=.*")
RowCount = Browser_Page.WebTable("html id:=playlist").RowCount
GetTotalPage =
Browser_Page.WebEdit("name:=pageno").GetROProperty("default
value")
GetMaxPageNumber = trim(right(GetTotalPage,2))
For J=1 to GetMaxPageNumber
For i=1 to RowCount
GetCellData=Trim(Browser_Page.WebTable("html
id:=playlist").GetCellData(i,1))
Set Img = Browser_Page.WebTable("html id:=playlist","html
tag:=TABLE","index:=8").ChildItem(i,Cstr(Column_No),"Image",0)
If (Img.Exist(2)) Then
Img.Click
isGridImageExist = 1
GetCellData=Null
Set Browser_Page = Nothing
Exit Function
End If
GetCellData=Null
Next
Browser_Page.Image("file name:=next.jpg").click
wait(2)
Next
Set Browser_Page = Nothing
End Function
Sandip Gami
Cell No: 9714177088
Is This Answer Correct ? | 0 Yes | 1 No |
Answer / nalini
We can use childitemcount method to get the image count in
a cell.
Rcnt=Browser("title:=.*").page("title:=.*").WebTable
(t).RowCount
imgcnt=0
For i=1 to Rcnt
imgcnt = Browser("title:=.*").page("title:=.*").WebTable
(t).ChildItemCount(i, 1, "Image")
Reporter.ReportEvent 0,"imgcount",imgcnt& " images
available in row# "& i & " and column1"
Next
Is This Answer Correct ? | 0 Yes | 1 No |
What is the purpose of loading qtp add-ins?
What is fragmentation and paging?
What is the exact difference between QTP and RFT ?
HI Everybody, I am using QTP 9.2, I have a problem and hope everybody help me solve it. Now I need to use mouse wheel event to zoom in or zoom out in web client, but QTP can't catch this event. I look forward helping of everybody. Thank you very much.
How to find duplicates in an array and remove them efficiently?
What is the parameterization?
What are the things(properties, and other details) will be recorded while recording an object using normal recording?
whenever U using QTP,Test Director, Why we using separate Bug tracking tool?
How you calling actions in qtp?
Write a script to delete a specific row in a webtable.
What kind of errors can b handled in QTP in real time scenario?
How to see entire results at the same timeafter the batch run.. Cannot see the entire results at a time. Is there a easier way view everthing at same,as our batch file very large