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

how quick test record on dynamically generated urls and web pages.

3 Answers   Infosys, Satyam,


i have batch scripts in qtp and i want to update the status like pass/fail in excel sheet after excecuting the every script in batch.how to write the script for this?

1 Answers   IBM,


what is automation(qtp)bug pls giv me one ex?

1 Answers  


I have 1 to 10 action are there, i want action1 output becomes to action 10 input? pls any can give script for this scenario?

5 Answers   AZTEC,


what is check point?

2 Answers  






I need to know how to Automate a Username and Password for a Web-based product? I'm scripting 3 different types of surveys but each Survey requires a Username and Password which is always the same. I can I do this using QTP?

3 Answers  


What is iteration? How it is related to Test Results in QTP?

2 Answers  


what is keyword driven framework in qtp.

13 Answers   Cognizant, TCS,


How Exactly we can find out the INDEX No. of any object of an application when we test that application in QTP? Explain this by giving me the example of all LINKS of G-Mail (including home page, User-account page and all possible pages you ever seen in G Mail)?????? and if your answer is that as per appearance of objects(LINKS) in application we can find out the index number in application then tell me how you find out which object(LINK) having INDEX No. 1,2,3 and so on and how you say which object(LINK) is appeared first and which is last?

4 Answers   Infosys,


hi how could i get installation guide for QTP 9.0 on XP help me for this !!!!!

1 Answers  


i have .xls,.txt,.doc files are there (together). i want find only .xls file among them? how can we write function?

3 Answers   CTS,


Output values? i want a practical example

0 Answers  


Categories