Subscribe by Email


Showing posts with label Quick Test Professional. Show all posts
Showing posts with label Quick Test Professional. Show all posts

Tuesday, October 9, 2012

What is a Test Object Model in QTP?


Test object model is an important concept of quick test professional to be understood. In this article we have focused on the test object model of the quick test professional itself. 


What is a Test Object Model?

- The test object model is considered to be a large set of classes or objects of type class which are used by the quick test professional to represent the objects present in the software system or application.
- There is a list of properties associated with every class of the test object. 
- Using the properties from this property list, the objects belonging to that particular class can be uniquely identified. 
- Also, the identification of a set of relevant methods that can be recorded for the object by the quick test professional can be easily identified. 

First let us clear up few terms associated with the test object model one by one:

1. Test object: 
This is the object that is created by the quick test professional in the test component or the test as a means of representation of the actual object present in the AUT or application under test. The information regarding the object is stored by the quick test professional since later it is required for many purposes like identification of the object and checking the working of the object during the run session.

    2. Run time object: 
   This object is the actual object present in the application under test. On this object only the various methods are performed while the identification process is in progress or we can say during the run session.
Whenever the user carries out an operation on an object in the application, the  following steps are taken by the quick test professional:
a)    Identification of the test object class of the quick test professional which is said to represent the object up on which the user performed the desired operation.
b)   Creation of appropriate test object based up on the identification in the previous step.
c)     Capturing of the current values of the properties of the objects residing in the application under test and preparing a list accordingly. This list is then saved along with the test object.
d)   Giving of a unique name to the test object up on the condition that it should reflect the value of one of the objects prominent properties.
e)    Recording of the operations that the user carried out on the test object by making use of the appropriate quick test professional test object method.

There are certain points about the test object model which are always helpful:
  1. Each and every test object method that is executed during the recording session forms a separate step in the recorded test. When the command for execution of the test is encountered, this recorded test object method is played up on the run time object.
  2. The source from where the properties of the object are captured is the object itself. These properties are important since there values are used for the identification of the run time objects while a run session is in progress.
  3. The properties of the objects have a tendency to change during the run session and so this would present some difficulty while matching the objects with the description. To avoid such a situation you have the option to make a manual modification of the test object properties while designing the test component during a run session. Some times even the regular expressions can be used as a substitute for the identification of the property values.
  4. The test object property values can be viewed as well as modified and stored through the object repository dialog box. 


Monday, October 8, 2012

How many ways we can parameterize data in QTP?


Parameterization is one of the important provisions we have in quick test professional which has enabled the passing of the values to the tests very simple. This parameterization feature enables one to pass multiple values at a time to a test.
And what more? 
The process of parameterization has proven to be a great helping hand while carrying out the data driven testing. Data driven testing is the kind of testing that involves working with multiple sets of data on the same tests. 
The quick test professional comes with various ways for carrying out the process of parameterization:
  1. Parameterization via loop statements
  2. Parameterization via data table
  3. Dynamic test data submission
  4. Obtaining test data via front end objects
  5. Getting test data directly from the spread sheets, flat files or we can say external files.
  6. Getting test data directly from the oracle, MSaccess or we can say data bases.
Now we shall discuss the above 6 different ways of parameterizing the tests in detail.
1. Parameterization via loop statements: 
In this method the sequential numbers or logical numbers can be passed via the loop statements however you cannot pass strings to the tests.

2. Parameterization via data table: 
One data table or spread sheet is provided along every test in quick test professional. The provided data table along with the test can be used very well for the data driven testing. Furthermore the following 3 purposes are served by the data table:
a)   To import the test data from external spread sheets: for doing this open the data table and place the pointer. Then right click and select the import from file option. Then you need to enter the path of the spread sheet to be imported from and hit ok. Later connect to the test.
b)   To import the test data from the external flat files: for doing this open the data table and place the pointer. Then right click and select the import from file option. Then you need to browse the path of the file to imported and press ok. Later connect to the test.
c)   To import the test data from the data bases: for doing this the user needs to first create a DSN of the data base i.e., the data source name by making use of the SQL commands. This can be done by creating a test data base and saving the created data base with .mdb extension in msaccess. Next step involves creation of a data table and filling it up with data. The last step is to create a DSN and you can start importing the data.

    3. Dynamic test data submission: 
   This also involves the use of the loop statements however the data has to be entered again and again by the user.

    4. Obtaining test data via front end objects

   5. Getting test data directly from the spread sheets, flat files or we can say external files.

   6. Getting test data directly from the oracle, MSaccess or we can say data bases.

