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 many types of Automation frameworks are there in UFT? Describe them.

0 Answers  


In Object Repository, two actions r there. Action1 name is A.tsr, Action2 name is B.tsr. Is it Possible? if Yes, what is the out put of A+B? if No, why?

2 Answers   Kanbay,


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

0 Answers  


how you have used object libraries? plzzzzz do answer

1 Answers  


how we connect oracle or sql data server database to qtp. Hi Ram I was your answer for this. Can you kindly let me know in details steps on How we can connect to database. i am using QTP9.2 and SQL Server Database. I am new for QTP and this would be of great help.Thanks

2 Answers  






How can we call Winrunner functions from QTP?

1 Answers  


How to call a function in QTP?

4 Answers  


who is the best faculty in Hyderabad for QTP?

47 Answers   IBM,


In QTP, As a first step wht we will do before going to start a Automation....when it will be decided that we have to go for a Automatio..and who will decide to go for Automation. Any body can pls let me know.. Thanks in Advance..

1 Answers   Wipro,


what is run-time data?

0 Answers  


What is text check point and text area check point?

0 Answers  


How many add-ins comes by default with qtp?

0 Answers  


Categories