Friday, April 21, 2017

XML is a markup language designed to store data in a format that can be both readable by human and machine. Using XML, data can also be easily exchanged between computer and database systems.
Sample XML and their key elements are represented below −


Accessing XML
Const XMLDataFile = "C:\TestData.xml"
Set xmlDoc = CreateObject("Microsoft.XMLDOM")
xmlDoc.Async = False
xmlDoc.Load(XMLDataFile)

' Getting the number of Nodes (books)
Set nodes = xmlDoc.SelectNodes("/bookstore/book")
Print "Total books: " & nodes.Length    ' Displays 2

' get all titles
Set nodes = xmlDoc.SelectNodes("/Booklib/book/value/text()")

' get their values
For i = 0 To (nodes.Length - 1)
   Title = nodes(i).NodeValue
   Print "Title is" & (i + 1) & ": " & Title
Next

We can compare two given XMLs −

Dim xmlDoc1
Dim xmlDoc2

' Load the XML Files
Set xmlDoc1 = XMLUtil.CreateXMLFromFile ("C:\File1.xml")
Set xmlDoc2 = XMLUtil.CreateXMLFromFile ("C:\File2.xml")

'Use the compare method of the XML to check if they are equivalent
Comp = xmlDoc1.Compare (xmlDoc1, xmlDoc2)

'Returns 1 if the two files are the same
If Comp = 1 Then
   Msgbox "XML Files are the Same"
Else
   Msgbox "XML Files are Different"
End if

Tuesday, December 27, 2016

Transaction point in QTP

Transaction point:
 It is a concept introduced in QTP which is used for calculating the time taken by an application to perform a specific task or the execution time of a block of statement.

QTP has provided the following transaction options.
  1. Start transaction
  2. End transaction

Syntax:
Services.start transaction ”transaction name”
“ statement 1”
“ statement 2
Services.end transaction ”transaction name”

QTP Framework:

Hi Friends while I was exploring different blogs or different community or networking websites i found mainly many questions related to QTP framework.Here i am going to share a article with you that how we can establish a QTP framework and what are the main things need to take care while creating a framework.

1. The automation process
The following sections describe in detail the process required to create automated scripts to regression test existing projects with maintenance releases.

1.1. Automation Workflow
The diagram above depicts the process in which existing applications require automation for regression testing.

1.1.1. Pre-requisites for QTP Automation Process
The following are pre-requisites or dependencies for QTP automation:
• Knowledge and hands-on experience with the use of QTP;
• Quality Centre (QC) and QTP installed and configured;
• QC and QTP are integrated;
• QTP Add-Ins are installed (if required);
• QC user groups are defined and granted access to Quality Centre projects;
• The application or product is in a stable state;
• Creation of new automated scripts requires existing manual test cases to have been executed successfully. This task is performed by the application tester or business representative and is performed prior to handover to QTP automation.
• The manual test cases must have been executed successfully and that there are no other changes in the application. Existing automated scripts can be updated directly to reflect the changes as part of maintenance releases.
• All test cases must start and end at the same point. This is normally the First screen of the application. This allows for test cases to be batched together into a test suite.
• All environment, software or data table changes must be advised to the automated testing team. There will potentially be an impact on the running of automated test cases with the introduction of these changes.
• The test cases must not be data dependant. All data required in the test case must be created in the test case. In the event that data cannot be created and the test case is data dependant, the data must be able to be restored, or manipulated back to the initial state after a test case updates the data. This then allows for any test case to be rerun at anytime


Existing manual test cases exist in QC in the standard format (see the QC user guide) and a copy of the test case to be automated are placed in the regression folder alongside any existing automated scripts.

2. QTP Functional Testing Methodology
Each Test case is built using a series of Quick Test Professional Functions. Each function executes Quick Test Professional code to input data onto a screen.
Each object in the Quick Test Professional Function resides in the Object Repository, thus allowing Quick Test Professional to identify all fields in the application.
• Each test case uses functions. Each function is either an applet on a screen or a whole screen depending on the amount of fields.
• Each function is named AUT_Screen Name e.g. MRS_Close_Application
• Every field/object on the screen or applet must be learnt into the object repository and renamed where required to a more meaningful screen name.
• Each function library must reside as .vbs file
• All functions are accessible via the step generator.