There is one more method for parameterizing the data apart from those mentioned above and is also less followed. The method makes use of the dictionary object for the purpose of parameterization. There are several types of parameterization namely:
  1. Data table
  2. Environment variable
  3. Random number
  4. Test and action
The data table consists of the following parameters:
  1. Input parameter
  2. Out put parameter
  3. Random number
  4. Environment variable. 


How Does Run time data (Parameterization) is handled in QTP?


Efficient run time data handling is quite important for proper test automation through quick test professional. In this article we take up discussion regarding how run time data is parameterized or handled during a run session in quick test professional.
The parameterization of run time data is necessary in quick test professional  as it enhances test components. 

What happens in Run-time Data Parameterization?

- In run time data parameterization or handling, a variable is passed as a parameter or an argument via an external source which is generally a generator in most of the cases. 
- This variable or parameter which is passed essentially consists of a value that is assigned via the generator as mentioned in the previous line. 
- The parameterization of the variables in the test component can be done in a series of different check points as well as in a series of a set of different steps as it is required by the situation.
- Apart from normal values, the parameterization of the action data values can also be done. 
- For parameterizing the same value in a series of several steps the data driven wizard can be used.  

How it is handled in QTP?

- Quick test professional test automation suite comes with an in built integrated spread sheet when the run time data table is filled up with the test data. 
- This spread sheet is just like the excel spread sheet and thus multiple test iterations can be created which in turn will save you a big deal on the side of programming efforts. 
- The run time data can be entered either manually or in an automatic way by importing the data from the spread sheets, text files, data bases and so on. 
- The spread sheets in quick test professional come with full functionality as that of the excel spread sheets. 
- Using these spread sheets following tasks can be achieved:
  1. Manipulation of the data sets
  2. Creation of multiple iterations of the tests
  3. Expanding test coverage without unnecessary programming and so on.
- In simple form, parameterization can be defined as providing multiple test data or inputs to the tests. 
- While working on quick test professional, input can be supplied in the below mentioned 4 ways:
  1. Input through note pad
  2. Input through key board
  3. Input or import via a data base
  4. Input through excel spread sheet.

What is Run Time Data

Run time data is nothing but a live version of the data that has a current association with the test that is currently under execution. 
There are two methods available for the parameterization of the run time data as mentioned below:
  1. DTSheet.GetParameter: with this parameterization method the specified parameter can be retrieved from the run time data table.
  2. DTSheet.AddParameter: with this parameterization method a new column is added.
Properties of Run-Time Data
  1. Name property: It defines the name of the column in the run time data table.
  2. Raw value property: It defines the raw value of a cell residing in the current row of the parameter under consideration. The actual string written in the cell before computation is called the raw value for example actual text present in some formula.
  3. Value property: This is the default property of the parameter and used for retrieving as well as setting the value of the cell of the active row in run time data table.
  4. Value by row property: It is used for retrieving the value of the in the row specified by the parameter.  


Sunday, October 7, 2012

How does QTP recognize Objects in AUT?


The quick test professional comes with two types of object identification mechanisms unlike winrunner as mentioned below:
  1. Usual or the normal object identification mechanism and
  2. The smart identification mechanism

What is Usual or Normal Object Identification Mechanism

- In the usual object identification routine, the first step of the quick test professional is to learn the description of the object as provided by the user before the starting of the test. 
- The description of the object provided by the user consists of the properties of the object. 
- All the objects present in the software system or AUT (application under test) are matched one by one with this physical description.
- It is checked that how many properties of the object are matching with the properties mentioned in the description. 
- This method is the easiest  of the two above mentioned object identification routines. 

Now what if this usual object identification mechanism fails to identify the object? 
The alternative here is the second object identification mechanism i.e., the smart identification mechanism. 

Why does a the normal method fails?

