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
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 |
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 |
Hello Everyone, In QTP we have one option Data Driver wizard that comes in Tools -> Data Driver. so, please tell me abtout the use of Add Value and Parameterize options available in Data Driver wizard. And also the concept of value, constants, Parameterized displayed in the wizard. Please explain by giving the example. Thanks in advance, Gaytri
How many types of recording modes in qtp? Which will be used when?
Hi, Plz give best Definition of Software Testing? Why we need Software Testing? and plz send 2+yrs experience Interview qutions (Manual,Qtp).
How do I lauch my test website using code from qtp in different environmet, uat and PPTE?
can we install qtp in windows vista
I installed QTP 9.5 on vista. Can someone please provide me the license key of the same. Thanks, Avi
how to reverse the string without using bultin functions(i.e mean mid,len ,reverse functions)
what is keyword driven testing in qtp?n how is it useful?
hi i have completed my b.tech in cse stream. now i am working in an organisation in testing department. i want do sap course but i dnt know which module will boost my career can anyone suggest me which is good for my career
Few basic questions on commonly used Excel VBA functions.
In this bellow script QTP is not able to getting no. of Links from my Browser. Set desc=description.create desc("micclass").value="Link" Set obj=Browser("creationtime:=0").page("title:=.*").childobjects(desc) msgbox obj.count I am getting "General Run Error".Why QTP is not supporting my Browser,but its running fine in other system.Please help me to overcome this problem.
i am a begnner so am learning Error handling :tried using Recovery manager didnt work i want to be able to handle errors , e.g. if while running the test the folwoing does not show up then how can i use the If then else and goto next step in the test, as in many scenarios it does not show up Browser("The Shopping Channel -").Page("The Shopping Channel -_8").Image("easy pay").Click