Function is placed into testcase via the step generator. The rc value is passed back to Quality Centre via the Reporter. ReportEvent rc command. Quality Centre accepts 0 for a pass, 1 for a fail and 2 as done. Always try to pass 1 or 0.


The testcase function call invokes the function as displayed above. This is the actual vbscipt that drives QTP. Each function uses a function template. Define in the function, the variables to uniquely identify the screen and any fields on the screen.

The function displayed above selects links via a parameter link_name. The links have been learnt into the object repository. Notice the browser, page and frame name are the same as what has been learnt into the object repository.
2.1. Initial Condition
Automated test scripts must begin from the same starting point. It is best practise to end all open browsers and start the Application under Test from the beginning. This ensures that all scripts can run back to back in an unattended batch mode.

2.2. Start Up Script
The start up script will copy all functions from the LAN and load them on the C Drive of the PC executing the test case. It will also build the infrastructure libraries if they don’t exist.
2.3. Test case Failure / Exception condition handling

All Quick Test Professional functions must use an exception handling framework. This allows any Quick Test Professional function to fail, report the failure and backout of the application.
The exception handling framework is built by:
An Environment Variable set in the Quick Test Professional startup_script set as ENVIRONMENT(EXCEPTION_COND)=”N”.

The MRS_Logon function sets the ENVIRONMENT(EXCEPTION_COND) to a value of “N”.
If any function has a failure by not finding the screen is should be on, or any known exception condition is triggered, the EXCEPTION_COND value is set to “Y”. The application is shutdown and all functions in that testcase flush. The next use of a MRS_Logon function will reset the EXCEPTION_COND to “N”.

The following diagram demonstrates the exception handling process:

3. Create Infrastructure
Infrastructure libraries are created to store QTP functions, utilities, documentation and object repository files
The Infrastructure libraries are created for each release of the software. Under each release folder (eg REL23) the folders below must exist, otherwise QTP will fail in the startup script.
Examples of the libraries for releases are as follows:
\\HCOPROD4\QSA\Group\QTP_MRS\REL23\Documentation
\\HCOPROD4\QSA\Group\QTP_MRS\REL23\Functions
\\HCOPROD4\QSA\Group\QTP_MRS\REL23\Repository
\\HCOPROD4\QSA\Group\QTP_MRS\REL23\Testcase
\\HCOPROD4\QSA\Group\QTP_MRS\REL23\Txtfiles
\\HCOPROD4\QSA\Group\QTP_MRS\REL23\Utilities

The following diagram displays the directory structure for the Rel23 libraries. They are as follows

:
3.1. Library Definitions for each Release
The application under test must have a QTP release specific directory, i.e. REL11, REL 12 and Sandpit
Each of the release directories hold release specific infrastructure code or release specific infrastructure objects that QTP requires in order to run the application under test. Therefore the REL11 functions folder will hold all functions that execute on the Rel11 application code and the REL12 functions folder will hold any new application screen functions and modified Rel11 functions.

3.2. Sandpit Libraries
Sandpit libraries are for use on the test automator’s pc to develop or modify QTP code. By saving in these libraries, data is not overwritten with the baseline code after a restart of QTP.
The sandpit libraries remain empty on the \\HCOPROD4\QSA drive. The sandpit library on the C drive is where changes can be made or new functions can be created. Once tested, they can be appended to the end of the Function or Utility VBS files on the \\HCOPROD4\QSA drive under the appropriate Release Folder.
The function and utility Sandpit libraries must contain a template function. If not, these libraries cannot be executed via an executefile command.

3.3. Documentation
The Documentation directory holds Word or Excel documents which reference the application.

4. Functions Library
The Functions Library contains QTP functions. These are based on one function per screen. This library is a sequential file of all the QTP functions for that application release. As more than one software release can be tested at any one time, the QTP function library can be concatenated in QTP with as many prior function libraries as required. The following shows a library concatenation of rel13, rel12 and rel11
Sandpit
FunctionABC
FunctionDEF
REL12
Function XYZ
REL11
Function 123
Function 346
FunctionABC