- The normal method fails because the value of the object properties starts changing dynamically which makes it difficult for the quick test professional to track the object. 
- Another situation in which the normal identification mechanism can fail is when the quick test professional finds not one but more than one objects in the application under test matching with the properties mentioned in the description. 
- In such a case the quick test professional erases from its memory the learnt description of the object and calls up on the smart identification mechanism for the identification of that particular object. 

Let us see a comparison between the smart identification mechanism and the normal identification mechanism:
  1. Smart identification is more complex then the usual one.
  2. Smart identification is more flexible then the usual one.

What is Smart Identification Mechanism

- Smart identification mechanism is so reliable that it can work even if the currently provided description of the object fails.
- To get the best out of the smart identification mechanism, one needs to configure it properly in a logical way. 
- Smart identification mechanism is driven by two different sets of properties as described below:
  1. Base filter properties: As the name suggests these are the base or the fundamental properties belonging to a particular test object class. The value of these fundamental properties cannot be changed until and unless you make changes in the properties of the original object.
  2. Optional filter properties: The leftover properties i.e., all the properties leaving out the base filter properties are grouped under this category i.e., the optional filter properties. These properties unlike the other base filter properties do not change frequently. These properties can some times be ignored i.e., when they do not hold to be applicable and therefore have been named as optional filter properties.

How the smart identification process follows?

- The description given by the user is erased from the memory of the quick test professional and a list of objects called candidate list is created.
- Objects or candidates in this list match at least one property in the property list. 
- Now, the base filter properties are used for cutting down on the list of the object candidates. 
- The list is narrowed down to only one object which has most number of properties matching in the list of properties. 
- Some times it may happen even after reaching this stage the quick test professional may not find a matching object. 
- In such a case the quick test pro makes use of an ordinal identifier in addition with the learnt description. 


Saturday, October 6, 2012

How do u do batch testing in WinRunner & Is it possible to do in QTP, if so explain?


WinRunner provides you the facility of executing a certain batch of the unattended tests. This feature of the winrunner has proved to be quite useful especially in the situations when a large groups of tests have to be run over night i.e., an over night run. 

How to do batch testing in WinRunner?

- A batch test can be viewed as a test consisting of a test script which holds the calls to the other tests. 
- Such call statements execute each and every test called in the list and also save the result up on execution.
- A batch test may consist of n number of tests depending up on the need and requirement of the user. 
- A batch as such just seems like a normal test but with an unusual large number of calls. 
- A batch test can be run by using the option “run in batch mode”. 
- This option is available in the run category of the general dialog box which gets invoke just before the start of the execution of the test. 
- Whenever a test is run in batch mode, all of the messages that may be displayed during the test run are suppressed by the winrunner. 
- This is done so that the winrunner is able to run a batch test unattended. 
- The execution of the batch tests is therefore different from the regular, interactive test runs where you may come across several messages popping up on the screen. 
- In batch tests, this thing is not there and so a lot of time is saved. 
- The current chain of all the called tests can be viewed at a break point in the call chain pane available for viewing in the debug viewer window. 
- After the completion of the batch test run the winrunner makes the results available in the test results window. 
- Winrunner provides you the facility of running the batch test via command line.

Is it possible to do batch testing through QTP?

- The quick test professional is the successor of the winrunner and is quite advanced and efficient in many respects as compared to the winrunner. 
- Batch testing is possible in quick test professional. 
Difference lies in the way in which the batch testing is carried out here. 
- The quick test professional facilitates the batch testing service with the help of a separate built-in tool called the test batch runner or QTP batch testing tool. 
- With this tool you can group the tests in to a number of batches which are then executed. 
- The result of this batch test run is made available in the test result viewer. 
- In quick test professional, batch wise viewing of the result is not possible. 
- Results for individual tests have to be viewed. 
- For the execution of a test batch you need to open the path of the test batch and give the run command. 
- In quick test professional, other mercury products for batch testing can also be installed and used if one is not comfortable with the in built tool of the quick test professional i.e., the test batch runner. 
- For doing this you need to follow the below mentioned sequence:
Tools menu à options à run à check the check box “allow other mercury products” à apply à ok
- Even a partial batch test is also possible! 
- You just need to deselect the tests that you want to be executed. 
- MTM or multi test manager is another mercury product using which one can carry out batch testing. 


