hi,
In A Table there are some columns and dynamic rows and in each
row in first column there is a link with name. upon clicking on
that link it will show some details. write the vbscript to check
that link without descriptive programming?

Answers were Sorted based on User's Feedback



hi, In A Table there are some columns and dynamic rows and in each row in first column there is a ..

Answer / kshama

I think the question asked was that you have to search for
"Testing" word from the name column.

Follow the below given steps:
1. prepare an excel sheet whose colums are dynamic and rows
are static.
2.Rename the "sheet1" with any name say for an eg:- "Data"
3.suppose excel sheet contains columns like Name, class and
section. and in "Name" column you have to search for the
word "Testing".
4.In Qtp write the following scipt.
datatable.addsheet"vital"
'Vital is the name of the virtual sheet in QTP'
datatable.importsheet"Pathe of the Excel sheet","Data","vital"
rc=datatable.getsheet("vital".getrowcount
MsgBox rc
For i=1 to rc
Dim a
a=datatable.value="Name","vital"
if a="Testing"
MsgBox "Testing"
Endif
Next

Is This Answer Correct ?    2 Yes 3 No

hi, In A Table there are some columns and dynamic rows and in each row in first column there is a ..

Answer / pramod mallick

I think, the table mentioned here is not Excel sheet. It is
a html table on a web page, where 1st colum contains links
with name="name".

So, the porblem is when you 1st record the script, there
are 2 rows (example) and 2 links with description = "name",
so, qtp object repository will add location property to
link (1st link = Location:0, 2nd Link = Location:1 etc..)

When you execute the script, there are 5 links with
name="name" (because of 5 dynamic rows added). Now, how do
you select /click other 3 links (3,4 and 5). Because, you
have only 2 Links recorded.

The 1st and best solution is descriptive programming. The
interviewer asked for without desriptiev programming.

The psedu code is given below.
-- Record only one link (with location:0)

Do

browser.page.frame.Link(location:0).Click
-- Change object description for Link, Update Location
to 1 instead of 0.
bExist = Browser(b).Page(p).Link.Exists

Loop While bExist = True

Is This Answer Correct ?    1 Yes 3 No

Post New Answer

More QTP Interview Questions

1.what is test automation life cycle?

1 Answers   IBM,


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,


Explain the difference between check point and output value?

0 Answers  


in a database table there are 3 columns (name , marks,grade) , in application after retrieving data from db to fields name, marks click ok button then grade should displayed ---for this how to write vb script prgm

3 Answers   IBM,


How to connect to oracle(sqlserver) database to QTP

3 Answers   CTS,






Can u call txt extension file in QTP?

2 Answers   Cap Gemini,


Regular expressions..... Actually how to use this and what is the exact syntax and can anybody can help me out this with example.is there any docs pls send to my mailid rvreddy82@gmail.com

1 Answers   UHG,


what is the use of VIRTUAL OBJECTS? explain ?

4 Answers  


Does Low-level recording capture mouse movements?

0 Answers  


In a flight window we have to enter the name and meal request for every passenger.In that window if we give Total passengers=1 then the Psngr1 name field and psngr1 meal request field will reflects.if we give Total passengers=2 then Psngr1 name field and psngr1 meal request field,Psngr2 name field and psngr2 meal request field and so on. how we can handle this scenerio thru Descriptive programming?

0 Answers  


What is fragmentation and paging?

0 Answers  


How the automated tests in org

1 Answers   Maintec,


Categories