The above shows that Sandpit function FunctionABC would be a modified version of REL11 Function ABC and a new function functionDEF as the sandpit library would override the rel11 function library.
As each application release gets tested, only the new functions and functions that require modification are held in the Sandpit function library. All Functions that are not changed are still accessed via the concatenation of new and old release function libraries in the QTP Startup
The QTP startup script will copy all available Release folders to the C:Drive or D:Drive of each test machine.
At the end of each VBS file, an ENVIRONMENT library variable will be used to load other libraries if required.


4.1. Function Creation
When creating a new function, the following steps must be followed:
1. Learn Object Repository entries into the \\HCOPROD4\QSA drive Object Repository.
2. Rename Object Repository entries to meaningful names.
3. Create function by copying the template function into your sandpit/function library
4. Add the field names of the screen to the parameter list of the function.
5. Add the new Object Repository entry names into the function, as AP_webedit, AP_weblist, etc. This will allow the function to communicate to the object repository and play data into each field
6. Save the function and test change
7. Once satisfied that new function is ok, append it to the \\hcoprod4\qsa drive function library.

4.2. Object Repository
The Object Repository library holds all the application objects for the application under test. This library is not concatenated as only one Object Repository, with the same entries in it, can be opened at any time.
When creating a new release of the Object Repository, a “save as” must be done on the old Object Repository to the new release library. Any subsequent changes can then be done in the new Object Repository library.
When a QTP script is executed, a copy of the Object Repository is taken and saved to C:\Application\Release\Repository. This is done to ensure no corruption occurs on the master that is held on the \\HCOPROD4\QSA drive.
If changes are required, they must be done directly to the \\HCOPROD4\QSA drive copy of the object repository. This is because when merging two object repositories, QTP sees like defined objects as the same.
By learning new objects into the \\HCOPROD4\QSA drive Object Repository a rename on objects can be done and the Object Repository can be resaved onto the \\HCOPROD4\QSA drive. Ensure that a backup of the object repository is done first. If the Object Repository gets corrupted, then QTP will not run.
E.g. MRS uses \\HCOPROD4\QSA\Group\QTP_MRS\REL23\Repository\MRS.tsr .The Object Repository is copied from the \\HCOPROD4\QSA:\Group\QTP_MRS\REL23\Repository\MRS.tsr folder when the test case starts to C:\Group\QTP_MRS\REL23\Repository\MRS.tsr.

4.2.1. Object Repository Naming Standards
Any object placed into the Object Repository should be named according to the field name on a screen. As web GUI entries will be captured as the html programming name, rename this to an understandable name such as CustomerName or CustomerPhoneNumber. This will then mean the GUI entry is shown in functions and test scripts as something understandable. A GUI entry in the format F032fwfn is not acceptable.
Any GUI entries that are non web based must also have an understandable name.



4.3. Testcase Folder
This library holds reusable actions that we can use for data loading. i.e. creating a piece of data that we can reuse in the test script later. Any data that is created must be saved as an Environment variable.
This library also contains the startup script and template script.
4.4. Txtfiles Folder
This library holds files that are created at run time. This can also be used for transient data that is used between test scripts. This practice is not recommended as test cases should be data independant.
4.5. Utilities Folder
This library holds non specific functions that can be used in any test script. Functions may include reading and writing from files, button press, edit sets, list selects etc.

5. Build Automated Scripts
5.1. Manual Test Cases
Each Test Case must be written into Quality Centre. From Quality Centre, login to your project and select the test case. The Details tab of Quality Centre describes the tests Purpose, Test Conditions, Pre requisites, Dependencies, Environments and post-test Cleanups.
View your ‘manual’ steps by clicking on the tab, Design Steps. Ensure that manual Test Cases have been written and executed without error and are therefore verified as correct before automating.

Before any test case is automated it must pass the following criteria:

• Each script has been written so that each application screen in the test case flow is a new test step and each verification point is a new step.
• Test cases are stand alone, non data dependant, logon to the application under test at the start and logoff or shutdown the application at the end of each test case.
• All data requirements are defined in the details tab of Quality Centre.


5.2. Generate QTP Script
You can now convert this manual Test Case in to a Quick Test Professional script. To do this, click on the Generate Script button and select the QUICKTEST_TEST option.