Friday, October 5, 2012

Explain the QTP Tool interface?


The tool interface of the quick test professional is the focus of this article. The tool interface of the quick test professional consists of certain elements:
  1. Title bar: This bar displays or holds the name of the test that is currently open.
  2. Menu bar: This bar holds all the quick test commands that one may need often.
  3. File tool bar: This bar holds all the quick test commands or tools that one may need in the management of the tests.
  4. Test tool bar: This bar holds all the quick test commands or tools that may are required in the creation as well as management of the tests.
  5. Debug tool bar: This bar holds all the quick test commands that may be required while debugging of the tests. Usually this bar is not displayed along with the other bars when the quick test professional is launched. If the quick test professional is not displaying the debug bar by default then you need to go to the view and select debug tool bar from the tool bars sub list.
  6. Status bar: This bar displays the current status of the test that is currently under execution.
  7. Action tool bar: This bar holds a list of actions using which one can view the individual details of the whole test flow or an individual test or action. Just like the debug tool bar this tool bar is also not displayed by the quick test professional by default. For displaying it along with the other bars you need to go to the view menu and select action tool bar from the sub list of the tool bars. But if you have inserted an external action or a reusable action in to your test scripts, then the quick test professional displays the action tool bar automatically.
  8. Test pane: This pane consists of two tabs which enable the viewing of the test in two view modes namely: the expert view and the key word view or the tree view.
  9. Test details pane: This pane holds the active screen of the quick test professional.
  10. Data table: This table consists of two tabs namely: the action tab and the global tab. Both of these tabs together provide you assistance during the parameterization of your tests.
  11. Debug viewer pane: This pane consists of three tabs namely, the expressions, the commands and the variables. All of these 3 tabs provide you assistance while you debug your tests. However, there is one issue with debug viewer pane which is that you can open it only when you pause the test run at a break point.
As we know that the quick test professional provides two standard views as well way to modify the test scripts namely:
  1. Key word view and
  2. The expert view
- It is because of these views that the quick test professional is said to possess an IDE or integrated development environment. 
- The quick test professional comes with several standard IDE features like break points etc.
- The scripting language that is used by the quick test professional i.e., the VBScript provides support for the classes but not for the other aspects of object oriented programming like inheritance, polymorphism etc. 
- It lacks some other features such as:
  1. Cannot use some visual basic key words.
  2. Does not have an integrated debugger.
  3. No event handler
  4. No forms editor
- The debugger has got a limited functionality when compared with the debuggers of java, VBA, VB.NET and so on. 


Explain the concept of object repository & how QTP recognizes objects?


Just like its Winrunner counterpart, the quick test professional also comes with an object repository which is the first aspect of this article that we are going to discuss in this article and the second aspect to be discussed is regarding the identification of the objects by the quick test professional. 

What is a Object Repository?

- Just like we have a store room and other storage places in our house, the same way the quick test professional consists of a storage place where the information regarding the objects can be stored and this storage place is called the “object repository”. 
- During the process of the identification of the objects, the presence of an interface is necessary between the application under test and test scripts in order for proper identification of the objects. 
- This interface is provided by none other than the object repository itself. 
- An object can be identified as a run time entity with some characteristic properties as well as structure. 
- Few examples of software objects are:
  1. Windows
  2. Web pages
  3. Edit boxes
  4. Buttons
  5. Check boxes and so on.

What kind of objects QTP recognizes?

Quick test professional recognizes 4 types of objects as mentioned below:
1. Run time objects
These are the objects that are present in the application under test or AUT such as links, check boxes, buttons etc.

2. Test objects
-Run time objects cannot be operated up on directly rather there references are created which are nothing but the test objects such as web button, link, win edit and so on. 
-These test objects are referenced by different names in different environments.

3. Utility Objects
- These are the objects that are reserved by the quick test professional for the purpose of testing as well as test reporting. 
- One such example is the reporter object for displaying the test results.

4. User defined objects (also known as the automation objects)
- In most of the cases objects are required that can perform some specific operations i.e., the user defined operations. 
- Such objects are referred to as the user defined objects.

