Software Testing Experience

Thursday, April 24, 2008

QTP Frequently Asked Questions Part - 1

1)what is the use of VIRTUAL OBJECTS? explain ?

AThe use of virtual objects in qtp is identifies the objects including pixels(with co-ordinates.)

2)In 1st screen,if v enter a/c no. in one field, the information of the subscriber will be displayed. The details should be displayed only in screen 3(NOTE:details should not display in screen 2 How can v do using QTP.

A)from where ur picking the value for entering A/C no, If you are picking into a variable u can check the same variable with the GetROProperty of the object in the 3rd page.

3)The extension of the Script file is .mts ok What is stand
for mts?

A)Mercury Test Script.


4)HOW TO DO THE BATCH TESTING USING QTP?

A)go to tools ,options and select the test batch runner and select the scripting functions one by one by keeping it in wait mode and execute it.

5)WHAT IS THE USE OF "FUNCTION GENERATOR" IN QTP?

A)1)the use of functional generator in qtp is which lists out the all the built in functions in qtp and helps you to write the vb script for un known objects.

2)it is also used to reduce the typing mistakes & syntax errors.

6)WHAT IS ENVIRONMENT VARIABLES?

A)As for as i know the use of environment variables in qtp is . in qtp the variable which you have in one action cant be used in some other action .so by using environment variables we can use the variables in one action in to another action

7)WHAT IS A TEST STRATEGY & WHAT IS THE DIFFERENCE BETWEEN

TEST STRATEGY & TEST PLAN?

A)Test strategy is a company level document and which says the approch for testing.the test strategy doc also says that the scope,business issues,test delivarables,tools used ,risk analysis etc.where as test plan is document which says what to test,when to test ,how to test and who to test.the test plan document was prepared by the test lead.

Test strategy:i hope that brief version of your test cases

Test plan:this is one of the document in your testing process contains testing envinornment,s/w&h/w requriements,test data creation etc.

8)WHAT IS THE DESCRIPTIVE programming when it is useful? &
when to use this ?

A)descriptive programming in QTP means whenever qtp facing dificulty with obj identification then we will go with regular exp or desc prog it means identifying obj unique prop from the script itself.

ex:vbwindow("").vbedit("attached text:=username") set cdbjd

9)HOW to invoke any recorded script in QTP with out using
RECORD & PLAYBACK CONCEPT?

A)invoke_record (path of the record)

10)can we run the scripts of qtp 8.2 in the qtp7.0?

A)No,becse 8.2 is the advansed version(add some additional properties) of 7.0.so,we run the scripts of qtp 7.0 in qtp 8.2

11)how we can take data in the username field text box into
variable in web application explain with example and give all functions to get data into variables

Any Application, it may be web or it may be window based applications, we use GetROproperty() method to get the data from the Editbox.Same way if u want to set the data to the editbox we use set()method.

for example:

Dim variable name

variable name = Browser(browser).page(pagename).GetROproperty("Logical name")

if u want to print in dialogbox use msgbox()function OR if u want to print in test result use reporter.reporter event() function

12)What are the file extensions for per-action, shared object
repository files and what is the extension for library files?

A)Per-Action OR : .mtr

Shared OR : .tsr

Library files : .vbs, .txt File extension for above files are

Per-Action Object Repository - .mtr(Mercury test Script)

Shared Action object Repository - .tsr(Test repository)

Library files - .vbs or .txt

13)How do you handle XML exceptions in QTP(Here it is Exception,not the checkpoint)

A)using recovery scenario in QTP we can handle any type of exceptions

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

A)Here iteration means repeat the processes, with same values or different values,when You take the datadriven test with different values... the test process repeats that much of time.

15)Difference between image checkpoint and bitmap checkpoint

A)In Bitmap checkpoint, we can compare the exact images, means the source image(in Build1) with the destination image (in build2). So it compare the exact image between both the builds. Here, even we can check the part of images between source and destination.

where as in Image check point, we can check all the values and properties of an image. Ex. The destination address once we click on the image, image type etc.

16)what is descriptive.create()in qtp?

A)To create properties collection and we can create properties object(MYDescription).once we have filled properties collection with a set of properties objects (properties,values) we can specify properties object in place of an obj name