Quality Centre has now generated Quick Test Professional code and has attached it to this manual Test Case. This can be viewed by clicking on the tab Test Script. This generated code is nothing more than a series of comments and reporter events. The Quality Centre manual Test Case has been copied in to Quick Test Professional and each step has been placed in as comments.


5.3. Generated QTP Script
After generating a Quick Test Professional script from Quality Centre all the Step details are placed into comments in the Quick Test Professional script

5.4. Test Settings and Options
Each new script requires test settings, record and run settings, associate repositories and options to be set.
5.4.1. Test Settings
Click on File and select Settings. Click on Run tab. Ensure that ‘Run on all rows’ is selected. At field: When error occurs during run session: select ‘proceed to next step’.
Ensure that the two tick boxes are also ticked.


Click on Resources tab. Click on ‘+’ to add resource library and utilities. Ensure that functions are associated to local C:\ or D:\ and that sandpit libraries are listed first.


5.4.2. Record and Run Settings
Select Automation, then Record and Run Settings.
When using a Windows based application, set as per example below:


5.4.3. Associate Repositories
In QTP, click on Resources and then select Associate Repositories. Click on ‘+’ to create repository association. Click on ‘>’ to associate ‘Action1’.


5.4.4. Options
Click on Tools, select Options. Click on Run tab. Ensure Run Mode is set to ‘Normal’. As displayed in diagram above, ensure the following are ticked:
- View results when run session ends
- Allow other Mercury products to run tests and components
- Save still image captures to results. Select ‘For errors’ from drop list


5.5. Step Generator
All Quick Test Professional functions are written and stored in Libraries and are added to the Step Generator (F7) in Quick Test Professional.
To access these functions, click on Insert, then Select Step Generator or press F7 from within QTP.
The functions have been sorted alphabetically to make it easier to find the function that matches your Application screen. Once you have found the function that will perform the functionality matching the Application screen, you can fill in the value column with appropriate arguments that will be set to the function.
Every parameter must have an argument value specified. The return value box needs to be ticked each time a new function call is set. Insert another step to be ticked as required.
When creating a function you must enter data into every field of the function to verify it can run the function correctly.


The return value (rc = return code) stores whether the function has passed or failed. The rc is then passed to the report and decides whether the particular step has passed or failed.



5.6. Editing QTP Scripts
Now edit and build the Automated Test Script via Quick Test Professional. To make the script workable, we begin adding in to the Test Script the functions or Test conditions that will perform the automated tests, thus building up a test scenario. The idea here is to match the manual Test Case steps to the appropriate Quick Test Professional Function.

Each test case should have one or more Quick Test Professional functions per step. This function will relate to each screen of the tested application, as per the Automated Functional Testing Methodology.

The Automated Functional Testing Methodology gives the advantage of modular programming; it enables an easy and fast way to create reusable test cases. Other advantages of this methodology are, ease of maintenance of scripts and ability to run scripts in any environment due to no data dependencies.

Ensure that you add the following text at the top of the Quick Test Professional script to identify who has written the script and when:

E.g. “# Revision History: KH Initial Version 10/03/08 MRS version 2.2.3”



You are now ready to edit/create the Automated Test Script. To do this, start up Quick Test Professional and access the test script that was created in Quality Centre via the Open command. There are two areas where Test Scripts can reside. They can reside within Quality Centre or in the File System (PC or Network folders).

If we have created the Test Script via Quality Centre then the script will reside with in Quality Centre. Just follow the same path you used when accessing the Manual Test Script, to find the Automated Test Script.


5.7. QTP Add-Ins
When Quick Test Professional scripts are created from Quality Centre, Quality Centre sets the script default addin setting to blank.

Once you have started up the Quick Test Professional script you have to add all the Add-ins for the application under test. To do this, go to File / Test Properties… and click on the Add-ins tab. From here you can select all the add-ins that will be needed by clicking on appropriate items then pressing Enter.
If this is not done, Quick Test Professional will be forced to shutdown and the script will not run at all, due to Webtest commands being executed in the functions while the WebTest addins have not been started when Quick Test Professional is invoked.


Alternatively, any add-ins can be selected during opening QTP application.

