qtp faq's

95
Q. Can any one tell me how to create the shared object repository Ans: hi this is susmitha,object repositary means it is a storage place where one can stre the object information and it behaves like an interface b/w application and the test script.where in the shared repositary we can store more than one application s objects informationit can be associated with multiple test scripts.the maintainance is easy but it takes more time while running.open OR--> eport--->specify the name to store the objects as shared like .tsr file that is test shared repositary ---->save and ok i think u [email protected] OR I am new to QTP9.0, can anyone tell me how to create shared object repository Q. Difference between action and function Ans: Action: Action is a collection of Vb statements in QTP. It doesnt return any values. Function: Function collection of Vb statements in QTP. It returns single value. OR Action is a thing specific to QTP while functions are a generic thing which is a feature of VB Scripting. Action can have a object repository associated with it while a function can't. A function is just lines of code with some/none parameters and a single return value while an action can have more than one output parameters. Where to use function or action: Well answer depends on the scenario. If you want to use the OR feature then you have to go for Action only. If the functionality is not about any automation script i.e. a function like getting a string between to specific characters, now this is something not specific to QTP and can be done on

Upload: rkrishnakamboji

Post on 23-Nov-2014

469 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: QTP Faq's

Q. Can any one tell me how to create the shared object repositoryAns: hi this is susmitha,object repositary means it is a storage place where one can stre the object information and it behaves like an interface b/w application and the test script.where in the shared repositary we can store more than one application s objects informationit can be associated with multiple test scripts.the maintainance is easy but it takes more time while running.open OR--> eport--->specify the name to store the objects as shared like .tsr file that is test shared repositary ---->save and ok i think u [email protected]

OR

I am new to QTP9.0, can anyone tell me how to create shared object repository Q. Difference between action and functionAns: Action:

Action is a collection of Vb statements in QTP.

It doesnt return any values.

Function:

Function collection of Vb statements in QTP.

It returns single value.

OR Action is a thing specific to QTP while functions are a generic thing which is a

feature of VB Scripting. Action can have a object repository

associated with it while a function can't. A function is just lines of code with some/none parameters and a single return value while an action can

have more than one output parameters.

Where to use function or action:Well answer depends on the scenario. If you want to use the OR feature then you have to go for Action only. If the functionality is not about any

automation script i.e. a function like getting a string between to specific characters, now this is something not specific to QTP and can be done on

pure VB Script, so this should be done in a function and not an action. Code specific to QTP can also be put into an function using DP. Decision of

using function/action depends on what any one would be comfortable using in a given situation.Q. does qtp supports rational developed scripts.Ans: hi

upto my knowledge it's not possible, because qtp is mercury interactive product and ration robot is other product, qtp supports winrunner scripts...

Page 2: QTP Faq's

Q. hi friends plz tell me the script to stop an iteration and start from the next iteration?Ans: hi

with using exitglobaliteration function you achieve that,

for more details u can go to help menu in qtp tool

bhadra

Q. Hi friends, how to get a value from a text box during run time and parameterize it to another step?Ans: You will need to use an output parameter to get the text from the textbox and then use an input parameter to input it where you need it.

You also may as well use a the data table in your expert view.

Q. Hi,Can anyone tell me how to run QTP scripts at DOS prompt?

Ans: Here is the answer for how to run DOS command in QTP..Hope this will be useful fro you.

You can run standard DOS commands in your QuickTest test using the

VBScript Windows Scripting Host Shell object (WSCript.shell). For example,

you can open a DOS command window, change the path to C:, and

execute the DIR command using the following statements:

Dim oShell

Set oShell = CreateObject ("WSCript.shell")

oShell.run "cmd /K CD C: & Dir"

Set oShell = Nothing

For more information, refer to the Microsoft VBScript Language Reference

(choose Help > QuickTest Professional Help > VBScript Reference >

VBScript).

ORhello everyne,

i m using the window object in qtp and i want to pass the window name as an argument which is stored in a variable.

like:

Page 3: QTP Faq's

window("arg1").window("button").close

i m unable to write a syntax for passing arg1(window name) in the code in QTP.

i shall be greatful if somebody could help me in this regard.

thanks,

rosy

OR

Try This,

arg1="my window"

window(arg1).winbutton("ok").click

Q. how do we create functions in qtp and call the functions?Ans:

What ever the functions(one or many) you would like to write create in the notepad and save it as filename.vbs.Go to your test click on the testsettings in the TEST tab. Again go to the resources tab and click on the +(plus appears in green color) symbol and give the absolute path or u can browse.In the script where ever you want call using CALL funcName(parameters list). ORYou are upsolutely correct.Also if you want to execute file   Execute file and path nameEx:Execute File C:Program FilesMercury InteractiveQuickTest ProfessionalTestslibrary1.vbsQ. How do you close the Task Manager through QTP?Ans: First you should add the Task Manager dialog box in the object repository.This is not a modal dialog box so you can add it to repository easily.Then use following simple code.

If Dialog("Windows Task Manager").Exist Then    Dialog("Windows Task Manager").Close    Reporter.ReportEvent micPass,"Task Manager","Successfully closed task       manager"  Else      Reporter.ReportEvent micFail,"Task Manager","Task Manager is not open" End If  Q. How do you validate Email textfield using QTP.Ans: HiI am not exactly sure of the solution u can just try writing some stubs for validating the email field.The below is simple example for validating text box with only numeric values.Similarly u can write a stub which will except email validation creteria.EX: Q. How to access a test input parameter?Ans: Hi,

Using  Parameter("Parameter Variable").

Page 4: QTP Faq's

regards,

Purna

Q. How to capture data from images in QTP and produce them in Excel sheet ?

Ans: select the cell in data table and right click,select import.

By importing data we can load it in to the Excel sheet(Data Table).

Q. how to capture the window in qtp while writing script and it should run while running scriptAns: hi

there are two way to handle this situation, one is you have to add the objects to object repository before going to run, second is you have to use descriptive programming, OK

Q. How to compare two excel sheets?Need any sample Scrpt....Ans: Hi,

We have option for comparing the Excel Sheets. For generataing macros we compared.

And another one option is, using if condition we compare the two cells, and apply for the whole.

Thanks

Barna

Q. How to execute a batch of scripts in QTP?Ans: open test batch runner tool

start--> allprograms-->QTP-->Tools-->testbatch runner

add QTP scipts

run scripts;

in addtion to this u need to enble check box to allow other mercury products to run tests and components in run options from tools menu

OR

hi

Page 5: QTP Faq's

u can use test batch runner from tools option or u can create one action then go to where u created the action(i mean source) there u can find action0, open that file in notepad there u can write which actions you want to execute sequentially, it is like call to existing action

bhadra

Q. how to write the script for database connection then doing parametrization in the same script.Ans: hi,

   to connect to a database u require a connection       dim con,rs    set con=createobject("adodb.connection")

     set rs=createobject("adodb.recordset")

   con.open "dsn=..........;user id=........,password;server name=......;database=........"

    rs.open "select empno from emp",con   empid=rs(0)   browser("google").page("google").webradiogroup("group1").select empid   con.closers.close

Q. Is there any method to measure how long it takes to run a set of test steps in QTP?Ans: USE Transaction Item OR

You can measure how long it takes to run a section of your test by defining transactions.

----

Sudarshan

OR

yes, we have u can get that from using start transaction and stop transaction and then you will find the difference of two transactions, you can get time for entire test or for sub test or for actions....so on.....

bye

bhadra

We can also calculate the time using method called Timer.Q. List the browsers QTP supportsAns: hi

Page 6: QTP Faq's

it depends upon qtp version, because qtp 8.2 supports till internet explorer 6.0, it will not support internet explorer 7.0, to work with i e 7.0 we should have qtp 9.0, apart from qtp supports aol,netscape,internet explorer only. for further information see help menu in qtp.

OR

QTP supports Firefox 1.5, Netscape 8, Internet Explorer 7 browsers

OR

hi

thank u .

one small question

how u conduct the test batch in qtp ?

for any clarification send an mail to [email protected]

ok takecare byeee

byeee

Q. Objects not found in the repository Error in qtp.Ans: I had written a script in QTP which was working fine when i executed.(Saved the script)But when i executed the same script after 2 days. An error occurred saying that "Objects not found in the repository". Why is this happening.Kindly give me the answer. Its urgent OR

Hi This si praveen yarlagadda,

please add the properties again to the OR and execute the scriptQ.QTP   |   Question 361 of 449    |  Print  |  Send To Friend  QTP and CITRIX terminal server Access questionAns: I need to automate tests on a inhouse built application. This application can be accesed through CITRIX terminal server. How can I connect to this server via QTP and access the application.Is there any special add-in required or functions I need to call? Any kind of help is appreciated. If you could point me to any material that might help will also be very helpfulThanks in advance ORHi, CITRIX is like a different platform, if u want to record or develop any scripts in CITRIX using QTP you need to install QTP in the CITRIX server, and in u r local machine u install CITRIX Neighbour wood.Q. Suppose in 1st Action we had two variables , Can we able to call that variables in Second Action

Page 7: QTP Faq's

Ans: Yes, we can call the variables by that variable as "option Explicit".

Regards,

Vamsi. ORhihow u call the first function variable to ur 2nd function, declare that variables outside for all the functionsor call second function in the first function itself.FIRST SCENARIOvar a =10var b=20function addres=a+bend functionfunction SUBres=a-bend functionSECOND SCENARIO FUNCTION RESa=50,b=60 res= ADD(a,b)res=sub(a,b)end functioni think u [email protected] ORHi,you can either use Action parameters(output parameters) to pass values between 2 actions. or even better solution is to use environment variables.define 2 environment variables in Settings - > environment tab as user-defined variables.lets call it EnvVarA and EnvVarBin Action 1, you can user statementsEnvironment("EnvVarA") = "variable 1"in action 2, you can use it to retrieve value stored in action1such as x = Environment("EnvVarA")this should help ORu need to add the variables in input parameters in seocond action and output variables in first action.

u can call the 1st action variables in second action by using Variable1 = Parameter.Item("1Variable")Q. What are checkpoints in QTP and its importance.

Ans: A checkpoint verifies that expected information is displayed in an Application while the test is running.

 

You can add eight types of checkpoints to your test for standard web objects using QTP.

a).A page checkpoint checks the characteristics of an Application.

b).A text checkpoint checks that a text string is displayed in the appropriate place on an Application.

c).An object checkpoint (Standard) checks the values of an object on an Application.

d).An image checkpoint checks the values of an image on an Application.

e).A table checkpoint checks information within a table on a Application.

f).An Accessibility checkpoint checks the web page for Section 508 compliance.

g).An XML checkpoint checks the contents of individual XML data files or XML documents that are part of your Web application.

h). A database checkpoint checks the contents of databases accessed by your web site

Page 8: QTP Faq's

OR

hi

in qtp 8.2 we have 8 checkpoints which works as 11 checkpoints

1.standard checkpoint: it will useful to check the object properties as well as works as

         a.pagecheckpoint b.imagecheckpoint c.table checkpoint

2.textcheckpoint: it will useful tocheck text on application(web & windows applications)

3.textareacheckpoint: it will useful to check text area on applibcation(windows applications)

4.databasecheckpoint: it will useful to check the database

5.bitmap checkpoint:to check the bitmaps

6.accessibility checkpoint: for web applications only, is the web application follows www consortium rules of section 508 or not,

7.xmlcheckpoint: for xml pages and frames................i don't know clearly

8.xmlcheckpoint(File): to check the xml files-------i don't know clearly

bhadra

Q. what is descriptive programming in qtp?Ans: It refers to creating a script from business requirement . OR

Descriptive programming is a technique by which we can perform actions on objects which are not in the object repository.

The below example uses descriptive programming to login to an application by providing the user id and pwd

There are two ways in which descriptive programming can be used :

* By creating properties collection object

Dim uid,pwdDim objPropBrowser,objPropPageDim objPropImageLogin,objPropWebEditUsrName,objPropWebEditPwd

uid="abc"

pwd="123"

Set objPropBrowser  = Description.CreateSet objPropPage  = Description.CreateSet objPropImageLogin = Description.Create

Page 9: QTP Faq's

Set objPropWebEditUsrName  = Description.CreateSet objPropWebEditPwd  = Description.Create

objPropBrowser("name").value="Login"objPropBrowser("title").value="Login"

'objPropPage("name").value="root"objPropPage("url").value="url link"objPropPage("title").value="Login"

objPropWebEditUsrName("name").value="username"objPropWebEditUsrName("type").value="text"

objPropWebEditPwd("name").value="password"objPropWebEditPwd("type").value="password"

objPropImageLogin("name").value="Image"objPropImageLogin("image type").value="Image Link"objPropImageLogin("alt").value="Login"objPropImageLogin("abs_x").value="510"objPropImageLogin("abs_y").value="334"objPropImageLogin("x").value="510"objPropImageLogin("y").value="241"