17)what is TOM in qtp?

A)Test Object Model

18)Tell about descriptive programing in qtp8.2?

A)Descriptive Programming is all about identifying an object uniquely. And there is no defined frame work for it. Frame work depends on the project.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:=SignIn").click

19)how to merge object repositories?

A)In QTP8.2 provide a facility to add repositories.

when u installed qtp 8.2 software to show a option in Tools Merge object Repositories. Through U can add object Rep.

20)what is the Command used to start the QTp from Run.(start-> Run)

A)systemutil.run"path of the file"

21)1)what is the Exact Meaning of Environment Variables?

2)what is Compile Module in QTP? what exactly it contains Functions or Actions?

A)win runner contains compile module.but qtp does not support complie module.compile module means library files in qtp ,which contains functions not the actions

22)what is Compile Module in QTP? what exactly it contains Functions or Actions?

A)Compile Module means library files. It contains functions.

23)Tell me the QTP Advantages and Disadvatages ?

APros:Will be getting the initial focus on development of all new features and supported technologies.

•Ease of use.


•Simple interface.


•Presents the test case as a business workflow to the tester (simpler to understand).


•Uses a real programming language (Microsoft's VBScript) with numerous resources available.


•QuickTest Pro is significantly easier for a non- technical person to adapt to and create working test cases, compared to WinRunner.


•Data table integration better and easier to use than WinRunner.


•Test Run Iterations/Data driving a test is easier and better implement with QuickTest.


•Parameterization easier than WinRunner.


•Can enhance existing QuickTest scripts without the "Application Under Test" being available; by using the ActiveScreen.


•Can create and implement the Microsoft Object Model (Outlook objects, ADO objects, FileSystem objects, supports DOM, WSH, etc.).


•Better object identification mechanism.


•Numerous existing functions available for implementation – both from within QuickTest Pro and VBScript.


•QTP supports .NET development environment (currently WinRunner 7.5 does not).


•XML support (currently WinRunner 7.5 does not).


•The Test Report is more robust in QuickTest compared to WinRunner.


•Integrates with TestDirector and WinRunner (can kick off WinRunner scripts from QuickTest).


Cons:


•Currently there are fewer resources (consultants and expertise) available due to QTP being a newer product on the market and because there is a greater Demand than Supply,thus fewer employee/consulting resources.


•Must know VBScript in order to program at all.


•Must be able to program in VBScript in order to implement the real advance testing tasks and to handle very dynamic situations.


•Need training to implement properly.


•The Object Repository (OR) and "testing environment" (paths, folders, function libraries, OR) can be difficult to understand and implement initially.


24)What is throw object?


A)It is exception handling

25)How will you handle the situation when object is not captured during record?

A)While recording the object is not recognised--go for low level recording.

virtual object vizard too right. But, if u find object not recognised by tool before start generating script.


26)What kind of errors can b handled in QTP in real time scenario?


A)1) Pop-up Window

2) Object state

3) Test run error

4) Application Crash


27)an objects recogonised without repository?


A)Yes. In descriptive programing, we dont use object repository. we give proprties of the object in order to recognise it uniquely, in script.


28)What is smart identification?


A)Smart identification comes into picture when Quick Test fals to recognise an object uniquely using the recorded properties. It follows the following process to identify the object:


1. QuickTest "forgets" the recorded test object description and creates a new object candidate list containing the objects (within the object's parent object) that match all of the properties defined in the base filter property list.


2. From that list of objects, QuickTest filters out any object that does not match the first property listed in the Optional Filter Properties list. The remaining objects become the new object candidate list.


3. If the new object candidate list contains more than one object, then step 2 is repeated with the second property listed in Optional Filter Properties list.

4. Step 3&4 are repeated until an the object in recognised uniquely.


29)in howmany ways you perfrom batchtesting


A)I hope its in only one way. By going into


Start-> Programs-> QuickTestPro-> Tools-> Test Batch Runner


Here, you can call any number of scripts and run at once. All the scripts are run one after the other in the order they are placed in batch runner.


30)What is the differnce between action & script


A)A sequence of related statements are called "Action".But a script will contain more than one Action


31)Synchronozation types in QTP


A)There are four type of synchronozation point in qtp