5.8. QTP Template Script
Each test case will use a template script at the start. This script will copy all functions from the LAN and load them on the C Drive of the PC executing the test case. It will also build the infrastructure libraries if they don’t exist.
It will then execute a function.vbs file so at run time these functions will override the function library associated at build time.
The template script will be administered by QSA.
The location of the template is:
\\hcoprod4\Group\ QTP_MRS\REL23\Testcase\ActionTemplate.mst
The PC that will be running the automated scripts will reference the abovementioned Action template. A copy of this template is placed in C:\Program Files\Mercury Interactive\QuickTest Professional\dat


5.9. Completed Testcase
Each test case should have one or more QTP functions per step. The function should pass a return code back to the test case, therefore allowing QTP to pass Quality Centre the step status.
At the start of each test case, pre required data can be added. Most pre required data for MRS can be created using a test case that uses variables, e.g. first name and surname. A global variable is created which can be addressed anywhere else in the test case.
Any pre required data scripts exist in QTP_MRS/Rel23/Testcases. These testcases are reusable actions. The line RunAction denotes a called action.
The tester should ensure they have a good understanding of what is available. If new data scripts are required, it is best to model them off existing scripts.
A test case will appear as per the following example:


6. QTP – Connection to Quality Centre
6.1. Connection
Server Connection
From Quick Test Professional, select Tools; Quality Centre Connection and on the Quality Centre Connection page enter the following:
Server url: http://postapps/qcbin Click on button Connect
E.g. Project Connection
Domain: PROJECTQC
Project: MRS
User Name: QC_MRS
Password: Click on button Connect
Other
Reconnect at startup: check this box.
Save password for reconnection on startup: check this box.


7. Maintenance Approach
To ensure that release changes of software can be accommodated by QTP, some tasks must be completed before running any tests.
7.1. Regression Test Changes
When a new release of software causes old functions to perform incorrectly, changes need to be done to these functions and object repositories to allow for testing to continue. These changes may be due to a new screen, a screen change or an object being seen differently in QTP, e.g. a change in a button name.
7.2. New Infrastructure
When building a new release of QTP Infrastructure, the first thing to do is build the infrastructure libraries as documented previously. This will give you the ability to make release dependant changes to old functions, scripts and Object Repositories in the new libraries.
Copy the QC folder within the project to a new version. This will allow for test cases changes in the new version of the QC folder and also keep the old QC folder as is. This will allow for easier reporting of the testing effort in the new release.
7.2.1. Building a new QTP Environment
As each new release of software is placed into an application testing environment, the QTP environment will need to be updated to allow for new functions, and the ability to run regression tests against the old software. The following tasks need to be performed to build the environment:
• The release specific infrastructure libraries must be created for the new release, as documented earlier in Section 4.
• The Object Repository for the current release must be “saved as” into the new release Repository folder
• The Function Library requires just a comment in it, so it does not appear as an empty file.
• The C:\TEMP\QTP_Start_Up.vbs file must be modified with the correct version of the application you wish to test with. Depending on the Release or Project, this is to be updated accordingly.
Once this is completed, restart QTP and ensure you are able to run a script through to completion. Any function changes can then be done by copying the function from the previous release’s function library and placing it into the new function library. From this new function library, you are then able to make the appropriate changes.
The following steps outline the build for new environment:
1. Open Windows explorer.
2. On network \\hcoprod4\qsa, open QTP_MRS folder
3. Create new folder e.g. REL31 and then create folders as per previous release:
- Documentation (to be empty)
- Functions (to contain blank function.vbs file)
- Repository (to contain empty repository file)
- Testcase (Copy Startup and QTP Startup from previous release)
- Txtfiles (to be empty)
- Utilities (to contain blank utilities.vbs)
4. Highlight the Testcase folder.
- Open up QTP Startup.vbs. Update release number in path
- Open up Startup.vbs. Update Dim Release +1 (2) and Add Release (2)
- Add Revision comments. Updates to be made in new function.vbs.

Monday, October 10, 2011

Dictionary Object


Scripts often retrieve information from an outside source, such as a text file or a Database. After this information has been retrieved, it needs to be stored in Memory so that the script can act upon it. Information such as this can be stored Dictionary object.

