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



In a webtable, lets say there are 10 records and 1 column. let say "image" is available f..

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

In a webtable, lets say there are 10 records and 1 column. let say "image" is available f..

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

Post New Answer

More QTP Interview Questions

What is the purpose of loading qtp add-ins?

0 Answers  


What is fragmentation and paging?

0 Answers  


What is the exact difference between QTP and RFT ?

2 Answers   CTS,


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.

0 Answers  


How to find duplicates in an array and remove them efficiently?

2 Answers  






What is the parameterization?

0 Answers  


What are the things(properties, and other details) will be recorded while recording an object using normal recording?

0 Answers  


whenever U using QTP,Test Director, Why we using separate Bug tracking tool?

0 Answers  


How you calling actions in qtp?

0 Answers  


Write a script to delete a specific row in a webtable.

2 Answers   Tech Mahindra,


What kind of errors can b handled in QTP in real time scenario?

2 Answers   AZTEC,


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

2 Answers  


Categories