1) wait 2) local 3) exit 4) global


32)How u perform exception handling in QTp,what is other name for this


A)The other name for Exception handling is Recovery scenario.There are 4 Triggers


1.Popup Window.


2.Object State.


3.Test Error.


4.System Crash.


The solution are


1.Function call.


2.Keyboard or mouse Operation.


3.Restart.


33)How you automate testscripts one by one or module wise or all at once


A)Test Automation is process which follows the framework designed for the company. This framework varies from one organization to other. Here are some basic steps which are follwed in general...


Step1: Segregate the test cases to be automated.


Step2: Prepare the test data for the selected test cases


Step3: Make scripts for repeatable or functional scenarios


Step4: Convert those scripts as Reusable functions


Step5: Make test scripts by calling the reusable functions and adding the conditions as per your

requirements.


34)How you automate test scripts


A)we can automate test scripts by means automation reference model,by which we can automate the qtp itself


35)What do you do if QTP doesn't recognize object ,what action
should be taken


A)first of all we have find the object by means of object repository if it is not identifying the nature of the object we can go for object identification ,even though if QTP is not recognising the object we can map the object by means of virtual manager wizard.QTP does not recognize the object means, you dont have proper add-ins. In this case, QTP treats the objects as non-standard objects. We can map these non-standard objects to standard objects by using virtual object wizard. Once mapped sucessfully, QTP can identify the objects.


36)After running scripts how you report results ,there is any
specific report form


A)report.reportevent event status,stepname,detailsUsing QTP utility statement we can send report to Test


Result Window.Here the utility statement is


syntax is


report.reportevent event status,stepname,details


Argument-1 : event status are 4 types


1)micpass


2)micfail


3)micdone


4)micwarnin


Argument-2 : The status of object we are going to report


Argument-3 : The details of the object.


37)Anybody explain me, the concept of checkpoint declaration
in the QTP mainly for the Objects, Pages, Text and Tables ?


A)A checkpoint verifies that expected information is displayed in a Application while the test is running. You can add eight types of checkpoints to your test for standard web objects using QTP.


Object, Page and Table checkpoints can be added using Standard check point.



1.
A page checkpoint checks the characteristics of a Application


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


3.
A table checkpoint checks information within a table on a Application


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


38)How to use Regular Expressions in QTP? give an example.


A)In QTP, delaing of Regualar Expressions and varing object descriptions can be handled by using Description Programming.


Ex. of using Regular expression is:u just record yahoo login operaion and click on Inbox link. Assume u got 10 new mails, then it shows like Inbox(10). Read one mail, now it shows like Inbox(9). Now try to play the recorded script. It wont work. Now use Regular expression in Inbox link like:"Inbox.*". At that time it wil work.


39)ake a situation when you are working with QTP, suddenly system has crashed.so you again start the system. My questyion is how can QTP directly opened when the system
desktop appears.


A)we can set the error or event in the recovery scenarion wizard and if the system faces such situation by the recovery scenario the system will get back to the desired action or events


40)give me descriptive programing code sample flight
application in qtp?


A)Browser(name:=Mercury FlightApplications).Page(title:=FlightApplications).Exist


41)where is the bitmap checkpoint be saved


A)Not only Bitmap Check point Any check point will be saved in a Tmp/the script saved


Folder along with the script there is no any other place to save


42)what happen in object repository(shared)if we call an existing action from an external action ? and what happen in object repository(peraction)if we call an existing
action from an external action ?


A)As you said, the existing action already recorded the objects into object repository pertaining to the when you call the external action,it will added the objects to the existing one


43)how can we retrieve ten rows from the data table using loop
concept?


A)Assume "Column1" is my column name in the Global Data table, then use this code:


for i=1 to 10


datatable.setcurrentrow(i)


returnvalue=datatable.value("Column1","Global")


msgbox(returnvalue)


next


44)How to covert a String to an integer?


A)you can use cint function



cint(10) will convert integer 1


45)How to "Turn Off" QTP results after running a Script?


A)Go To Menu . Tools > Options > Run (Tab)



Uncheck The "View Results when run session ends"


It will Turn Off The QTP.


46)Does QTP is "Unicode" compatible?


A)yes , QTP is Unicode compatible