The Dictionary object functions stores values in key-item pairs. The Dictionary object is similar to a Collection object .Like an array or a Collection object, Dictionary object holds elements, called items or members, containing data. A Dictionary object can contain any data whatsoever, including objects and other Dictionary objects. Access the value of these dictionary items by using unique keys (or named values) that are stored along with the data. Dictionary is a COM object.
Creating Dictionary
Set oDictionary = CreateObject("Scripting.Dictionary")
Adding Key-Item Pairs to a Dictionary
Set oDictionary = CreateObject("Scripting.Dictionary")
oDictionary.Add "Fax", "Faxing"
Here the Key is Fax and Key Value is Faxing

Descriptive Programming:QTP


As I described earlier that how QTP identifies test objects during execution.

The answer is simple that during run time it recognize the test object by referring to its object repository ,where we already have stored test object earlier(before creating any test we must make QTP to learn all the test required test object and store it in object repository).

Now the Question is the application is not ready then there is no test object available, then how QTP will learn the test objects and what will we store in the object repository??

Now answer may be the one of the following or all
    1)    It is impossible to automate any application which is not ready.
    2)    QTP cannot work without Object repository.
    3)  What QTP will learn and where will it store.

But all of the above answers are totally wrong J

There is concept/technique which is known as Descriptive Programming is the solution for those.
If we are using object repository then during the run session, QTP finds the object in the object repository based on its name and parent objects, and uses the stored test object description for that test object to identify the object in the application.
We can also instruct QTP to perform operations on objects without referring to the object repository or to the object's name. To do this, we provide QTP with a list of properties and values that QTP can use to identify the object or objects on which we want to perform an operation. This technique is known as Descriptive Programming (inserting programming descriptions).
There are two types of programmatic descriptions:
<!Static. List the set of properties and values that describe the object directly in a VBScript statement
       Synatx:  Testobj(“Propname1:=PropVal1” , “Propname2:=PropVal2”)
              TestObject. The test object class.
            PropertyName:=PropertyValue. The identification property and its value.
            Each   property:=value pair should be separated by commas and quotation marks

Example :
  Browser("Title:=Mercury Tours").Page("Title:=Mercury Tours").WebEdit("Name:=Author",   "Index:=3").Set "Alok"
2) Dynamic.  Add a collection of properties and values to a Description object, and then enter the Description object name in the statement.
The Dynamic type provides more power, efficiency, and flexibility.
We can use the Description object to return a Properties collection object containing a set of Property objects. A Property object consists of a property name and value. We can then specify the returned Properties collection in place of an object name in a statement. (Each property object contains a property name and value pair.)
To create the Properties collection, you enter a Description. Create statement using the following syntax:
Set MyDescription = Description.Create()
Example:
Set Objbtn = Description.Create()
Objbtn(“value”).Value =  Google Search”
Objbtn(“type”).Value = “submit”
Browser(“Google”).Page(“Google”).WebButton(Objbtn).Click
Note: For getting the object properties and their values respectively please refer the Object Spy section described in earlier posts http://expertqtp.blogspot.com/2011/05/object-spy-in-qtp.html




Wednesday, October 5, 2011

QTP: Recovery scenarios in QTP

Recovery Scenarios
Unexpected events during a test run disrupt a test or may give invalid test results. For example, during a test run, an application error may occur. This error does not permit the automated test to navigate to the feature, screen, or module that needs to be tested. These unexpected errors and events are called exceptions.
Recovery scenarios are used when you cannot predict at what step the error can occur .
When QTP encounters an exception during a run session, it displays a run error window.
A recovery Scenario consists of the following components:
Trigger: Specifies the exception that may occur during a run session.
The following are the 4 trigger event that QTP provides.
1.Pop up window
2.Object state
3. Test run error
4.Application crash
Recovery: Instructs QTP how to handle the exception
Post-Recovery: Instruct QTP how to proceed after the recovery operations are performed.
The following are the 6 Post-Recovery steps that QTP provides
1) Repeat current step and continue
2) Proceed to next step
3) Process to next action or component iteration
4) Proceed to next test iteration.
5) Restart current test run.
6) Stop the test run.

Tuesday, October 4, 2011

