Wednesday, February 2, 2011

QTP FAQ 1

Q.1 how can you load data into target table without leading zeor's ?
Ans : By using the Trim function we can able to Remove the 
leading Zero's in a value and we can load it in to target.
Function : trim(Col_Nm,'0',L)

Ans : Sometimes QTP do not recognize objects in the application, which is developed in unsupported environment, then we are making the QTP to identify that object in the application.

Regular expressions enable Quick Test to identify objects and text strings with varying values.

You can use regular expressions when defining the
properties of an object, the methods of an argument, when parameters zing a step, and when creating checkpoints with varying values.

A regular expression is a string that specifies a complex search phrase. By using special characters such as a period (.), asterisk (*), caret (^), and brackets ([ ]), you define the conditions of the search.

We can write the user defined in a notepad and save the file as .vbs and we then associate that to Test-Settings-Resources-Associate Library Files by clicking plus and select the .vbs file. In the script we can call the function with function name ().



To call an action from other tests we must make it as reusable so that scope becomes global and can be called from any test. A REUSABLE action can be called and executed but not edited in the current test.
Reusable action is using for reuse same set of statements in another action when ever required.

While creating action we have to select option as 'Reusable', then only this action can use for other normal action in QTP.


Quick Test Pro environment using the graphical interface and Active Screen technologies - A testing process for creating test scripts, relating manual test requirements to automated verification features - Data driving to use several sets of data using one test script.




The test object model is a large set of object types or classes that Quick Test uses to represent the objects in your application. Each test object class has a list of properties that can uniquely identify objects of that class and a set of relevant methods that Quick Test can record for it. A test object is an object that Quick Test creates in the test or component to represent the actual object in your application. Quick Test stores information about the object that will help it identifies and checks the object during the run session. A run-time object is the actual object in your Web site or application on which methods are performed during the run session.




You can then enter test data into the Data Table, an integrated spreadsheet with the full functionality of Excel, to manipulate data sets and create multiple test iterations, without programming, to expand test case coverage. Data can be typed in or imported from databases, spreadsheets, or text files.
Q.8Explain about the Test Fusion Report of QTP?

Once a tester has run a test, a Test Fusion report displays all aspects of the test run: a high-level results overview, an expandable Tree View of the test specifying exactly where application failures occurred, the test data used, application screen shots for every step that highlight any discrepancies, and detailed explanations of each checkpoint pass and failure. By combining Test Fusion reports with Quick Test Professional, you can share reports across an entire QA and development team.

QTP testing process consist of seven steps-
* Preparing to recoding
* Recording
* Enhancing your script
* Debugging
* Run
* Analyze
* Report Defects (more?)



Q.10 what are the properties you would use for identifying a browser & page when using descriptive programming?
Browser= name
Page = Title

Flat files in QTP are:
1. Notepad
2. WordPad
3. Excel sheet

Q.12 what is elapsed time?
The elapsed time is that time which is used by server to take or given response to the client for hitting server by client, throughput data from server and client site and response and average time
We can generate the script for exceptions using recovery scenario manager or within the script as well.
1) Using recovery script get the properties of the exception object and add it in the resources by naming the exception. We can create the recovery scenario in the options and add it in the resources of the file menu. When generating the script after the exception comes in type wait () please specify some umber like 10 or any value in() so that it will wait and then add the recovery scenario over there ad continue with the script
2)while writing the script without using the recovery scenario use when event occurs go to step umber and add the recovery scenario by whatever the type of framework that you are using.

Yes, we can call any numbers of Test Scripts from Main Script.

For this, whatever scripts you want to call, you need to make The Actions in those scripts are Re-Usable actions. And then you can give a call to these scripts.



1. Insert > Call to Existing Action
2. Select the "Test From" (If "Action" is being called from
another Test)
3. Select the "Action" you want to call
4. Then select the Location, where the "Action" needs to be
called in the current script
5. Click "OK"

Or you direct write the script as below in the line where
you want to call the action:

"RunAction <ActionName>, (Iteration)"

Here, "<ActionName>" is the Action you want to call and
the "(Iteration)" is optional where you can define number
of iterations you want to execute.

Eg:
1. RunAction Action2, OneIteration (For single Iteration)
2. RunAction Action3, AllIterations (For All Iterations)
3. RunAction Action4, 1-3 (For iterations from 1 to 3)


Note: To Call an "Action" multiple times or to Call
an "Action" from Other Tests, make sure the "Action" is
marked as a "Reusable Action".
Split action is mainly used for re-usability of the application.

Action split is nothing but splitting a action in to two parts separately.

On calling an action go 2 call action properties and select call existing action.

For suppose use have save a file in your desktop then this property comes in picture.

In Qtp there are 2 object repositories, they are
1.Shared Object Repository
2.Per Action Mode,
by default it's per action mode.we will use shared OR for calling a particular action,it's like calling external libraries.we will use per action for a particular action ie, for one action only.


We can generate two kind of oR
1.Shared OR
2.Per Action OR (BY default)

Per Action OR Is action specific ,If any modification inti this file effect only that particular associated action.

Where as for Shared OR, Changes should effect all the action. where ever it is been in use.

if you know the "connection string" of your server and also the username, password and DNS name you can connect to the server.

these details are required at the time of creating the Database check point.


we can connect the database through QTP using con.open"provider=sqloledb.1;server=servername;userid=username;pwd=; database=databasename
Cross Platform Testing:

There is a provision of getting the Operating system in QTP by using the Built in Environment. Eg. Platform = Environment("OS"). Then based on the Platform you need to call the actions which you recorded on that particular platform.

Cross Browser Testing:

First get the type of browser you are using: Eg. Browser("Core Values").GetROProperty("version")

This will give you internet explorer 6 or netscape 5. Based on this value you call the actions which are relavent to that browser.

First of all we need to have a java add-in to handle a java tree.In tools option we have the "object identification" drop down list.There we have the java option to recognise the objects there select the tree option.Add the properties to be recognised.Then the QTP will start recognising the tree.

If not use the DOM to detect the tree.Here select code from the back ground and manipulate accordingly.

You can run any number of actions in your QTP test...However it is not recommended to do the same .In QTP we can have only 255 actions. Each action creates a new datasheet in excel. MS Excel has a limit of 255 sheet. So If you create more than 255 actions it will be created but there will be no datasheet for these actions.
Q20 .How to open multiple instances of an application from QTP? 2. How to recognize each instance and setting values and triggering events in a particular application?
Up to my Knowledge we cant open multiple instances at once.

and

For recognization we must have to add each instance in the repositary.


we can open multiple instances of Browser By perfomring loop
for i=1 to 10
Set OBJB=CreateObject("Internetexplore.application)
OBJB.Navigate "URL"
SEt OBJB=Nothng
Next

2 comments: