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?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How many types of trigger events are there in qtp?

551


To which environments does quicktest professional supports?

543


Explain the concept of object repository and how quicktest professional recognises objects?

561


what is the advantages and disadvantages of using functions instead of re usable actions

1433


Is it possible to split an action? How?

662






How many ways we can parameterize data in quicktest professional (qtp)?

586


what is the diffrence bw qtp architectute and qtp framework?

1544


hi all can any body explain how to write the script for finding the mandatory fields which are having [red Astrik sign (*)]

1462


How to run a test using quicktest professional (qtp)?

546


how do i know how to use tools

1455


Can testing be done on the production system, or will a separate test system be required? How are browser caching, variations in browser option settings, dial-up connection variabilities, and real-world internet 'traffic congestion' problems to be accounted for in testing?

621


what frame work you are following?

1529


what is clean sweep?

1889


Explain how you can find length of array in qtp?

601


How to create Reusable and Multiple Actions?

1713