QTP Interview Questions:QTP

Hi Friends the few are some questions which are related to QTP interview ,which may be useful.

QTP Interview Questions -1

1) What are the advantages in Test Automation?

a)  Fast: Test Tool runs tests significantly faster than human users.

b) Reliable: Automation tool can perform the same operation each time, if we repeated multiple times, so that we can eliminate human errors.

c)  Repeatable: We can check how application or website reacts after repeated the same operation with multiple times.

d) Reusable: Automation scripts are reusable on different version of the application of websites even if the user interfaces changes.

e)  Comprehensive: In automation testing we can build a suit of tests that covers every feature in the application or website.

f)  Programmable: We can program sophisticated Tests that bring out hidden information from the application

2) What are the drawbacks in Test Automation?
a) It is expensive
b) We cannot automate all areas.
c) Lack of Skill
d) It has some limitations (It cannot test every thing)

3) What type of test tools available in the industry?

We can segregate Test tools in 2 categories

a) Business Classification

     1) Vendor Tools
     2) Open Source Tools
     3) In-house Tools


b) Technical Classification
    
     1) Functional and Regression Test Tools
     2) Load/Stress/Performance Test Tools
     3) Security Test Tools
     5) Test Management Tools
     6) Unit Test Tools
     7) Requirement Management Tools Etc...


4) What are the important factors in test tool selection?

a. Technical factors:

i. Nature of the AUT (Application Under Test)
ii. Tool Features (Facilities available)
iii. Availability of Skilled professionals
iv. Organizations experience
v. Technical support from vendor

b. Business factors:

i. Budget
ii. Vendor’s Reputation
iii. Client’s Interest

5) What test cases can be automated?

Test cases that we want to execute on number of versions of the software
Ex: Regression test cases
Test cases that we want to execute with multiple sets of data
Ex: Data driven test cases
Test cases having complex functionality

6) What test cases cannot be automated?

o Dynamically changing functionality
o Test cases that require more Human interaction
o CUI (command user interface) based test cases

7) Explain about the Testing process in QTP?
Planning:
o Analyzing the Application
o Automation Framework Implementation
o Selecting/Generating Test cases for Automation
o Collecting Test Data
o Configuring Tool Settings
Generating the basic tests
Using Object Repository method or using Descriptive Programming, we can generate Tests
Enhancing Tests
With respect to our project requirements, we have to enhance our tests. For enhancing tests QTP is providing various features like:
o Inserting Transaction points
o Synchronization
o Parameterization
o Inserting VB script Flow Control statements
o Adding comments
o Calling Functions/ calling Actions
o Using Environment variables
o Entering Regular Expressions
o Inserting Checkpoints
o Inserting Output values
Etc..
Note: For any Test all enhancement methods not required.

Debugging Tests (if required)
It is optional; basically scripting languages are Light weight languages, no need to compile them separately. During execution Scripts can be compiled and Run.
If we have any doubts about some scripts, then we can execute them step by step with the support of VBScript Debug commands and Break points

Running tests
Generally, many companies are using Framework feature for Running Tests.
QTP Supports Individual Test execution, Batch execution, Tests execution through AOM Scripting, and Scheduled execution with the support of Windows Operating system.

Analyzing Results
It is not the Responsibility of QTP; Test engineer has to do this manually.
QTP is providing Result window in XML format.
QTP is providing Result deletion tool also.
QTP is providing Test results exporting facility. It supports HTML, Word document and PDF (portable document format) formats.

Reporting defects
Reporting defects also not a QTP responsibility that we have to do manually after analyzing the results, but if we are using Quality Center, from QTP result window we can send defects directly.

8) What types of License available for QTP?

a) Seat License or Node locked

Fixed for one System (Machine), we can use from that System only

b) Concurrent License or Floating License

This License, we can use from different Systems but one at a time

9) What are the QTP supported environments?

QTP Supports Software Applications based on Add-ins only

Add-in means Technology supporting files

QTP Add ins available for following technologies:

a) Default Add ins

1) Activex
2) Visual Basic
3)  Web