47)How to supress warnings from the "Test results page"?


A)From test result window, Click View->Filter menu then uncheck the warning check box to filter the warning from the test result


48)How to open any application during Scripting in QTP?


A)you can launch any exe files using following code



systemUtil.Run "PATHFilename.EXE"


ex:


systemUtil.Run "C:Calc.exe"


invokeapplication(PATHFilename.EXE")


49)How to retrieve the property of an object in QTP?


A)using Getroproperty("text") we will find out the what ever object properties u want other wise by using object spy also we will get object properties


50)How to change the run-time value of a property for an
object in QTP?


A)use 'SetToProperty' method of an object to change the property of object at run-time....


example :


browser(" ").page(" ").winedit("username").setToProperty "Property", Value


Property can be any physical property of the object such as


Name, type, color........


51)How to execute a WinRunner Script in QTP?


A)insert->callto winRunner->select test or function


52)how to add a runtime parameter to a data sheet?


A)1)you can pass datasheet value to test during run time


DataTable.SetCurrentRow(1)


var= Datatable.Value("Column Name","Sheet name")



2)
you can write value to datasheet during run time


DataTable.SetCurrentRow(2)


Datatable.Value("Column Name","Sheet name") = Value


53)How to create a Runtime property for an object in QTP?


A)Using GetROProperty()


54)Tell me Three major differences between QTP & Winrunner?


A)a) Winrunner using TSL for programming Resource availablity


is less but QTP using VB script we can find more resource.



b)
in QTP we can See the result With Step by step With SCreenshot



c)
The GUI map can be difficult to understand and implement


55)How to export QTP results to an ".xls" file?


A)Datatable.export stmt


56)How to export data present in Datatable to an ".xls" file?
A)DataTable.Export("Path of the sheet")

or DataTable.ExportSheet("Path of the sheet",Index of the runtime datatable u want to export")

57)what does it mean when a check point is in red color? what
do u do?

A)red is symbol for failure

58)How do u do batch testing in WR & is it possible to do in
QTP, if so explain?

A)it is possible to run test batch in QTP,the option is

Programs->Quick test professional->Tools->test Batch runner

then it will open test batch runner window then u have to add the test that u want to automate for qtp tool,how to add the tests is..

File->New
Batch->Add
like that u can add,what ever the test u want to automate

59)How many ways we can parameterize data in QTP ?

A)Parameterization can be possible in the following ways

1:local data sheet

2:Environment Variables

3:DataTable

4Random Variables

60)What is Object Spy in QTP?

A)Object spy is used to know physical properties and the methods containing to an object we
want to know the object properties & methods then we will use object spy

61)What is test object model in QTP ?

A)Test Object Model in QTP, is the combination of Test Object and Run Object information of the objects used.

62)What is Parameterizing Tests?

A)when converting test into data driven tests - we replace fixed values with parameters/variale - is known as parameterizing the tests. Then you test ur application we may want to test how the application performs same operations with multiple sets of data

63)How does QTP identifies the object in the application

A)Mainly objectives are three type's OF PROPERTIES namely

1) Mandatory properties, 2) Assistive properties 3) ordinal identifier firstly QTP traying to identifies mandatory properties if it is not unique then identifies assertive properties if it is not unique then go to identifies ordinal identifier.

64)In how many ways we can add check points to an application
using QTP.

A)1.place the cursor in the script where u want checkpoint and right click in there option is there checkpoint.

2.go after recording script u can go active screen area there snopshoots what ever u record in u r application that images will be there put u r mouse point to that image and right click there also u will get checkpoint option

3.insert menu---checkpoint

65)Explain the check points in QTP?

A)A checkpoint verifies that expected information is displayed in a Application while the test is running. You can add eight types of checkpoints to your test for standard web objects using QTP.

•A page checkpoint checks the characteristics of a Application

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

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

•An image checkpoint checks the values of an image on a Application.

•A table checkpoint checks information within a table on a Application

.An Acessiblity checkpoint checks the web page for Section 508 compliance.

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

•A database checkpoint checks the contents of databases accessed by your web site


A)using Enviromental variables

Labels:

posted by Balaji Visharaman at 12:47 AM

0 Comments:

Post a Comment

<< Home