How QTP recognizes objects?

- For every action that is performed on an object, a local repository is created by the quick test professional automatically while the recording is in progress.
- The local object repository is different from the global object repository in the respect that it cannot be shared among the tests.
- Additional objects can be added to this repository by the user as well as the existing ones can be modified. 
- Global object repository is more commonly known as the shared repository. 

Now let us focus up on the second aspect of the quick test professional i.e., the identification of the objects. 

- Quick test professional has got two major mechanisms for accomplishing this task as stated below:

1. Usual object identification mechanism
- In this mechanism, the learned description of the object i.e., the one provided by user is followed throughout the identification process for identifying the object. 

2. The smart identification mechanism
- This mechanism is smarter than the former one, more flexible but far complex. 
- It comes into play when the first one fails. 
- It rejects the description that was used in the first mechanism and prepares a list of objects that resembles properties defined by the quick test professional. - For the smart identification process to work properly it is required that it should be configured properly. 





Thursday, October 4, 2012

Explain the check points in QTP? In how many ways we can add check points to an application using QTP?


Check points in quick test professional have always proved to be an efficient tool. In this article, we discuss exclusively about the check points in quick test professional and the ways in which the check points can be added to an application with the help of quick test professional. 

What is Check Point? How it is added to an application?

- Check point can be thought of as a point to confirm or verify whether the application under test or AUT is working properly or not. 
- This is verified by making comparisons between the current value of some property and the expected value of the same property decided earlier. 
- Whenever a check point is added by the user, an equivalent check point is added by the quick test professional to the present row in the key word view as well as a “check check point” statement is added to the expert view. 
- The name of the test object also serves as a name for the check point that has been added to it. 
- The check points can be added via an active screen by placing the cursor on the desired location and clicking the insert standard check point option. 


Types of Check Points

It is on the basis of this expected value that the check points have been classified in to various types as described below:

1. Page check point: 
- This check point is the check point that is created exclusively for a web page. - This check point keeps a count of all the images and links present on that particular web page. 
- Another purpose for which page check point is used for checking the time taken by the web page to load fully i.e., the load time.

2. Bitmap check point: 
- This check point is the check point that helps in checking of the bitmap of either a full web page or an image. 
- Two images are provided to this check point, one the actual image and the other one expected image. 
- These two images are compared pixel by pixel by the bit map check point.

3. Image check point: 
- This check point is used for keeping a check on certain properties belonging to a web page such as the source file location of the image. 
- However, being a image check point, it cannot check pixels of an image like a bitmap check point does.

4. Text check point: 
- This check point is the check point that is employed in checking the expected text in a web application or web page. 
- This text may belong to a specific region of the text displayed or application under test.

5. Accessibility check point: 
- This check point verifies whether or not the accessibility standard of the application under test matches with the accessibility guidelines laid down by the W3C or world wide web consortium for information systems and technology which are web based.

6. Data base check point: 
- This check point performs the task of generating a query while the recording is in progress. 
- The values stored in the data base serve as expected values. 
- This query is executed during the run time to obtain the actual value which is then compared with the expected value.

7. Table check point: 
This check point is the one that is used for checking various table properties such as cell width, row width and so on.

8. XML check point: 
This check point is the one that is used to verify the following:
a)     XML schema
b)     XML data etc.



Wednesday, October 3, 2012

How would you export a Script from one PC to another in QTP? Can launch two instances of QTP on the same machine?


While working on a collaborative project in quick test professional it becomes necessary to import some scripts from one machine to another. But how this to be done will be discussed and also how two instances of quick test professional can be launched on the same machine.

Exporting a script from one PC to another