Browser(objPropBrowser).Page(objPropPage).WebEdit(objPropWebEditUsrName).ClickBrowser(objPropBrowser).Page(objPropPage).WebEdit(objPropWebEditUsrName). Set uidBrowser(objPropBrowser).Page(objPropPage).WebEdit(objPropWebEditPwd). Set pwd

'Browser(objPropBrowser).Page(objPropPage).WebEdit(objPropWebEditUsrName). Set "ujwal"'Browser(objPropBrowser).Page(objPropPage).WebEdit(objPropWebEditPwd). Set "password"

Browser(objPropBrowser).Page(objPropPage).Image(objPropImageLogin).Click

* By giving description in the from of string arguments.

Dim uid,pwd

uid="abc"

pwd="123"

Browser("title:=Login","name:=Login").Page("title:=Login").WebEdit("name:=username","type:=text").Set uidBrowser("title:=Login","name:=Login").Page("title:=Login").WebEdit("name:=password","type:=password").Set pwdBrowser("title:=Login","name:=Login").Image("name:=Image","file name:=b-login.gif").Click

Q. what is the difference between Call to Action and Copy Of Action in QTP. Why are they used.Ans: When you want to use a reusable action without making any change in the code then you should use 'Call to existing action'.

But if you want to make changes in the reusable as per your requirements then ypu should call 'Call to copy of an action'. OR

Page 10: QTP Faq's

hai,

there is diff in these actions.we use this actions in modular framework. these are reusable.in call to existing action we canot make change or customize script as u wish.if u dont clear once u see call to existing action keep cursor and try to add ,u canot. but in call to copy action u can in which ever way u wantQ. What is the standard time taken to find a defect using QTP?Ans: hi

there is no specific time to find a defect using QTP, it depends upon the project and defects,

ORIt all depends on the synchronisation time set for the particular script. ORIt depends on object repository type

1. Per action repository type

2. Shared object repository typeQ. what is virtual function?Ans: The base class function is declered as virtual so that the derived class can have single copy of the particular function.The base class function redefined in the derived class.Q. When do you add database check points during recording or after recording.Ans: Hi

U Can add Data base check point while recording or even after recording. the only difference is the "Insert statement option will not available when adding a checkpoint during recording or when modifying an existing object checkpoint. It is available when adding a new checkpoint to an existing test or component while editing it.

RegardsBindu DeyQ. when we save any test it will automatically save as folder which are the files generated in it?Ans: hi

the folder consists of action 0, action 1,.mtr and other files which is useful to retrieve the test when you call it, ok

OR

test folder contains datatable,lock file,parameters file and action0, action1 folders. these folder contain object repository file as .bdb,Script file as .mts, and resources file as .mtr

Q. After I installed IE 7.0, My scripts are failing, Suggest me How to over come this problem?

Ans: You did not mention the QTP version that u r using.

QTP 8.2 does not support IE 7.0

Page 11: QTP Faq's

U need to install QTP 9.0 or the latest version 9.1 which is certified with IE 7.0.

Q. Can any one tell how to use Vitual Object in QTP ?

Ans:

You can teach Quick Test to recognize any area of your application as an object by defining it as a virtual object. Virtual objects enable you to record and run tests on objects that are not normally recognized by Quick Test. Using the Virtual Object Wizard, you can map a virtual object to a standard object class, specify the boundaries and the parent of the virtual object, and assign it a logical name.

Q. can anybody give me the script for inserting data into a table of access through qtp

Ans: VBScript File ---------------

Public function DbDemo(param1)

Dim Cnxn, strCnxnDim rsCustomers, strSQLCustomersDim fld, Err

Set Cnxn = CreateObject("ADODB.Connection")Set rsCustomers = CreateObject("ADODB.RecordSet") strCnxn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:Program FilesMercury InteractiveQuickTest Professionalsamples lightapp light32.mdb;User Id=admin;Password=;"            Cnxn.Open strCnxn

MsgBox "connected"

rsCustomers.Open strSQLCustomers, Cnxn, 3, 3, &H0001

strSQLCustomers = " Insert into OrderTable(Customer_Name) values ='" & param1 & "'"

Cnxn.Close

End function

QTP Script -------------

CustName = Datatable(Customer_Name,dtGlobalsheet)'getting the value(Customer Name) from the DataTable

ExecuteFile "C:DbDemo.vbs" 'Executing the VBscript FileDBDemo(CustName) 'Calling the Function in the VBScript File

Q. Can anyone help me in creating script for Log-in field?

Page 12: QTP Faq's

Ans: script for login field window("Login").Winedit("UserName").set "UserName" Window("Login").Winedit("Password").set "Password" Window (Login").Winbutton("Ok").Click

OR

needed complete Qtp framework and diffe types of framework we have in QTP

OR

Hi. This is ramsh kolla

i am a new entry

script for login field

Dialog("Login").Winedit("UserName").set "UserName"

Dialog("Login").Winedit("Password").set "EncriptedPassword"

Dialog("login").winbutton("ok").Click

OR

All the members explained their views only for windows based appli...

Here i'm gng too explain abt Web bases Login form:

Browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours").WebEdit("userName").Set "aneesurs"Browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours").WebEdit("password").SetSecure "451d1d0c480846d5f5a495296ebc096f46e1"Browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours").Image("Sign-In").Click 16,8

Rgds,

Anees

Q. Can I compare two DataBases using QTP?

Ans: u can use ado object do it.

Code Example:

Dim Conn Dim Conn2

Dim rs Dim rs2

Dim Sql Dim Sql2       

Page 13: QTP Faq's

Set Conn = CreateObject("ADODB.Connection")Set Conn2 = CreateObject("ADODB.Connection")

Conn.Open "link database string"Conn2.Open "link other database string"

Sql = "select * from TableName1" sql2="select * from TableName2"

Set rs = CreateObject("ADODB.Recordset")

rs.Open Sql, Conn, 2, 2rs2.Open Sql2, Conn, 2, 2

Do while not rs.eof   if rs.fields(i)=rs2.filds(i) then      rs.MoveNext      rs2.MoveNext       i=i+1   else      exit      "do want"   endif loop

rs.closers1.closeconn.closeconn1.close

set rs=nothingset rs2=nothingset conn=nothingset conn2=nothing

Q. Can somebody give me few examples for using regular expression?

Ans: The following example is used to identify numbers in the input givenSet reg=new regexpreg.pattern="d+"reg.global=truereg.ignorecase=trueSet m=reg.execute("This is India 2006 and I am proud to be an INDIAN 999")For each n in m msgbox n.valueNextEven regular expressions are used in check points and string replacing functions.

OR

The following code illustrates how to obtain a SubMatches collection from a regular expression search and how to access its individual members:

Function SubMatchTest(inpStr) Dim oRe, oMatch, oMatches Set oRe = New RegExp ' Look for an e-mail address (not a perfect RegExp) oRe.Pattern = "(w+)@(w+).(w+)" ' Get the Matches collection Set oMatches = oRe.Execute(inpStr) ' Get the first item in the Matches collection Set oMatch = oMatches(0) ' Create the results string. ' The Match object is the entire match - [email protected] retStr = "Email address is: " & oMatch & vbNewline ' Get the sub-matched parts of the address. retStr = retStr & "Email alias is: " & oMatch.SubMatches(0) ' dragon retStr = retStr & vbNewline retStr = retStr & "Organization is: " & oMatch.

Page 14: QTP Faq's

SubMatches(1)' xyzzy SubMatchTest = retStrEnd FunctionMsgBox(SubMatchTest("Please send mail to [email protected]. Thanks!")) ---------------------------------------------------------------------------------------

The following code is for Regular expression illustrates the use of the Pattern property.

Function RegExpTest(patrn, strng) Dim regEx, Match, Matches ' Create variable. Set regEx = New RegExp ' Create a regular expression. regEx.Pattern = patrn ' Set pattern. regEx.IgnoreCase = True ' Set case insensitivity. regEx.Global = True ' Set global applicability. Set Matches = regEx.Execute(strng) ' Execute search. For Each Match in Matches ' Iterate Matches collection. RetStr = RetStr & "Match found at position " RetStr = RetStr & Match.FirstIndex & ". Match Value is '" RetStr = RetStr & Match.Value & "'." & vbCRLF Next RegExpTest = RetStrEnd FunctionMsgBox(RegExpTest("is.", "IS1 is2 IS3 is4"))

Q. Can u write a sample code of Descriptive progamming for yahoo login form?

Ans: This is the code for Yahoo Photos Website you can do the same for the yahoo by changing the values in the required places.CODE: Browser("title:=Yahoo! Photos*.*").page("title:=Yahoo! Photos*.*").WebEdit("name:=login").set "srinivas" Browser("title:=Yahoo! Photos*.*").page("title:=Yahoo! Photos*.*").WebEdit("name:=passwd").set "test"Browser("title:=Yahoo! Photos*.*").page("title:=Yahoo! Photos*.*").WebButton("name:=Sign In").click

OR

Hi Srinivas,

If you have any documents related to "Descriptive Programming", Can you please send those documents. I am in urgent need of that document.

Thanks in Advance,

Prasanna Laxmi

Q. Can we execute winrunner TSL in QTP?

Ans: Yes we can execute TSL SCRIPTS IN QTP. Ist execute the script in WR then save it in a corresponding folder.Go to QTP MENU BAR INSERT ------ CALLTO WR.

OR

HI,

YES, WE CAN EXICUTE TSL IN QTP

OR

Page 15: QTP Faq's

yes,we can

record and save scripts in wr after we run it .save corresponding gui file also

then in qtp:insert menu-select call to wr-test option(for tests)

and then browse the wr file test path

click on ok and close it

this will insert a test script in qtp as TSL Test.runtestEx"tsl btest path",t/f,t/f

the first T/L isboolean value true for -run wr minimised

second T/F isclose wr after test run

similarly we can call compile modulles of wr in qtp

OR

You can insert a call to a WinRunner test using the Call to WinRunner Test

dialog box or  TSLTest.RunTestEx statement in VBScript in the Expert View. example:

TSLTest.RunTestEx "C:WinRunnerTestsbasic_flight",TRUE, 0, "MyValue"

The RunTestEx method has the following syntax:

TSLTest.RunTestEx TestPath , RunMinimized, CloseApp [ , Parameters ].

Q. Can we put checkpoint to text which is already been parameterized?

Ans: Yes.

Q. describe object repository modes with example

Ans: QTP supports 2 types of object repository modes.

1. Per-Action repository mode: In this, for each action a seperate object repository file is created. So object1 in Action1 is different from the same object1 in Action2. So it is wastage of memory. And each object repository file is saved when a test is saved. This mode is most useful, when the object does not change frequently and a few actions are associated with the test. If the object changes in the application, then we need to changed each of the object repository.

2. Shared object repository: In this, common object repository file can be used for muliple actions and multile tests. So Object1 is action1 is same for Action2, because all the objects are saved at one place. Here if the object changes, then we need to update a single object repository file.

OR

Page 16: QTP Faq's

HOW DO YOU READ A .TSR FILE. i MEAN HOW DO YOU READ THE SCRIPT . dO YOU OPEN THE .TSR FILE IN NOTEPAD ELSE...

CHEERS

CHAKRI

Q. Difference between action and function

Ans: Action:

Action is a collection of Vb statements in QTP.

It doesnt return any values.

Function:

Function collection of Vb statements in QTP.

It returns single value.

OR

Action is a thing specific to QTP while functions are a generic thing which is a feature of VB Scripting. Action can have a object repository

associated with it while a function can't. A function is just lines of code with some/none parameters and a single return value while an action can

have more than one output parameters.

Where to use function or action:Well answer depends on the scenario. If you want to use the OR feature then you have to go for Action only. If the functionality is not about any

automation script i.e. a function like getting a string between to specific characters, now this is something not specific to QTP and can be done on

pure VB Script, so this should be done in a function and not an action. Code specific to QTP can also be put into an function using DP. Decision of

using function/action depends on what any one would be comfortable using in a given situation.

Q. does qtp supports rational developed scripts

Ans: hi

upto my knowledge it's not possible, because qtp is mercury interactive product and ration robot is other product, qtp supports winrunner scripts...

bhadra

Page 17: QTP Faq's

Q. Hi All,In Qtp how to get text available in html frame.

ThanksSenthilkumar

Ans: In QTP, There is function called  GetRoproperty("innertext")

by using this u will get the innertext of any particular feature.

Regards,

Shiva.P

Q. hi friends plz tell me the script to stop an iteration and start from the next iteration?

Ans: hi

with using exitglobaliteration function you achieve that,

for more details u can go to help menu in qtp tool

bhadra

Q. Hi please give me the steps to record Java application in QTP 8.2? Please give detailed steps?

Ans:

1)First install java-addin along with QTP.

2)Set the reqired properties for objects to identify the objects in Tools..>Object identification(Mandatory and assistive properties)