b) Other Add-ins
1) Delphi
2) Java
3) .NET Web forms
4) .NET Windows forms
5) WPF (Windows Presentation Foundation)
6) Oracle
7) People Soft
8) Power Builder
9) SAP for Web
10) SAP GUI for windows environment
11) Siebel Environment
12) Standard Windows
13) Terminal Emulator (TE)
14) Visual Age Smalltalk Environment
15) Web Services Environment

10) Does QTP Support UNIX Environment?

No, QTP doesn’t support UNIX/Linux Environment, Supports Windows Operating Environment only, but LoadRunner and Quality Center have support both Windows and UNIX Operating Environments.

11) What is the scripting language that used in QTP for applying programming logic?

Micro Soft Visual Basic Scripting edition (VBScript) engine embedded with QTP.

12) Does QTP Support Database Testing and Data driven Testing?

Yes, SQL Engine embedded with QTP Tool, so we use SQL Statements directly in QTP Test Pane as well as in Function Library.

QTP has an integrated Spread sheet(Excel like) for Performing Data Driven Testing, otherwise we can fetch test data directly from  external files and databases using VB Script.

QTP Interview Questions -2

1) What is Recording in QTP?
It is process of creating the main body of a test by recording the typical processes that users perform.

QuickTest records the operations we perform, displays them as steps in the Keyword View, and generates them in a script (in the Expert View).
2) How many Recording Modes available in QTP? What are they?


There are 3 Recording modes available in QTP.
     1) Normal Recording
     2) Analog Recording
     3) Low Level Recording


3) What is Analog Recording mode?

It Records exact mouse and keyboard operations, we can use this mode for recording continues mouse operations like digital signatures, paints etc..

This mode doesn't generate statements for each and every operation, generates all operations in a Track file.


By default this mode is disabled, after selecting Normal Recording mode only it enables.


4) What is Low Level Recording?


It Records some operations on Non-supported environments apart from Normal operations.


5) What are object and Software Objects?

Object: Object is something, which has structure and properties.

Software Object: an object is any entity that can be manipulated by the commands of a programming language, such as a value, variable, function, or data structure.

Example:

GUI (Windows) Environment: Window, Dialog box, Edit Box, Button, Check Box, Radio Button, List Box and Combo Box etc...

Web Environment: Browser, Page, Link, Image, edit Box, Button, Grid, Frame Etc..


6) What type of Objects available in QTP?

There are 4 types of Objects available in QTP.

     1) Run-time Objects
     2) Test Objects
     3) Utility Objects
     4) Automation / User Defined Objects


7) What are Utility Objects?

These are QTP reserved objects, used for Testing and Result reporting.

Example:

a) SystemUtil
b) Reporter
c) DataTable
d) Services
e) environment etc...


8) What is Automation Object?

An object that is exposed to other applications or programming tools through Automation interfaces.


9) Explain about Object, Property and value?

Object:  It is something which has structure and properties


Property: an attribute of an Object.

Value: Value of the Property


10) What is Object Repository?

It is a Storage place for Storing Objects, QTP has 2 types of Repositories.

  a) Local Repository
  b) Shared Repository


11) What are the differences between Local  and Shared Repositories?

Local Repository:

QTP Creates a Local Repository for every Action during Recording automatically and also QTP maintenance Local Repositories, but user can edit these repositories.

It is a QTP Internal file, extension is .mtr
 
Shared Repository:

User  Creates Shared Repositories by adding objects in Object Repository Manager.This can be shared among nuber of tests.

User has to maintain shared repository files

Shared Repository files are External files, extension is .tsr 


12)  How to Start Test Automation Process, before the Application is ready?

QTP is providing a feature called "Define New Test Object" for creating new objects without Application. This feature available in Local Repository and Object Repository Manager.


13) How to Combine Repositories?

We Can combine Repositories using Object Repository Merge Tool. It is available in Object Repository Manager


14) Explain about Statement, Action and Test in QTP?
   
      a) Statement: an Instruction or a minimal executable unit
      b) Action: Set of Statements
      c) Test: One or more Actions


15) How Load repository files During run-time?


We can Load Object Repositories during run-time using an Utility object called "RepositoriesCollection"

Syntax:
RepositoriesCollection.Add  "path of the Repository file"

Example:

RepositoriesCollection.Add  "D:\ALOK\Login.tsr"