- If you would have noticed the quick test professional comes with a tab titled “export”. 
- For doing so just mark the code that you want to export, copy and paste it in a text file. 
- The copied code may consist of references repository items, part of tests, part of settings, parameters, environment variables and so on. 
- However, it is another fact that the export option is not directly available in the quality center’s test script lab.
- A suitable version of quick test professional needs to be installed. 
- Then, you need to connect it to the quality center project. 
- Next step would be to open the test via quick test professional. 
- Once you are done with these 3 basic steps you can now export the file via “export to zip file” feature of the quick test professional either in to the quick test professional data base or some other location and either on the same machine or on some different machine. 
- One may have a bulk of test automation quick test professional scripts on a local machine which might be required to be exported from local machine to  QC. 
- Exporting some times becomes necessary when there are too many scripts and it takes a whole lot of time to open each and every script and then save it in the quality center.
- Some third party tools are available which serve the purpose of uploading many quick test professional scripts at once from one PC to another PC.  
- There is one more method which makes use of the “generate script” function that comes in built with the quick test professional. 
- This function is available in the object identification section under test settings, tools and options tab. 
- Using this function of the quick test professional, a zip file of the scripts to be exported can be created. 
- The zip file of the specified scripts is created at the source computer itself. 
- Later, this zip file can be easily exported to quick test professional on destined computer.

Now let us answer the second question of this article regarding the launch of two instances on the same machine. 
- The answer is no since the quick test professional only has the ability of working with the multiple instances of the AUT or application. 
- An example of this can be multiple windows of the internet explorer browser that can be handled by the quick test professional. 
- Therefore, at a time only a single instance of the quick test professional can be launched on the same machine. 
- To say, actually two instances cannot be launched on the same machine but yes you can go for virtualization option. 
- Today, there are many tools available for virtualization such as sandboxie, Altiris SVS and so on. 
- These two tools have been used for running two Mozilla Firefox profiles on the same PC and for testing some software in isolated PC environment but have not been put to use for launching two instances of the quick test professional on the same machine. 
- But the possibilities are that these two tools can be used for running multiple instances of quick test professional on the same machine. 


What is Accessibility Checkpoint in QTP?


Quick test professional has got a variety of check points to offer which are an ultimate help in the determination of the efficiency measure of the software system or application i.e., it functions correctly as expected. 

The check points accomplish this task by making comparisons between the value defined by the user that is the expected value and the current value of a particular property of the software system or application.

Quick test professional itself adds a check point statement in the expert view and a check point in the current row in key word view as well whenever a check point is added by the user.
The name of the test object to which the check point is added forms the default name for the added check point. However this default name of the check point can be changed as needed. 

Following are the check points provided by the quick test professional:
  1. Image check point
  2. Standard check point
  3. Table check point
  4. Bit map check point
  5. Accessibility check point
  6. Page check point
  7. Text check point
  8. XML check point
  9. Data base check point
Our focus is on the accessibility check point in this article. 

Accessibility Check Point

- With the help of accessibility check point, the areas of a web site or web page or web application that do pertain to the standards and web content accessibility guidelines of the W3C or world wide web consortium can be recognized. 
- In fact accessibility check points are an extended support for the web add – ins environment. 
- With the accessibility check point, it can be verified whether the software system or application is in compliance with the World Wide Web consortium. 
- World Wide Web consortium or W3C lays down the instructions as well as guide lines for information systems and technology based on web. 
- These guidelines maintain a certain standard for accessing the web and this is what that is checked by the accessibility check points. 
- The settings of an accessibility check point can be configured according to the user’s needs. 
- These accessibility guidelines have been stated by a part of the World Wide Web consortium called the web accessibility initiative. 
- If the some parts your application software or system does not matches with the accessibility standard defined by the World Wide Web consortium and need special attention to improve them, they are caught by the accessibility check points. 
- In fact, an accessibility check point does not determine whether the software system or application meets all the accessibility guidelines.
- It catches only the faulty areas of that particular application under test or AUT that need to be brought up to that standard. 
- The identification of the improper areas of the software system or application using accessibility check points is quite quick, easy and also reliable. 
- Furthermore, automatic accessibility check points are also available that you add to every page on your web site or test. 
- Also individual pages or frames can have their own set of individual accessibility check points. 
- The accessibility check points are highly customizable and can be configured according to the requirements of the tests. 
- For configuring, an accessibility check point the options are available under web option of the tools menu. 
- Check and un-check the items that you want or don’t want in your that particular accessibility check point and finalize by clicking OK. 
- The tool in the web environment has to be kept in recording mode. 
- Accessibility check points can be added automatically while the recording is in progress and can be accessed while edit very easily. 


Facebook activity