3)Test--->Click Record-->Select javaoption.or click F3.

The script will come as..

Javawindow("").JavaInternalframe("").Javalist("").Select""

OR

Hi Santosh,

In Object Identification, there are two Properties to be added-1)Mandatory 2) Assistive.

First of all we cannot add the same properties in both. They must be different.

I have added all the properties to Mandatory. But its a bit of confusion that to whom i should assign the properties.

Page 18: QTP Faq's

Still it is not recording the Java application. There are tabs, check boxes, buttons in the application , which are not recorded! in QTP

The other way is if i click on Low level recording then it records all the things. Which i think is not a rite way.

Please guide

Q. Hi. How do we make regular expression of a 3 digit number?

Ans: If the task is to find a three digit number in given input the following code works

Set reg=new regexpreg.pattern="[1-9][0-9][0-9]"    'This matches with only 3-digit numbersreg.global=trueSet m=reg.execute("This is 100,206,10,1,444")For each n in m msgbox n.valueNext

Q. How can I add an action (external action) programmatically?

Ans: You can add action using the command: RUN ACTION action name,[Iteration name, Iteration range]. But it won't work untill you call the copy of external action from the menue bar,to call the objects associated with that called actiuon.

Q. How can i get all values of a single column into an excel sheet(in different rows)??

Ans: DataTable.GetRowCount : Returns the total number of rows in the longest column in the first sheet in the run-time Data Table (global sheet).

using a for loop we can get the necessary data.

(If ther is a better way pls let me know)

Q. How can i update data into MYSQL database through QTP

Ans:

Write steps to connect with the database in Expert View,define your database and tables, once you are connected with the database you can update the data.

OR

Hi,

Control pannel->Admin tools->ODBC;

Page 19: QTP Faq's

1)configure first two tab of ODBC settings to the respective SQL server

2)QTP->Insert Database checkpoint and click on create button-> and config the database to which u need to run the query...

Thxs

Sanjeev

OR

can u tell me how to get the connection done...

i'm not able to connect to database from expert view

Q. how do i automate the .net application?and give complete procedure in detail.Ans: Hi,

You are not clear in your question. First tell me whether it is the window based or web based application.

When you are using QTP first add .net add-in available with mercury site ( free) and then start doing .

For windows based

give the path of the .exe file in the windows tab of the recrord and run settings and do the rest of the work like any other application.

Note : after adding the .net add-in you amy not find the .net tab in the record and run settins.

For web based application

give the path of the url in the web tab of the record  and run settings. and do the rest lik all other web applications

regards

Srikanth N.

Q. How do I connect to database (Access in my case) from QTP?

Ans: yes u can connect through DSN.( create DSN from control panel).And create bd copnnective object like, set dbconnect= createobject("ADODB>connection"). and checkdbcfonnection.open is true or not.

Q. How do we add object repository dynamically?(During runtime)

Ans: Hi you can use the following code to dynamically load the O.R

Page 20: QTP Faq's

   Set Apps=createobject("quicktest.application")   Apps.Test.Settings.Resources.objectrepositorypath="ObjectRepositoryPath"   Set Apps=nothing

Regards,

Satish

OR

your answer is simply  superb. Thank you very much

Q. how do we make function libraries?

Ans: We can make function libraries by wirting VB script functions in the ".vbs" file. We can reuse this vbs functions in the QTP by adding this file in the settings.

OR

Just write your code in a .VBS file in any text editor.Add the following code in your test (in expert view obviously)ExecuteFile "your VBS file path"for exampleExecuteFile "c:My projectValidationQTPLibrariesMyLybrary.vbs"ExecuteFile "[QualityCenter] FolderBPT ResourcesLibrariesMyLybrary.vbs"or, a simple text file can workExecuteFile "c:My projectValidationQTPLibrariesMyLybrary.txt"

Q. how many types of automation frame works are there?

Ans: hi,

    There 3 types of Automation frame works

1.   Data Driven frame work 2.   key board frame work 3.   (1) &(2) both are know as Hybrid frame work

OR

Hi my Friends ,

There are many kinds of framework.

This depend upon the technique and requirement u have .

1:-record and play back Framework

2:-Moduler Framework

3:-Business Function framework

4:-action Driven Framework

5:-data driven Framework

Page 21: QTP Faq's

6:-keyword driven Framework

7:- hybrid Framework 

and many more are there .for more inforamtion u can mai me at [email protected].

any issues u can ask.

OR

Hi,

Four types of Auto mation frame works avilable.

1.Test script modular Frame work (linear modular Frame work)

2.key word driven frame work(Built in QTP)

3.Data driven frame work

4.Test library Architecture Frame work.

hybrid frame work is combination of above four.

Q. how object repository can be merged?

Ans: QuickTest Professional enables you to merge two shared object repositories into a single shared object repository using the Object Repository Merge Tool. You can also use this tool to merge objects from the local object repository of one or more actions into a shared object repository.

You can update a shared object repository by merging local object repositories associated with actions in one or more tests into the shared object repository. The objects that are merged from the local object repositories are then available to any actions that use that shared object repository in any tests.

In the merge process, the objects in the local object repository for the selected action are moved to the target shared object repository. The action then uses the objects from the updated shared object repository.

Q. How to create a new datasource (DSN) in QTP for database checkpoints?

Ans: Hi,

Do the following

1)go to Control panel and in that "administrative tools" and click on "ODBC Data Source".

2)Click on Add

3)Select the driver you want to setup.

Page 22: QTP Faq's

4)suppose your database is in Ms-Access  select "Microsoft acess Driver(*.mdb)...and if it is in "Ms Sql Server" select " SQL Server" and click on "finish" (for instance take ur database is in Ms Sql server)

5)Give the dsn name in the name field and description is optional.Give the server name ..server name is the name (system nameSQLEXPRESS)which it displays when you connect to the sql server where you have server autentication.

6)click on next

7)select the radio button with sql server authentication with login username and password

   login:sa ,Password:sql123 (default)

8)Click on Next , if the username and password is correct then it connects otherwise it displays an error message.

9)check on the "Change the default database in order to select the database" for which you want to create DSN.

10)click on Next /finish... then ok.....

thus your dsn is created.

While creating a database checkpoint "click on the Connection string" and select the DSN name which was created recently.

OR

Can you please tell me how to connect to the Database where I am using IBM DB2.

Q. How to execute a batch of scripts in QTP?

Ans: open test batch runner tool

start--> allprograms-->QTP-->Tools-->testbatch runner

add QTP scipts

run scripts;

in addtion to this u need to enble check box to allow other mercury products to run tests and components in run options from tools menu

OR

hi

u can use test batch runner from tools option or u can create one action then go to where u created the action(i mean source) there u can find action0, open that file in notepad there u can write which actions you want to execute sequentially, it is like call to existing action

bhadra

Page 23: QTP Faq's

Q. How to identify an object whose name changes with time?(that includes seconds also)

Ans: use regular expression for the object name

Q. how to idetify the activex edit box in the descriptive programming

Ans: WebEdit("name:=name of the edit box")

if the name of the edit box is given in the above code we can access the edit box

Q. How to open Exceel sheet using QTP script?

Ans: Hi,

you can open Excel in QTP by using the following command.

SystemUtil.Run"path of the file"

Cheers

Suresh Babu.L

OR

Hi,

To open Excel in QTP following is the Script

SystemUtil.Run"c:Document and settingDesktopxyz.xls"

Cheers

Suresh Babu.L

OR

Hi,

To open Excel in QTP following is the Script

SystemUtil.Run"c:Document and settingDesktopxyz.xls"

Cheers

Suresh Babu.L

      

November 14, 2006 10:03:58 #3 wbe8st   Member Since: April 2006    Total Comments: 1 

Page 24: QTP Faq's

 RE: How to open Exceel sheet using QTP script?

 Hi,

do you want to open your Excel sheet as a database?

here we go:

Filename = "c:x.xls" MyWorkSheet = "[test$]" 'special syntax, sheet name is test

ActiveCon = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" ActiveCon = ActiveCon & Filename ActiveCon = ActiveCon & ";Extended Properties=""Excel 8.0;HDR=NO;IMEX=1;"""     set rsExcel = CreateObject("ADODB.Recordset")rsExcel.LockType = 1rsExcel.ActiveConnection = ActiveCon

rsExcel.Open "Select * from " & MyWorkSheet

msg = ""

for j = 0 to rsExcel.fields.count -1 msg = msg & rsExcel.fields(j).name & "   "nextmsg = msg & vbcrlfmsg = msg & vbcrlf

do while not rsExcel.eoffor j = 0 to rsExcel.fields.count -1 msg = msg &  rsExcel.fields(j) & "   "nextmsg = msg & vbcrlfrsExcel.movenextlooprsExcel.close

msgbox msg

Q. how to place values in QTP data table from weblist at run time?

Ans: Using output values we can view the values that applications are taking during run time

OR

hi komali,

using output values all the values of a weblist are stored in a single cell of the datatable. The values are seperated by ";" . In this case if we want to use 1 value at a time then how do we separate that value from the entire list . I hope you got my point.

thanks in advance,

Page 25: QTP Faq's

ritika

Q. How to record the scripts using the lowlevel recording, analog recording.

Ans: When we need to record Key board or mouse events go for analog recording

The Test->Analog Recording button is activated only while recordingSo click Record first and then go for the Analog RecordingThen you will get a Pop-Up window, Click on Start Analog Record

The script appears to be single line

This is the samething with Lowlevel RecordingWhere we can see all the statements concerned to the actions

Q. How to remove block comments

Ans: QTP 9.0 includes the facility to remove (or add) blocks of comments

Q. how to run batch process in qtp 8.2

Ans: we can the run batch process through test batch runner 

go to test batch runner ->click test bach runner->click add button ->add the test script and run the scripts

OR

Running a Test Batch

You can use Test Batch Runner to run several tests in succession. The results for each test are stored in their default location.

Using Test Batch Runner, you can set up a list of tests and save the list as an .mtb file, so that you can easily run the same batch of tests again, at another time. You can also choose to include or exclude a test in your batch list from running during a batch run.

Notes:

To enable Test Batch Runner to run tests, you must select Allow other Mercury products to run tests and components in the Run tab of the Options dialog box. For more information, see Setting Global Testing Options.

Test Batch Runner can be used only with tests located in the file system. If you want to include tests saved in Quality Center in the batch run, you must first save the tests in the file system. Components cannot be used with Test Batch Runner.

You can stop a test batch run at any time by clicking the Stop button.

Page 26: QTP Faq's

 

To set up and run a test batch:

 

1.      Choose Programs > QuickTest Professional > Tools > Test Batch Runner from the Start menu. The Test Batch Runner dialog box opens.

 

2.      Click the Add button or choose Batch > Add. The Open Test dialog box opens.

 

3.      Select a test you want to include in the test batch list and click Open. The test is added to the list.

4.      Repeat step 3 for each test you want to include in the list. By default, each test selected is added to the bottom of the list.

To insert a test at another point in the list, select the test that is to precede the test you would like to add. When you add the test, it is added above the selected test.

To remove a test from the list, select it and click the Remove button, or choose Batch > Remove.

If you want to include a test in the list, but you do not want the test to be run during the next batch run, clear the check box next to the test name.

5.      If you want to save the batch list, click the Save button, or choose File > Save, and enter a name for the list. The file extension is .mtb.

 

6.      When you are ready to run your test batch, click the Run button or choose Batch > Run. If QuickTest is not already open, it opens and the tests run sequence begins. Once the batch run is complete, you can view the results for each test in its default test results folder (<test folder>res#report).

 

For more information about Test Results, see Analyzing Test Results.

Q. How To run Shared object repository files? in QTP ?

Page 27: QTP Faq's

Ans: For QTP - 8.2

Click on Test->Settings.

Click on Resources Tab

At the right bottom, object repository can be chosen as per-action or shared.

Once you have saved a test with per-action type, you cannot change it to shared.

OR

Click on Test->Settings

Click on Resources Tab

At the right-bottom change object repository type from per-action to shared.

Once you have saved a test script with per-action type of object repository you cannot change it to shared.

OR

I would like to know is there any function to be written to include 2 different Object repository. If yes can i have the script.

OR

You will need to upgrade to QTP 9.0 to maintain separate object repositories

Q. How to use Regular Expression in QTP?Woluld appreciate if you explain with an example?

Ans: QTP comes with extensive help for regular expressions with many examples.

Still giving you a very broad perspective of it -

Suppose we want to regularise an expression which has only digits and can contain a maximum of 2 digits, the expression will be [0-9][0-9]

Now the question arises - how and where to implement this. Suppose an object is recognised by qtp with index 45 in OR. This can change everytime a new instance of IE is created. Its advisable to use regular expressions at such places.

Similarly if we want to regularise characters in suppose text property, use .* to make any text acceptable in this property.

The more you do R&D on this topic, more you'll be comfortable with this. Try to regularise as many expressions as you can using reference material given by QTP. It'll be of great help. I hope this helps you to start.

OR

Page 28: QTP Faq's

You can Import local sheet by Importing the sheet from excel sheet. You can import any sheet from any action, best approach to import all the required sheet at same time at the begining of the test.

You can use the same syntext that you use for the global sheet

For example

Import.DataSheet "c:/..../filename.xls, "Source sheet name", "Destination sheet name"

Import.DataSheet "c:/..../filename.xls, "Global", "Global"

Import.DataSheet "c:/..../filename.xls, "Action1", "Action1"

Q. how to work with file system objects?

Ans: Hi, just go thru the "Quick Test Professional Help"

Q. How to work with Insert Output Value, Insert Bitmap, Insert Accessibility

Ans:

An output value is a step in which one or more values are captured at a

specific point in your test or component and stored for the duration of the

run session. The values can later be used as input at a different point in the

run session.

 

BitMap Checkpoints

 

You can check an area of a Web page or application as a bitmap. While

creating a test or component, you specify the area you want to check by

selecting an object. You can check an entire object or any area within an

object. QuickTest captures the specified object as a bitmap, and inserts a

checkpoint in the test or component. You can also choose to save only the

selected area of the object with your test or component in order to save disk

space.

Page 29: QTP Faq's

When you run the test or component, QuickTest compares the object or

selected area of the object currently displayed on the Web page or

application with the bitmap stored when the test or component was

recorded. If there are differences, QuickTest captures a bitmap of the actual

object and displays it with the expected bitmap in the details portion of the

Test Results window. By comparing the two bitmaps (expected and actual).

To create a bitmap checkpoint while recording:

1 Choose Insert > Checkpoint > Bitmap Checkpoint or click the arrow beside

the Insert Checkpoint button and choose Bitmap Checkpoint.

The saved Bitmap can also be modified.

 

Accessiblity Checkpoint:

Accessibility Checkpoint identifies areas of your Web site that may not

conform to the World Wide Web Consortium (W3C) Web Content

Accessibility Guidelines. For example, guideline 1.1 of the W3C Web

Content Accessibility Guidelines requires you to provide a text equivalent

for every non-text element. You can add an Alt property check to check

whether objects that require the Alt property under this guideline, do in fact

have this tag.

Q. i want code for datadriven testing for 10 iterations in qtp. ex take usename and pwd .

Ans: for i=1 to 9 step 1

dialog("login").winedit("username").set datatable("columname",dtglobalsheet)

dialog("login").winedit("Password").set datatable("columname",dtglobalsheet)

Next

Q. if qtp is not recording any application what the problem is?

Page 30: QTP Faq's

Ans: Check your tools record and run settings properly(web,windows)

OR

 you need to verify whether the add-in which supports the application is installed in QTP or not.

Q. if the the two object have same class then how qtp will find the object

Ans: ur question is 2 ojects have same default properties then how qtp recognizes  to those objects right

if this is the question,  then if u want to know the unique property that is what developers defined to those objects while coading just spy on those objects to see what properties the object have then select the unique property and add that property and also in qtp there is one properrty called smart identification.  enable this property then while running, if there is no unique property in the default properties then qtp checks in the assitive properties and it will give an warning message int he test results window like i learned this object with this assistive property if u want to add that property to ur default property then u can add.

Q. In QTP how many types of data tables are available and explain the same.

Ans: There are two type of data: Global and Action1

Global is like public any where you can access. 

Action is local per specific action only u can use that data.

Action

OR

two types

1.run time data table

2.design time data table

Q. is it necessary to learn VB script to work with QTP or we can manage with keword driven

Ans: Hi,

It's not mandate that one should mastered in Vb script to workwith QTP.It is mostly user friendly and for good results we need to have basic VB or concepts which will suffice.

Have a try and feel the difference.

Prasad

OR

Well, I think VBscript knowledge is a must, if you want to excel in QTP. for a starter , keyword driven approach is good. but you don't want to stop here, do u?

Page 31: QTP Faq's

OR

Only with Record and Playback it wont be doing automation testing in QTP, other than that enchancing the script with

calling external files like Vbscript or DLL's using Descriptive Programming without using Object Repository getting the runtime values from External or Data Table or Flat files using Vbscript files to do Back-end testing, connecting the Database and executing

the Queries

as above enchancing the script, it should must of Vbscript knowledge.

Q. Is QTP case sensitive

Ans: No QTP is not case sensitive

Q. Is there a way to run QTP scripts from commandline without opening QTP

Ans: We can run qtp scripts without opening the qtp, in QTP they have provided one option called the silent test runner. by using this we can execute

OR

But The silent test runner will not run scripts from the command line?

OR

U can run QTP script from the command line

wscript "<filepath.vbs>"

First create .vbs file , in that specify your test path name.

U can run only .vbs file from command Prompt

Q. Is there any options available to handle more than one DataTable Simultaneously in QTP

Ans: Datatable is divided into two types.

1. Local data sheet(For each script u can create ur own data table)

2. Global datasheet(For the entire application u can use only one global datasheet.)

Q. Is there any way to convert .tsr (Object Repository) File to an XML file?

Ans: to my knowledge there is no such tool that does it.

OR

There is a tool by name qantom try this site http://www.qantom.org/ .

Page 32: QTP Faq's

Q. Please explain how to test JAVA tree objects

Ans: For testing Java Objects you need to install an additional Java Plugin. This will enable QTP to identify java objects. This should also solve the java tree problem.

if you already have installed the java plug-in and asking for a method to test java tree objects, there is no single answer i can give. but you might have to apply your own logic through descriptive programming.

OR

Hi

Thanks for the answer

I have installed java plugin object and have tried to give a call to the java object tree

I just want to expand the Tree node

please can you send a small sample code which tests the Window explorer

regards

Prashant

Q. Please provide complete walk through for creating the Shared Object repository in QTP

Ans: One can create a shared Object repository path in two ways either manually or programmatically

1.  Test->Settings->Resources->Object Repository Type->Shared    and can specify the required path there

2.  Dim App 'As Application    Set App = CreateObject("QuickTest.Application")   'creating an object  for QTP    App.Test.Settings.Resources.ObjectRepositoryPath = "Specify the or path here"

.......satish

Q. What are checkpoints in QTP and its importance. (Repeat)

Ans: A checkpoint verifies that expected information is displayed in an Application while the test is running.

 

You can add eight types of checkpoints to your test for standard web objects using QTP.

a).A page checkpoint checks the characteristics of an Application.

Page 33: QTP Faq's

b).A text checkpoint checks that a text string is displayed in the appropriate place on an Application.

c).An object checkpoint (Standard) checks the values of an object on an Application.

d).An image checkpoint checks the values of an image on an Application.

e).A table checkpoint checks information within a table on a Application.

f).An Accessibility checkpoint checks the web page for Section 508 compliance.

g).An XML checkpoint checks the contents of individual XML data files or XML documents that are part of your Web application.

h). A database checkpoint checks the contents of databases accessed by your web site

OR

hi

in qtp 8.2 we have 8 checkpoints which works as 11 checkpoints

1.standard checkpoint: it will useful to check the object properties as well as works as

         a.pagecheckpoint b.imagecheckpoint c.table checkpoint

2.textcheckpoint: it will useful tocheck text on application(web & windows applications)

3.textareacheckpoint: it will useful to check text area on applibcation(windows applications)

4.databasecheckpoint: it will useful to check the database

5.bitmap checkpoint:to check the bitmaps

6.accessibility checkpoint: for web applications only, is the web application follows www consortium rules of section 508 or not,

7.xmlcheckpoint: for xml pages and frames................i don't know clearly

8.xmlcheckpoint(File): to check the xml files-------i don't know clearly

bhadra

Q. what are the adwanteges in qtp then winrunner

Ans: 1)Difference  in winrunner there is no command to comment the block where is in qtp9.0 command is clt+m

2) In winrunner there is no xml operations to test,where as in qtp we can .

Page 34: QTP Faq's

OR

Hi Everybody,

In Qtp more features are available compared to winrunner they are.

more checkpoints in qtp

Active Screen Future is there by that while preparing script that perticular line shows proper Screen shot in Active Screen by that ,it will be is understand for updating scripts.

internal data tables are there its very usefull

it support people soft,siebel,.net,complex je22 and more

results also it shows in tree view ,by that it is easy understandable.

Q. What are the latest versions of Winrunner, TD, LR and QTP?

Ans: Winrunner  8.6

Loarunner 8.0

Test Director 8.5(not sure)

QTP 9.0

OR

For TD the latest version is Test Director 8.0 (Quality Center)

Q. what do you mean by develope and enhanced script in qtp?

Ans: after running or navigating an application vb script is recorded.that is actual process or propetries of the application.but we want to run our expected scripts.so we enhence the scripts.if previous release of application has been changed,then the script required to run that application also changes,the script is developed for changing

OR

Hi this is kalpesh prajapati

Thank you very much manas, i would really appreciate if you give me this answer with real example.

Thank you very much again.

OR

Devolpement means performing the transaction on application

enhaced means inserting the cheekpoints or writeing conduction statements in the script and run the script and enhace the results with actual and expected

Page 35: QTP Faq's

OR

in qtp developing a basic script means first of all we r writing code or test script that which performs basic operations apart from testing functionality like issues. then we enhance it by inserting checkpoints or using conditional statements/loops/methods/synchronization points/parametrization etc

as most of the companies r following scripting or descriptive programing techniques none is using the concept of chekpoints we can use methods and condintional statements/loops to test the aut

OR

1. Inserting the Checkpoints

2. Giving with loop constraints

3. Calling the external files like VBs file

4. Inserting Pass or Fail statement

5. Using the Data Table or Flat files for the passing the runtime values

Q. what function do we use to call function directly?

Ans: You can use "Call" function to call any function with the script or from .VBS and .txt files.

Like

Call ABC(Parameters)

ABC = Function name

Q. what is a active x control in QTP

Ans: QTP Provides an option to include Add-Ins/Controls according to our application.SO if the application contains any Activex objects QTP identifies those using this ActiveX control.

Q. what is a file system object in QTP

Ans: Vbscript does not recognises or read the flat files like notepads etc. We create  an object which is called 'file system object' which contains flat files. From that file system object we can retrieve values and can apply on test.

OR

file system object is a qtp predefined object that which can allow user to access to external files and allows to perform different oprations like reading data from files, writing/appending data to file, opening/creating/removing a file etc by using different methods of file system object.

Q. what is a Input parameter, output parameter in QTP?

Page 36: QTP Faq's

Ans: Input parameter can be used with functions and procedures that which can be used to pass the input values from the calling test to perform the function/procedure's action

output parameter can be used with functions to return the value to main/calling test

Q. what is descriptive programming in qtp?(Repeat)

Ans: It refers to creating a script from business requirement .

OR

Descriptive programming is a technique by which we can perform actions on objects which are not in the object repository.

The below example uses descriptive programming to login to an application by providing the user id and pwd

There are two ways in which descriptive programming can be used :

* By creating properties collection object

Dim uid,pwdDim objPropBrowser,objPropPageDim objPropImageLogin,objPropWebEditUsrName,objPropWebEditPwd

uid="abc"

pwd="123"

Set objPropBrowser  = Description.CreateSet objPropPage  = Description.CreateSet objPropImageLogin = Description.CreateSet objPropWebEditUsrName  = Description.CreateSet objPropWebEditPwd  = Description.Create

objPropBrowser("name").value="Login"objPropBrowser("title").value="Login"

'objPropPage("name").value="root"objPropPage("url").value="url link"objPropPage("title").value="Login"

objPropWebEditUsrName("name").value="username"objPropWebEditUsrName("type").value="text"

objPropWebEditPwd("name").value="password"objPropWebEditPwd("type").value="password"

objPropImageLogin("name").value="Image"objPropImageLogin("image type").value="Image Link"objPropImageLogin("alt").value="Login"objPropImageLogin("abs_x").value="510"objPropImageLogin("abs_y").value="334"objPropImageLogin("x").value="510"objPropImageLogin("y").value="241"

Page 37: QTP Faq's

Browser(objPropBrowser).Page(objPropPage).WebEdit(objPropWebEditUsrName).ClickBrowser(objPropBrowser).Page(objPropPage).WebEdit(objPropWebEditUsrName). Set uidBrowser(objPropBrowser).Page(objPropPage).WebEdit(objPropWebEditPwd). Set pwd

'Browser(objPropBrowser).Page(objPropPage).WebEdit(objPropWebEditUsrName). Set "ujwal"'Browser(objPropBrowser).Page(objPropPage).WebEdit(objPropWebEditPwd). Set "password"

Browser(objPropBrowser).Page(objPropPage).Image(objPropImageLogin).Click

* By giving description in the from of string arguments.

Dim uid,pwd

uid="abc"

pwd="123"

Browser("title:=Login","name:=Login").Page("title:=Login").WebEdit("name:=username","type:=text").Set uidBrowser("title:=Login","name:=Login").Page("title:=Login").WebEdit("name:=password","type:=password").Set pwdBrowser("title:=Login","name:=Login").Image("name:=Image","file name:=b-login.gif").Click

Q. What is Object Repositiry?What is the use of it in recording?

Ans: hi samuel,

   Object repository in qtp is like a storage place or a central repsitory where it stores the properties of all the objects when u reocrd the script,and later when u execute the script qtp checks that the objects in the application match the objects in the object repository and executes it, if both the objects matches the test will pass, if it cannot identify the object or there is a mismatch the script will fail.

Object repository is same like a GUI map in winrunner where u have to make the tool capture the properties of object where as in QTP object repository automatically does that for u.

If i am wrong or some enhancement is needed correct me,

thanks,

aparna.

Q. what is object spy and object identification?

Ans: Object Spy:If you need to know the Properties of Field or an object(Edit Box) in your application you may click on Object Spy and select the object for which the properties are to be known...We generally use Object Spy in order to compare the properties of an object in the application with respect to the Test script.

Object Identification:Object identification is a section where you customise all your properties by which QTP checks for the Mandatory and Assistive Properties of an object.

Pls let me know if you need more help.........

Page 38: QTP Faq's

Q. What is QTP environmental variable?

Ans: Environment variable is a variable with their corresponding value. Quick Test can insert a value from list of environment variable list. Throughout the test run, the value of an environment variable remains the same, regardless of the number of iterations, unless you change the value of the variable programmatically in your script.

There are three types of environment variables:

User-Defined Internal—variables that you define within the test. These variables are saved with the test and are accessible only within the test in which they were defined.

User-Defined External—variables that you predefine in the active external environment variables file. You can create as many files as you want and select an appropriate file for each test, or change files for each test run.

Built-in—variables that represent information about the test and the computer on which the test is run, such as Test path and Operating system. These variables are accessible from all tests and components, and are designated as read-only.

Q. what is step generator?

Ans: Hi

Step Generator is used to insert a statement(function ro method) of a particular object which is available in the Object Repository

Q. what is sync point in QTP? and how to insert sync point in QTP can anybody tell me step by step

Ans: hi

   you mean sychronization point it means waiting property till  page is loaded. 

Q. What is the meaning of Context sensitive?

Ans: hi,

Context sensitive recording means we can perform the events on standard GUI objects.

Q. What is the use of Output Values in QTP

Ans: Out values are created inorder to run the script without any fail for the dynamically changing values.

for example if u take the flight application when you parameterize the test with different sets of data in the data table, the price changes for each trip so in order to identify the price change and to run the script accordingly we create output values.

After running the script u can see the output values(price)for different destinations in the run time data table.

thanks,

aparna. (466 Questions r over)

Page 39: QTP Faq's

Q. can anyone tell me wats the advantage of using a third party Tool like QTP for testing the SAP application?Is the inbuilt tool of SAP VIz eCATT does all the testing that are done through QTP? Tell me the Advantage of using QTP in SAP applications?

Ans: If SAP is the only technology for the business and which database using by u(if more than one database using) then QTP will supports all the databases.

QTP is having more felixibility to write a script for any technology by using the add-ins.

ie we can write the scripts for sap or any web based application and it is more user friendly.

So we can fine more man power and highly skilled resource will be available.

Q. Hello,

I'm using QTP 8.2. and I want to test an Application which is designed with Oracle Forms 10 g.Before installing the Oracle Addin for QTP 8.2. I was able to open the Application with QTP and IExplorer 6.0.After Installing the Oracle Addin for QTP 8.2. I wasn't able to open the Application neither with QTP nor ÍExplorer.I only installed the Addin. I haven't installed any upgrade or patch!

The following failure is shown in the JAVA Console after starting the application:

java.lang.VerifyError: (class: oracle/forms/net/MessageQueue, method: getAt signature: (I)Ljava/lang/Object;) Inconsistent stack height 0 != 1

at oracle.forms.net.HTTPConnection.(Unknown Source)

at oracle.forms.engine.FormsDispatcher.initConnection(Unknown Source)

at oracle.forms.engine.FormsDispatcher.init(Unknown Source)

at oracle.forms.engine.Runform.initConnection(Unknown Source)

at oracle.forms.engine.Runform.startRunform(Unknown Source)

at oracle.forms.engine.Main.createRunform(Unknown Source)

at oracle.forms.engine.Main.start(Unknown Source)

at sun.applet.AppletPanel.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

It would be more than nice if someone could help me with this problem

Ans: This problem occurs due to a conflict between java and oracle enabled support

1. Open the registrykey: HKEY_LOCAL_MACHINESoftwareMercury InteractiveJavaAgent

2. In the JavaAgent key change the value of Support Enabled from 1 to 0

Page 40: QTP Faq's

This should solve your problem.

OR

Hello,

The other solution won't work, this one does. I experienced some problems with my existing scripts(recorded with the 6.5 Oracle add-in) because some objects aren’t recognized properly anymore. I adjusted the scripts and now it works well. Solution:

1. Open the registrykey: HKEY_LOCAL_MACHINESOFTWAREMercury InteractiveJavaAgentOracle Add-in for QuickTest

2. In the ‘Oracle Add-in for QuickTest’ key change the value of  ‘Enabled’ from 1 to 0

This should solve your problem.

OR

The only problem with this fix is if you are really wanting to use the Oracle Add-in with your application the suggested fix "disables" the Oracle Add-in.  In my case, I was receiving the same error but when I disabled the Oracle Add-in I could not record in QTP using that specific application.  To fix the problem, I went out on the Mercury Website to their Knowledge Base and found a "Patch" which adds support for Oracle Forms 10g/9i (also known as Oracle Forms 9.x) to the QTP Oracle Add-in 8.2.  It is Patch # QTPORACLE82P6102, but you have to request that they send it to you.  Maybe this will help.

OR

Hi Frns,Thanks to all.Even I got the same problem.After installing java and oracle add-ins my application could not open.My application is built with oracle 10g forms and java.After modifying the value for Enabled from 1 to 0. then Could work on applicaiton. and qtp 8.2 is able to recognize.

Thanks for forum.Niruv

Q. Hi All,

my Object name is "Login".

my code is:

browser("B1").page("P1").WebEdit("Login").Set "Admin"

CAN I USE IT LIKE THIS?

Page 41: QTP Faq's

myObj = "Login"browser("B1").page("P1").WenEdit (myObj).Set "Admin"

It is not working. How to do in this situation?

Ans: Hi

I don't find any problem with your script. I tried to run the same sort of script in my system I didn’t find any errors.

login =  "username"Browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours").WebEdit(login).Set "xyz"

Thanks

Nag

OR

Hi

There is nothing wrong with your script,but I found a small syntax error.

myObj = "Login"browser("B1").page("P1").WenEdit (myObj).Set "Admin"

It has to be WinEdit insted of WenEdit.

Nag

OR

There are 2 problems with your script

1) rather than just specifying myObj = "Login" it is more robust if ur code would have been like this

myobj= "name:= Login"

this is called descriptive programming . here we are telling the QTP to find an Webedit box which has the Name property value which is equal to Logine. if you start programming in this way . u dont even need an entry in the OR.

try deleting this entry in OR and run the scipt.

this wil make your overall script light and easier to load however execution time is slightly increased.

2) the second flaw i think was a typo in your code the web edit box is speeled as wenedit.

Page 42: QTP Faq's

Keep smiling

OR

It can also be done by renaming the object name in ur OR. By renaming the object name in the OR would be more convinient as it would be reflected in all ur scripts ,wherever the object has been used, at its own.

OR

Hi,

You try this one

myObj("name").value="Login"

browser("B1").page("P1").WenEdit (myObj).Set "Admin"

                 OR

You try this one also

myObj("text").value="Login"

browser("B1").page("P1").WenEdit (myObj).Set "Admin"

 Note: Check out the property of that object in Object Repository and according to set that value , then it's work definately. Check in OR and afterwards delete that OR. Ok Bye

If you have any query mail me

Q. Hi I am new to load testing .Currently i am using Load runner 8.2.i have recorded a script for login screen with some UID/PWD.In load runner Controller i have selected 100 Vusers,and i the run script.

My question is :1.)Is the same script runs 100 times for same UID/PWD what i have entered during Recording.2.)If my data base contains only 50 users.Selecting 100 Vusers is a valid case?.3.)If i have selected 100 Vusers,is it necessary to enter 100 UID/PWD.Regards,vivek(Loadrunner)

Ans: 1.Use For loop for executing same script for 100 times.2.It is not valid case.3. Not necessary.

OR

Hi Vivek,

1.)Is the same script runs 100 times for same UID/PWD what i have entered during Recording

Ans - Yes the same script is running.

Page 43: QTP Faq's

2.)If my data base contains only 50 users.Selecting 100 Vusers is a valid case?.

Ans - Yes it is a valid case because it id not going to your DB to fetch records as it is only generating the load.

If you want to login as 100 different users then you have to paramterize the script and then pass 100 users in an excel.

3.)If i have selected 100 Vusers,is it necessary to enter 100 UID/PWD.Ans - No it is not necessary.

Vivek it is a better practice that for any specific role(User Type) you may put the data in an XLS and then call that XLS in the program. This will imitate a real life condition.

OR

1) it depends on your script settings. As best practice, you may want to have unique type selected for your parameterization.

2) Again, this depends on your requirement. If you have 50 users in DB, you can use the script in cyclic manner.

3) This is related to 1. if you have selected unique, yes.

OR

Question is :1) Is the same script runs 100 times for same UID/PWD What I have entered during Recording.Script doesn't run 100 times, 100 Vusers run the same script Concurrently .

2) If my data base contains only 50 users. Selecting 100 Vusers is a valid case?If your controller supports 100 vusers you can run with 100 vusers. Database doesn't play any role here.

3) If i have selected 100 Vusers, is it necessary to enter 100 UID/PWD.Not required, that the work of the load runner to look after

Regards,Shaik

Q. how can we terminate the application when we encounter a problem or defect in our application while we running the application in Load Runner,Win Runner and QTP.

Ans: there are many ways of handling this.IN QTP we write the following snippet

what is your target application?

is it a web application or client server application

for a web application

1) if you want to close the web application on any defect , write a code snippet some thing like this

Page 44: QTP Faq's

browser("B1").close in side the else condition (if you are using an if else condition)

2) if you want to exit the testing Tool for any further

use Exit global iteration in the sniipet.

OR

Press cntrl+F3

or for wrun we can kill the process by press the task mgr, click on th process, select the process wrun.exe and terminate it.

OR

If we know the error type we use Recovery Scenario to close the apllication.

Q. I have 10 Edit Boxes in my application. i Named them as Text1, Text2, Text3...Text10. Now i want to set values in these Text Boxes using Loop Statement. Can i Use

for i=0 to 10browser("b1").page("p1").WebEdit("Text" & i).set "value" &inext

**********

Is it acceptable WebEdit("Text"&i) ? I am getting error here.Any suggestions?

Ans: Hi

It is 100% acceptable.

Here is the sample script which runs perfect.

For i=1 to 2

Browser("Welcome: Mercury Tours").Page("Book a Flight: Mercury").WebEdit("text" & i).Set "name" & i

Next

OR

use descriptive programming in this situation in following way.

Assuming text is the name property by which QTP is identifying the webedit box:

box="name:=Text" & i

for i=0 to 10browser("b1").page("p1").WebEdit(box).set "value" &inext

OR

Page 45: QTP Faq's

Hi,

The idea is correct but implementation is wrong.

for i=0 to 10

*///browser("b1").page("p1").WebEdit("Text" & i).set "value" &i///*

Statment is not write.

You should use descriptive programming like this

browser("b1").page("p1").WebEdit(name:="Text" & i).set

Supposing name is property 

next

OR

Hi

If you want to use descriptive programming then inyour case "Test1", "Text2".... are of "name" property. The other unique property can be "index"

For i=0 to 9

Browser("b1").Page("p1").WebEdit(name:="Text1","index:=" & i).Set Value

OR

Dim a, i

Window("Program Manager").WinListView(SysListView32).Activate"text htmt"

for i = 1 to 10 step 1

a = inputbox ("Enter the Text")

Browser("BrowserName").Page("PageName").WebEdit("name:=text" &i).Set a

Next

Q. In Quick Test Pro 8.2

1. While Recording/writing the Script i want to know the " Selecting Tab Position Action Script".Eg: Window contains 4 tab positions i would like to select 2 tab position at that time how script will come. plz write the script and send me.

2. How can i generate and select Tree View in Programatically.

Eg: Mycomputer Contains all drives information like as below.+My Computerwhen i press + Symbol My Computer will Expand that format like-- My ComputerDrive C

Page 46: QTP Faq's

Drive DAt That scenario i will perform these actiona. Expand My Computer View by selecting + Iconb. After expanding i will select Drive DWhile doing above conditions how script will generate plz let you find ASAP and mail me back. Don't forget.

Ans: 1. Ans: first learn(i.e store objects in Object Repository)  the window and Tabs screen

ex: SwfWindow(WindowName).SwfTab(Tabname).select "Tab2"

2. Ans: QTP not recognizing the Tree View but by writing .vbs function we can expand the Tree View

Regards,

Venkateshwar Reddy

OR

2) If you try to record the treeview in web application  QTP will record the nodes you have selected as -

e.g ApptixDemoASP >> Customer >> user

Browser("AdminCentre").Page("AdminCentre").Frame("frmTreeView").WebElement("ApptixDemoASP").FireEvent "onmouseover"

Browser("AdminCentre").Page("AdminCentre").Frame("frmTreeView").WebElement("ApptixDemoASP").Click

Browser("AdminCentre").Page("AdminCentre").Frame("frmTreeView").WebElement("Customer").FireEvent "onmouseover"

Browser("AdminCentre").Page("AdminCentre").Frame("frmTreeView").WebElement("Customer").Click

Browser("AdminCentre").Page("AdminCentre").Frame("frmTreeView").WebElement("User").Click

For this you need to cusomize web event recording configuration as set mouse over event on and HTML tag event >> treeview as enabled.

Same way enable the HTML tag event >>Tabstrip and start recording will work and you will have auto generated script for tabs.

OR

Hi,

According to ur question my answer is like this..

In your application page 4 tabs are there...

for to select one tab we can write script ...

Page 47: QTP Faq's

In windowbased app.........

window("window name").wintab("tab name").select

In Oracle App...

OracleApplication("Oracle Applications").OracleFormWindow("form name").oracleTabbedRegion("tab name").select

In Java...

Javawindow("window name").JavaInternalFrame("Frame name").JavaTab("Tab name').select

Q. Is there any way to convert .tsr (Object Repository) File to an XML file?(Repeat)

Ans: To my knowledge there is no such tool that does it.

OR

There is a tool by name qantom try this site http://www.qantom.org/ .

Q. What is Smart Identification in QTP

Ans:

Hi,

Smart Identificaton is applicable for web application only. Record one object from application and modify the object property and execute your script. You will get one worning message in result. Navigate to working message in result file and read the note for smart identification.

Smart Identification is nothing but, if any property of test object is not matching with run time object property, it will write an worning to result and  execute rest of the steps.

Note: In the result Cap symbol will added for smart identification. (By looking in to this we can say that properties of test object is not matching with run-time object)

Regards,Ravi Konka

      

April 05, 2006 06:54:39 #2 schittoor   Member Since: Visitor    Total Comments: N/A 

 RE: What is Smart Identification in QTP

 Any property of test object is not matching with run time object property, it will write an worning to result and  execute rest of the steps.

Thanks

Chittoor.srinivasulu

Page 48: QTP Faq's

      

April 14, 2006 03:04:40 #3 manosh   Member Since: Visitor    Total Comments: N/A 

 RE: What is Smart Identification in QTP

 

Smart Identificaton is applicable for web application only. Record one object from application and modify the object property and execute your script. You will get one worning message in result. Navigate to working message in result file and read the note for smart identification.

      

May 18, 2006 05:36:30 #4 Madhu   Member Since: Visitor    Total Comments: N/A 

 RE: What is Smart Identification in QTP

 Generally object identification is used for to identify the GUI objects in the screen. When u recording the script automatically the object identifer records the objects in the screen (in winrunner we had GUI map configuration).

But, this smart identification will be idetified the objects. Whether this objects is developed with same technology or not.

Eg: Application is devloped in JAVA but in places we used some microsoft controls. Where generally the QTP will have to recongnise the componenets at that time smart identification will identify the objects.

      

July 17, 2006 09:50:39 #5 Shiba Shankar Tripathy   Member Since: Visitor    Total Comments: N/A 

 RE: What is Smart Identification in QTP

 Hi,

 Smart Identification is used by QTP, whenever it is unable to identify any object during run time. While identifying an object, QTP tries to match the mandatory properties first, if it couldn't find the object, then it adds assistive properties one by one to identify the object correctly. This operation is done by smart identifier and it is displayed in the results section along with one warning message. It's generally used to identify Web elements only.

Thanks

Shiba

Page 49: QTP Faq's

      

December 07, 2006 09:45:18 #6 Reddy   Member Since: Visitor    Total Comments: N/A 

 RE: What is Smart Identification in QTP

 

Hi Guys Smart Identification is a mechanism provided by QTP and used for identifying the objects smartly using Base filter properties or Optional filter properties when ever the normal identification fails due to the dynamic changes in the properties of objects. This will be seen only in Results window only not stored in the Object repository. I hope u r under stood the ans.

      

December 10, 2006 03:52:18 #7 g.sri latha   Member Since: Visitor    Total Comments: N/A 

 RE: What is Smart Identification in QTP

 

hi, smart identification is used for idenfying the objects during execution.first Q.T.P tries to identifies the objects using maniditory and one by one assistive properties.if it is fails then Q.T.P using the smart identification for identifying the test objects during execution with it's base filter and optional filter properties.but it is not storing in object repository it stores secretly and Whenever necessaary it will use by the Q.T.P.

      

January 19, 2007 02:00:27 #8 Brijendra tiwari   Member Since: Visitor    Total Comments: N/A 

 RE: What is Smart Identification in QTP

 

When QuickTest uses the recorded description to identify an object, itsearches for an object that matches every one of the property values in thedescription. In most cases, this description is the simplest way to identifythe object and unless the main properties of the object change, this methodwill work.

If QuickTest is unable to find any object that matches the recorded objectdescription, or if it finds more than one object that fits the description,then QuickTest ignores the recorded description, and uses the SmartIdentification mechanism to try to identify the

Page 50: QTP Faq's

object.

While the Smart Identification mechanism is more complex, it is moreflexible, and thus, if configured logically, a Smart Identification definitioncan probably help QuickTest identify an object, if it is present, even when therecorded description fails

      

April 16, 2007 01:40:28 #9 sridhar   Member Since: Visitor    Total Comments: N/A 

 RE: What is Smart Identification in QTP

 

At the time of web application recording some of the actions are not identified by the QTP because some filter effects are associated with that web page so it is not identified by the QTP, at that time we are using smart identification to record such effects

Q. What is the size of object repository

Ans: It depends on system memory

Q. what is the library function? How do you use it .. ?

Ans: It is the library of functions. There are 2 types of functions built-in & user defined functions. for e.g. Built-in functions - date, dateadd, instr, Cstr, etcUser defined functions - create a library of functions which you will be using for your automation purpose and save as an external file (*.vbs / *.qfl / *.txt). Map the file to your test through Test Setings.

Q. what is the extension for libraries files in QTP

Ans: Extension for librare files in QTP: .vbs

OR

Hi,In QTP 8.2 or earlier versions, the libraries files can be stored with extension .vbs or .txt.with QTP 9.0 or later, there are 3 supported file formats. .vbs, .txt and .qlf.

OR

Extension are like .VBS ,.Tsr---for PerACTION repository and for Shared Object Repository it .mtr(Mercury Test repository)

QTP   |   Question 419 of 449    |  Print  |  Send To Friend  What is the difference between analog recording and descriptive programming?

Page 51: QTP Faq's

Ans: The main difference between recording and descriptive programming is:

Recording is done only if the first build is released,and can be implemented on second build for regression testing.Descriptive programming can be useful to execute on the first build itself.

Q. What is Object File and Object Repository ?

Ans: In object repository QTP stores the information about the object. There are two types....1 shared Object Repository 2 per action Object Repository

Object file stores the information of objects.

Q. What is Debug Viewer and how it works in QTP?

Ans: The debug viewer pane consists of 3 tabs

watch:

Enables you to view the current value of any variable or VB script expression that you add to the watch tab

variable:

During a run session, the Variables tab displays the current value of all variables that have been recognized up to the last step performed in the run session.

command:The Command tab enables you to run a line of script to set or modify the current value of a variable or VBScript object in your function library. When you continue the run session, QuickTest uses the new value that was set in the command.

Q. What are the pros and cons of using Shared and Per Action repositories?

Ans: Per Action Repository is specific to only one QTP script.While Shared Repository can be used in which ever Script desired.

Just that whenever any modification is done in the Shared OR, it should again be saved otherwise it will not be effected when used later

Q.

QTP Questions

Total Answers and Comments: 8

1. Defination of Object repository

Page 52: QTP Faq's

2. Explain Output co-relation3. Explain Exceptional handling4. Explain Synchronization5. Explain Parameterisation6. Explain Smart identification7. Principles of the QTP8. What are the recording mode in QTP in details, and diffenece between Analog and Low level 9. What is Batch Runner 

  Sort by Date asc / desc                Show Page   [ 1 ]  

June 20, 2006 01:39:21 #1 mahesh   Member Since: Visitor    Total Comments: N/A 

 RE: QTP Questions

 hello

could u explain batch runner in qtp and when ur working java application

we r writing library files so in this which script is used bcz in .net it is saved as .vbs but in java .js so could u please explain

      

March 27, 2007 07:48:58 #2 vamsi   Member Since: Visitor    Total Comments: N/A 

 RE: QTP Questions

 

we can embed .vbs files using HTML in to .js files.so, your files are in the form html pages.

      

April 17, 2007 08:21:27 #3 dev1504   Member Since: Visitor    Total Comments: N/A 

 Defination of Object repository

Page 53: QTP Faq's

 Store the information of object. there are 2 types1 shared object repository2 per action object repositry

      

April 17, 2007 08:24:39 #4 dev1504   Member Since: Visitor    Total Comments: N/A 

 Explain Parameterisation

 Using Parameterisation when you want to look same functionality with different output.Devendra

      

April 17, 2007 08:28:03 #5 dev1504   Member Since: Visitor    Total Comments: N/A 

 What are the recording mode in QTP in details, and diffenece between Analog and Low level

 Use anolog recording when exact mouse coordinate is required & do low level recording when QTP does not recagnize the object

      

April 17, 2007 08:29:54 #6 dev1504   Member Since: Visitor    Total Comments: N/A 

 Principles of the QTP

 There are 2 principles of QTP1 Key driven2 Playback

      

Page 54: QTP Faq's

April 20, 2007 06:04:16 #7

 aashvarma Testing Expert  Member Since: April 2007    Total Comments: 3 

 RE: QTP Questions :exception handling?

 hai  this z aash     removing unwanted messages on screen while running the script.

      

April 20, 2007 06:09:47 #8 aashvarma Testing Expert  Member Since: April 2007    Total

Comments: 3 

 RE: QTP Questions:diff between analog n low level recording

 In analog we record mouse operations like digital signatures and in low level recording we record satelite, medical(e.c.g) operations.Q. problem while recording one object in QTP

Total Answers and Comments: 3

I am working on Java Based project, But while I am recording, QTP is not recognising the object even after adding that object in the OR.. Basically the runtime objects are changing. Can anybody suggest what to do/ how to use Regular Expression there

Thanks anr Regards

Gautam

Ans: Descriptive Programming. You must identify the object(s) that change dynamically by using some other property rather than name or value that change...

OR

hello  chanakya

Thanks a lot for responding to my question.. I had tried with that but not 100% successful. I will be grateful to You if u can explain it to me a bit in details.. My Email ID is [email protected]..

Actually When i am looking at the properties in OR with Object Spy, I am finding that the Test

Page 55: QTP Faq's

Object property and the runtime-object properties are totally different.

I will be thankful to u if u can help me.

Q.

QTP   |   Question 409 of 449    |  Print  |  Send To Friend  

parametrize the name field in QTP question

Total Answers and Comments: 1

I am a new learner in Qtp and Practising it .This is query I have a very basic doubt,

I recorded a script in mercury website tours. I wanted to parametrize the name field.when I did it with Global it worked . But every time it logged in and added the users from the data table . I wanted the script to login in Once and add the users.i tried it with the local sheet it did it work.

This is the script I recorded. QTP EXPERTS answer my query. This is the recording of the script.Browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours").WebEdit("userName").Set "sjsai70"Browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours").WebEdit("password").SetSecure "4619dd02052b5530abe5ef1ffb5c278b5d051064"Browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours").Image("Sign-In").Click 55,2Browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours").SyncWindow("Microsoft Outlook").ActivateBrowser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").Image("findFlights").Click 98,18Browser("Welcome: Mercury Tours").Page("Select a Flight: Mercury").Image("reserveFlights").Click 52,12Browser("Welcome: Mercury Tours").Page("Book a Flight: Mercury").WebEdit("passFirst0").Set "shailaaja"Browser("Welcome: Mercury Tours").Page("Book a Flight: Mercury").WebEdit("passLast0").Set "j"Browser("Welcome: Mercury Tours").Page("Book a Flight: Mercury").WebList("pass.0.meal").Select "Bland"Browser("Welcome: Mercury Tours").Page("Book a Flight: Mercury").WebList("pass.0.meal").Select "Vegetarian"Browser("Welcome: Mercury Tours").Page("Book a Flight: Mercury").Image("buyFlights").Click 70,7Browser("Welcome: Mercury Tours").Page("Flight Confirmation:

Page 56: QTP Faq's

Mercury").Image("backtoflights").Click

Ans:

Parameterize the name field in QTP in mainly 3 types

1. Datatable

2. Method Argument

3. Dynamic in Datatable

Step 1: First of all we will create parameter for name field like "UName" This parameter should be created in ActionSheet

Step 2: After that connect the parameter to the name field through the Keyword View

Step 3: After select the Keyword view we should select the Value column in Keyword view and press the icon of the value column right side.

Step 4: after that we got parameter box in that we will select Parameter option in that we select Data Table and select parameter in value list box and press ok button it automatically effect in the expert view in the name field line like

"Datatable("Uname","Action1").Browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours").WebEdit("userName").Set Datatable("Parametername","Action1")

Same as Password also

Browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours").WebEdit("password").SetSecure "4619dd02052b5530abe5ef1ffb5c278b5d051064"

Page 57: QTP Faq's

Q. Is there any options available to handle more than one DataTable Simultaneously in QTP

Ans:

Datatable is divided into two types.

1. Local data sheet(For each script u can create ur own data table)

2. Global datasheet(For the entire application u can use only one global datasheet.)

Q.

How to use QTP 8.2 Automation Scripts in Load Runner 8.1 for Load Testing Purpose.

Total Answers and Comments: 4

More details on Question: I was trying to call the QTP Scripts from Load Runner Controller Scenario. There, I only see options for Vuser Scripts, GUI Scripts, Astra Tests and All Files(*.*) options in drop down box. Do I need to install QTP on Load Runner Server also to see this option. So that i can all QTP Scripts. Or please explain the procedure for reusing automation scripts of QTP to Load testing purpose using Load Runner. 

  Sort by Date asc / desc                Show Page   [ 1 ]  

July 11, 2006 01:55:16 #1 divesh   Member Since: Visitor    Total Comments: N/A 

 RE: How to use QTP 8.2 Automation Scripts in Load Runn...

 Hi ,

I am facing the same issue how to use QTP 8.2 Automation Scripts in Load Runner 8.1 for Load Testing Purpose.

Did you have any solution for that if yes could you please forward to me it would really appreciable.

thanks

divesh

      

Page 58: QTP Faq's

October 31, 2006 09:40:24 #2 Deepali R. Salaskar   Member Since: Visitor    Total Comments: N/A 

 RE: How to use QTP 8.2 Automation Scripts in Load Runn...

 Hi

You can select "All Files" in Files of type combo box and select QTP script file with extension ".usr"

I hope this will help you

Thanks & Regards

Deepali R. Salaskar

      

December 15, 2006 14:44:49 #3 Satyajeet   Member Since: Visitor    Total Comments: N/A 

 RE: How to use QTP 8.2 Automation Scripts in Load Runn...

 

Do we need special lisence to run QTP scripts. I am currently getting error "you don't have proper license to run"

      

April 08, 2007 14:21:38 #4 arihan sinha   Member Since: Visitor    Total Comments: N/A 

 RE: How to use QTP 8.2 Automation Scripts in Load Runn...

 there is a spcial patch from mercury should be purchased for which the qtp 8.2 scripts will be compatible with load runner

Q.

QTP   |   Question 31 of 449    |  Print  |  Send To Friend  

Page 59: QTP Faq's

How to run only one action when more than one action exist in the Test.

Total Answers and Comments: 3 

  Sort by Date asc / desc                Show Page   [ 1 ]  

April 17, 2006 03:20:45 #1 Ravi Konka   Member Since: Visitor    Total Comments: N/A 

 RE: How to run only one action when more than one acti...

 To execute your script instead of Run use RunFromAction.

      

May 05, 2006 05:52:45 #2 Brahma Sagar Gunda Testing Expert  Member Since: May 2006    Total

Comments: 3 

 RE: How to run only one action when more than one acti...

 Select the action, which you wanna run from the Action list in the Action Tool bar and then select the first line of the script, right click and select RunfromStep command....... Some one posted like to execute the command RunFromAction but the command doesn't exist.

Thanks,

Brahma sagar

      

April 18, 2007 05:13:57 #3 debleena23   Member Since: April 2007    Total Comments: 8 

 RE: How to run only one action when more than one acti...

 Select the particular action and click on the position form where you want to run the script. Then Right Click and select "Run From Step".

Q.

Page 60: QTP Faq's

how to read text box value into local variable of VBScript?

Total Answers and Comments: 1 

  Sort by Date asc / desc                Show Page   [ 1 ]  

March 31, 2007 05:56:03 #1

 swanand_rk Testing Expert  Member Since: January 2007    Total Comments: 9 

 RE: how to read text box value into local variable of ...

 var = browser(browser).page(a1).webedit(b1).getroproperty("value")

Q.

how to increase the execution speed of QTP scripts?

Total Answers and Comments: 3 

  Sort by Date asc / desc                Show Page   [ 1 ]  

March 30, 2006 10:28:00 #1

 nagasenan Testing Expert  Member Since: March 2006    Total Comments: 4 

 RE: how to increase the execution speed of QTP scripts...

 Hi

Go to Tools>Options>Run>select Fast

Nag

      

January 04, 2007 07:38:02 #2

Page 61: QTP Faq's

 dvbrao1 Testing Expert  Member Since: December 2006    Total Comments: 17 

 RE: how to increase the execution speed of QTP scripts...

 hi

with using descriptive programming also u can do fast the execution.

bhadra

      

April 04, 2007 03:40:31 #3 msusmitha   Member Since: November 2006    Total Comments:

19 

 RE: how to increase the execution speed of QTP scripts...

 hi

reduce the lines of script. writing the good testcase means which is finding the correct error. without using the object repository ie discriptive programming. its the optimisation we call just decreasing the input and producing the quality.

bye

Q.

How to count the number of columns in the java table

Total Answers and Comments: 1 

  Sort by Date asc / desc                Show Page   [ 1 ]  

May 15, 2007 07:02:26 #1 Santosh Menon   Member Since: Visitor    Total Comments: N/A 

 RE: How to count the number of columns in the java tab...

 

Page 62: QTP Faq's

Use the function called GetROProperty ("cols")

So if you use x=JavaTable("Table Name").GetROProperty("cols")

x will be the number of columns in the Java table.

Santosh..

Q.

how to comment a block in QTP 8.2

Total Answers and Comments: 7 

  Sort by Date asc / desc                Show Page   [ 1 ]  

May 09, 2006 13:24:57 #1 sreedhar   Member Since: Visitor    Total Comments: N/A 

 RE: how to comment a block in QTP 8.2

 there is no way to comment a block in qtpso only the way to comment a block is putting a single apostrophe in front of each line of the block

      

May 10, 2006 02:36:16 #2 Prasanth   Member Since: Visitor    Total Comments: N/A 

 RE: how to comment a block in QTP 8.2

 Thanks for the comment. Can you get me link, where i can get more questions on QTP

      

June 07, 2006 01:18:03 #3 srinivas potnuru   Member Since: Visitor    Total Comments: N/A 

 RE: how to comment a block in QTP 8.2

Page 63: QTP Faq's

 There is some other way round to comment a block of statements

for example u want to block the following code:

Browser("dfdf").Page("sdf").WebEdit("dfd").set "ssdsds"

Browser("dfdf").Page("sdf").WebList("sdsd").select 2

Browser("dfdf").Page("sdf").WebEdit("ddfdffd").set "sddfdffsdsds"

Solution : 

Keep the entire code in a function declaration as below

Function FunctioName()

Browser("dfdf").Page("sdf").WebEdit("dfd").set "ssdsds"

Browser("dfdf").Page("sdf").WebList("sdsd").select 2

Browser("dfdf").Page("sdf").WebEdit("ddfdffd").set "sddfdffsdsds"

End Function

This is an indirect way of commenting a block of statements.

      

June 22, 2006 01:14:30 #4 maniz   Member Since: Visitor    Total Comments: N/A 

 RE: how to comment a block in QTP 8.2

 Regarding your issue following are the things you can try:

1. ‘ for commenting out a statement

2. REM for adding comment at the end of code

3. Use the following example to comment out a code block

To comment out a block of code use an If-Then structure, where the expression is 0 or False.

Example:

If False Then

Page 64: QTP Faq's

Window("Notepad").WinEditor("Edit").SetCaretPos 0,0

Window("Notepad").WinEditor("Edit").Type "Hello This is a test."

Window("Notepad").WinEditor("Edit").Type micReturn

End If

Note:

QuickTest Professional will still read the lines within the if structure, but it will not execute them. Therefore, any syntax errors in the block will be reported during run time.

Let me know if it works for you.

      

March 29, 2007 02:27:52 #5 Rashmi Ranjan Parida   Member Since: Visitor    Total Comments: N/A 

 RE: how to comment a block in QTP 8.2

 Please follow the following steps to comment a block of code in QTP

1. Select the block of code2. Right click on it and select comment Block

Now it will comment the block of code with single comment line but at a time.

If any query, pls get back to me.

      

March 30, 2007 02:43:09 #6 joydeep_b77   Member Since: March 2007    Total Comments: 1 

 RE: how to comment a block in QTP 8.2

 The way that u have given is for QTP 9.1. It doesnot work for QTP 8.2

      

Page 65: QTP Faq's

May 18, 2007 14:58:49 #7 anurag   Member Since: Visitor    Total Comments: N/A 

 RE: how to comment a block in QTP 8.2

 

In QTP 9.2 you can comment block of statements by selecting the statements and right click and comment it.

Q.

How to automate Java Application? I got error object not found - JavaTree (EXTree)

Total Answers and Comments: 3 

  Sort by Date asc / desc                Show Page   [ 1 ]  

April 04, 2006 01:43:07 #1 rupesh   Member Since: Visitor    Total Comments: N/A 

 RE: How to automate Java Application? I got error obje...

 ensure that the java plug in added

      

April 04, 2006 04:28:24 #2 pavanraj Testing Expert  Member Since: March 2006    Total

Comments: 5 

 RE: How to automate Java Application? I got error obje...

 Hi,

    Before u start automation on Java application make sure that u installed Java Add-in for any testing tool ( say QTP,Winrunner ). And set some properties for particular object before u automate...finally go for recording or any other method of scripting ( say descriptive ).

 There is one more possibility that If u don't add properties of an object in repository( in QTP ) or GUI map file( in Winrunner ) then also it wil show error saying that object not found... So in this case make sure that ur object properties are there in repository/GUI map

Page 66: QTP Faq's

file.

Regards

Pavan

      

April 20, 2007 05:13:51 #3

 aashvarma Testing Expert  Member Since: April 2007    Total Comments: 3 

 RE: How to automate Java Application? I got error obje...

 hai,u r automate a java application u need to addin manager.this indicates which technology we r using marked on that.

Q. how many data tables are there?

Ans: there is only one datatable in QTP  i.e  EXCEL SHEET, in that we have  1.Local sheet                            2.Global sheet

Q. How does QTP Intentfies if page has 10 buttons with same name & value

Ans:

 RE: How does QTP Intentfies if page has 10 buttons wit...

 For this question I will just suggest an example.  Let us think there are 10 buttons in a page.  Then all these buttons will have some similar properties and every button will have atleast one unique property.  If u r aware how qtp idetifies the objects then u must have known about how it learns the properties of the objects by using mandatory properties, assistive properties, and/or by using smart brain.  As per my knowldege every object in a page will the windowid in unique and by selecting the windowid property in the assistive properties or in the smart brain will help in identifing the objectings.  Even one can use this property in the mandatory properties list or smart brain. 

      

Page 67: QTP Faq's

February 28, 2007 00:59:24 #2 prashanth   Member Since: Visitor    Total Comments: N/A 

 RE: How does QTP Intentfies if page has 10 buttons wit...

 

Fine, Let there be ten or hundread buttons their will be many unique properties to identify a button uniquely. For example, the button will not be at same x and y coordinates so with the help of x and y coordinates QTP can identify them uniquely

      

March 05, 2007 19:55:55 #3 TheScientist   Member Since: Visitor    Total Comments: N/A 

 RE: How does QTP Intentfies if page has 10 buttons wit...

 If all the properties are the same (even assistive) then QTP uses ordinal identifier such as index of the object in the page.

      

March 06, 2007 04:38:28 #4 gardekp   Member Since: February 2007    Total Comments: 1 

 RE: How does QTP Intentfies if page has 10 buttons wit...

 if u change ur monitor from 15" to 17" then x y coordinates will change. so how will u run the same test case there? or u have to change ur code. so there must be some other way than x y coordiantes.

      

March 13, 2007 04:25:06 #5 saurabh   Member Since: Visitor    Total Comments: N/A 

 RE: How does QTP Intentfies if page has 10 buttons wit...

 

Page 68: QTP Faq's

When there are same objects with ame name than qtp identifies it with the help of smart identification.it uses either index or location property value to identify objects.

      

March 27, 2007 07:11:42 #6 aravind   Member Since: Visitor    Total Comments: N/A 

 RE: How does QTP Intentfies if page has 10 buttons wit...

 If all the properties are the same (even assistive) then QTP uses ordinal identifier such as index of the object in the page.

first go through assistive properties , then towards ordinal identifier

Q. How do you schedule a test in QTP or QC [Quality center]

Ans: We can schedule test execution in Quality Center only. To do this first you need to go test Lab module there you will find "Execution Flow" tab. In that tab you can specify a date and time to schedule your test.

I hope we cann't schedule a test run in QTP. Anybody plz correct If I am wrong.

-Mulls

Q. How do you retrieve substring from another string in QTP

Ans: use "Instr" function

Q. How do you insert data to Excel file form a table

Ans: By using import functionRight click on the data table and click on the import from file

Q. How can you use parametrization using Descriptive programming?

Ans: Hi,    This is Ijaz.

I am sending sample code how to use parameterization using Descriptive Programming.

SystemUtil.Run "D:Program FilesMercury InteractiveQuickTest Professionalsamplesflightappflight4a.exe"

Dialog("text:=Login").WinEdit("attached text:=Agent.*").Set DataTable("ID",dtGlobalSheet)

Dialog("text:=Login").WinEdit("attached text:=Pass.*").Set "mercury"

Dialog("text:=Login").WinButton("text:=OK").Click

Page 69: QTP Faq's

Window("text:=Flight.*").Close

It's Working Fine. Reply if not working. my ID is [email protected]

Q. Desktop Application developed in Java problem

Hi

I am New to Qtp tool. My project is an Desktop Application developed in Java.

How to pick the data from the drop down list box. At the record time it captures the data from the combo box but while running the script QTP is unable to open/recognise the Drop down combo box to select the data.

Is there any code for that?Can any one solve my problem plz. I am really running out of time.

Thanks,Livetek

Ans: Ok...When you recorded, your script might be calling the object..i(n this case..the dropdown list item) by its name.

Go to the object repository and fidn that object and look at its properties on the right side. The first two properties could be the primary...and the name might not be the primary property. Try using a differant property.Or Try descriptive programming. Learn about descriptive programming and learn a lot about object repository...thats ur only hope and hurry up..do it ASAP..if u dont understand the object repository....u cant do nothin with QTP

lemme know if u need more help

OR

Hi,This is praveen  Yarlagadda,  could you please try to use this syntax.

parent window("login").child window("combobox").gettext()

OR

if all the above not working then we have to add java addin in QTP

Q. C++ project Testing in QTP problem

Hi, We have got a project to be automated using QTP. The application however has been designed using C/ C++ as told by the client.The problem with the QTP (free version downloaded from the net) is that it doesn't identify the objects at all other than the window object.When record playback is done all the actions are in terms of x - y co-ordinates and click methods of QTP.Is there a separate add-in for learning the objects in this scenario?Also if there is no need for the additional add-ins can you please let me know some feature of QTP which will help me in identifying the objects?

This is needed on an urgent basis as the client has already given us the project to start!!!!

Page 70: QTP Faq's

Thanks in advance,Raghu

Ans: Hi Raghu,

You don't need any addins for C++ applications .If you try writing your own code ex.Window("").Dialog("").etc  by capturing objects into repository or use descriptive programming it will work. As I'm also working on a c++ application I have this problemwhen recording, but when I write my code its working fine.Let me know if you need any more help.

Regards,Chaitanya

Q. How do I connect to database (Access in my case) from QTP?

Ans: yes u can connect through DSN.( create DSN from control panel).And create bd copnnective object like, set dbconnect= createobject("ADODB>connection"). and checkdbcfonnection.open is true or not.

Q.

How do you write Log Files in QTP

Total Answers and Comments: 5 

  Sort by Date asc / desc                Show Page   [ 1 ]  

April 26, 2006 03:00:08 #1 dhivya   Member Since: Visitor    Total Comments: N/A 

 RE: How do you write Log Files in QTP

 1.Write a program using filesystem objects in qtp.

2.Make this set of statements as function and give it a name eg."LogFile".

3.Capture the output values and other information from the application during runtime.

4.send these values to this function during runtime.

5.In functions write as ...

      a. Store all values in a variable

      b. create sepreate .txt file

Page 71: QTP Faq's

      c. pass these values to this file in function

Note: You can also write this function externally and it should be saved as .vbs,  and add this function in "Test-->settings-->Resource" and call this function by its name in Qtp .

      

May 09, 2006 06:21:37 #2 iliaz   Member Since: Visitor    Total Comments: N/A 

 RE: How do you write Log Files in QTP

 

Plz.......Could anyone send me the script for this Question. "How do you write Log Files in QTP?"

      

May 09, 2006 11:53:19 #3 Ramakrishna Rao   Member Since: Visitor    Total Comments: N/A 

 RE: How do you write Log Files in QTP

 Can you provide one sample script for this?

      

May 11, 2006 02:41:11 #4 Ritu   Member Since: Visitor    Total Comments: N/A 

 QTP advanced topics help

 i am getting an assigment on QTP,

i have to prepare on my own,

i am familiar with the basic functionality now i want to learn advanced topics

please provide me to get right material

Ritu

Page 72: QTP Faq's

      

June 03, 2007 06:45:55 #5 venkat   Member Since: Visitor    Total Comments: N/A 

 RE: How do you write Log Files in QTP

 

Log file is used for debugging.function writelog(strlog)dim objFSOdim objFileset objFSO=createobject("scripting.FileSystemObject")set objfile=objfso.opentextfile("path")objfile.writeline strlogobjfile.closeset objfile=nothingset objFSO=nothingEnd function

       hi log files used to show the results to the client ,client can believe by seeing the results produced after execution of the scripts in log files ,at the end of the path we should give the symbols like 1-read                                                                                        2- write                                                                                        8-append

Q.

How to automate Java Application? I got error object not found - JavaTree (EXTree)

Total Answers and Comments: 3 

  Sort by Date asc / desc                Show Page   [ 1 ]  

April 04, 2006 01:43:07 #1 rupesh   Member Since: Visitor    Total Comments: N/A 

 RE: How to automate Java Application? I got error obje...

 ensure that the java plug in added

      

Page 73: QTP Faq's

April 04, 2006 04:28:24 #2 pavanraj Testing Expert  Member Since: March 2006    Total

Comments: 5 

 RE: How to automate Java Application? I got error obje...

 Hi,

    Before u start automation on Java application make sure that u installed Java Add-in for any testing tool ( say QTP,Winrunner ). And set some properties for particular object before u automate...finally go for recording or any other method of scripting ( say descriptive ).

 There is one more possibility that If u don't add properties of an object in repository( in QTP ) or GUI map file( in Winrunner ) then also it wil show error saying that object not found... So in this case make sure that ur object properties are there in repository/GUI map file.

Regards

Pavan

      

April 20, 2007 05:13:51 #3

 aashvarma Testing Expert  Member Since: April 2007    Total Comments: 3 

 RE: How to automate Java Application? I got error obje...

 hai,u r automate a java application u need to addin manager.this indicates which technology we r using marked on that.

Q.

how to comment a block in QTP 8.2(Repeat)

Total Answers and Comments: 7 

  Sort by Date asc / desc                Show Page   [ 1 ]  

May 09, 2006 13:24:57 #1

Page 74: QTP Faq's

 sreedhar   Member Since: Visitor    Total Comments: N/A 

 RE: how to comment a block in QTP 8.2

 there is no way to comment a block in qtpso only the way to comment a block is putting a single apostrophe in front of each line of the block

      

May 10, 2006 02:36:16 #2 Prasanth   Member Since: Visitor    Total Comments: N/A 

 RE: how to comment a block in QTP 8.2

 Thanks for the comment. Can you get me link, where i can get more questions on QTP

      

June 07, 2006 01:18:03 #3 srinivas potnuru   Member Since: Visitor    Total Comments: N/A 

 RE: how to comment a block in QTP 8.2

 There is some other way round to comment a block of statements

for example u want to block the following code:

Browser("dfdf").Page("sdf").WebEdit("dfd").set "ssdsds"

Browser("dfdf").Page("sdf").WebList("sdsd").select 2

Browser("dfdf").Page("sdf").WebEdit("ddfdffd").set "sddfdffsdsds"

Solution : 

Keep the entire code in a function declaration as below

Function FunctioName()

Browser("dfdf").Page("sdf").WebEdit("dfd").set "ssdsds"

Browser("dfdf").Page("sdf").WebList("sdsd").select 2

Page 75: QTP Faq's

Browser("dfdf").Page("sdf").WebEdit("ddfdffd").set "sddfdffsdsds"

End Function

This is an indirect way of commenting a block of statements.

      

June 22, 2006 01:14:30 #4 maniz   Member Since: Visitor    Total Comments: N/A 

 RE: how to comment a block in QTP 8.2

 Regarding your issue following are the things you can try:

1. ‘ for commenting out a statement

2. REM for adding comment at the end of code

3. Use the following example to comment out a code block

To comment out a block of code use an If-Then structure, where the expression is 0 or False.

Example:

If False Then

Window("Notepad").WinEditor("Edit").SetCaretPos 0,0

Window("Notepad").WinEditor("Edit").Type "Hello This is a test."

Window("Notepad").WinEditor("Edit").Type micReturn

End If

Note:

QuickTest Professional will still read the lines within the if structure, but it will not execute them. Therefore, any syntax errors in the block will be reported during run time.

Let me know if it works for you.

      

March 29, 2007 02:27:52 #5 Rashmi Ranjan Parida   Member Since: Visitor    Total Comments: N/A 

Page 76: QTP Faq's

 RE: how to comment a block in QTP 8.2

 Please follow the following steps to comment a block of code in QTP

1. Select the block of code2. Right click on it and select comment Block

Now it will comment the block of code with single comment line but at a time.

If any query, pls get back to me.

      

March 30, 2007 02:43:09 #6 joydeep_b77   Member Since: March 2007    Total Comments: 1 

 RE: how to comment a block in QTP 8.2

 The way that u have given is for QTP 9.1. It doesnot work for QTP 8.2

      

May 18, 2007 14:58:49 #7 anurag   Member Since: Visitor    Total Comments: N/A 

 RE: how to comment a block in QTP 8.2

 

In QTP 9.2 you can comment block of statements by selecting the statements and right click and comment it.

Q. I am trying to add object from repository dialog box. it creates new page(flight confirm mercury_2) and adds the new object under it. Ideally it should add new object to the existing parent page(flight confirm mercury). how to overcome this problem

Ans: Just make the page a regular expression. How to do that is Go to Object repository-->Select the Object in the repository-->In the Object repository window you will find "Configure Value" item to the right side-->In that U will findTwo fields with name Constant and Parameter-->Beside Constant fields u will find an ikon in white colour-->Click on that-->The title of the page gets displayed in a new dialog box called Constant value options-->Just add '.*' at the last position to the title and check the regular expression Check box

Page 77: QTP Faq's

OR

make it a regular expression by going to object repository-->select the title of page-->clink on white coloured icon present beside the constant field in the right side of object repository window-->add .* to the title and select the check box

Q. What is Key Word driven Testing?What is the differance built in variables and User defined variables?

Ans: What is Key Word driven Testing?

Software test scripts are conventionally composed ad hoc by a coder. Some software development tools help automate testing by recording tests that are run, allowing "playback" of the test routines. However, an entire test routine is rarely, if ever, applicable to more than one release of one application. Data-driven testing adds some modularity by keeping test input and output values separate from the test procedure, but the procedure itself is still in a monolithic script. Keyword-driven testing breaks the test procedure into logical components that can then be used repeatedly in the assembly of new test scripts.

What is the differance built in variables and User defined variables?a function is a block of instructions that affects the data a script is handling. In a script, you can use the functions that VBScript provides (i.e., built-in functions ) or you can create unique functions (i.e., user-defined functions).I analyze two popular built-in functions that let users provide input: MsgBox and InputBox. MsgBox displays a dialog box in which users can click buttons to provide input. InputBox displays a dialog box in which users can type text to provide input.

ORKeyword-driven TestingKeyword-driven testing breaks the test procedure into logical components that can then be used repeatedly in the assembly of new test scripts.

ORThere  are 2 types of Environment variables.....Built-in & User-Defined

Built-in variables are such as : TestIteration, TestName...

User-defined variables are developed by the users in the .xml format and uploaded in the Test Settings -> Environment -> User Defined -> File

Page 78: QTP Faq's