What is QTP ?
A) QuickTest is a graphical interface record-playback automation tool. It is able to work with any web, java or windows client application. Quick Test enables you to test standard web objects and ActiveX controls. In addition to these environments, QuickTest Professional also enables you to test Java applets and applications and multimedia objects on Applications as well as standard Windows applications, Visual Basic 6 applications and .NET framework applications…
What are The Advantages and Disadvantages of Software Test Automation
Advantages of Test Automation
Fast
As manual testing consumes a great deal of time in both the process of software development as well as during the software application testing, automated tools are a faster option as long as the scripts which need to be done are standard and non complex.
Reliability
Automation of test script execution eliminates the possibility of human error when the same sequence of actions is repeated again and again. Remember this can be really important as you would be astonished to learn just how many test defects raised are in fact caused by tester error. This particularly happens when the same boring test scripts have to be run over and over again as well as when, at the opposite spectrum, really complex testing has to be done.
Comprehensive
Automated testers might contain a suite of tests that would help in testing each and every feature in the application. This means that chance of missing out key parts of testing is unlikely to occur. You might think this is unlikely to happen in reality, but I have managed a project where in fact a key part of functionality was overlooked by the test team.
Reusability
The test cases can be used in various versions of the software. Not only will your project management stakeholders be very grateful for the reduced project time and cost, but it will certainly help you when estimating project costs.
Programmable
One can program the test automation software to pull out elements of the software developed which otherwise may not have been uncovered. Hence this should make your testing even more thorough, something you may not be so keen on when defect after defect is raised as a result!
Disadvantages of Test Automation
It’s Not Easy!
Writing test automation scripts is not an easy task. You really need testers who are experienced in doing this otherwise it will go horribly wrong and you will end up spending even more money and time than if done manually. So bear this in mind when you are doing your project management resource allocation that you get the right testers on your project.
Automation Script Errors
If an error is made in the test automation scripts which is undetected, it could be fatal for the project since the correct testing won’t have been done. In fact you may not even realize the error until the software launches and then falls over.
Scope Changes
Every project will have to implement change request management. However despite best endeavours there will still be some which get through. The problem with this is that it may require the test automation scripts to be reprogrammed or redesigned. This may be the case even when there is a minor change in the user interface of the software.
Complexity
With the increase in the number of requirements (business requirements documentation and software requirements specification) that are to be tested, this leads to more and more complexity which makes the maintenance of test data extremely difficult.
Explain QTP Testing process ?
A) Create your test plan - Prior to automating there should be a detailed description of the test including the exact steps to follow, data to be input, and all items to be verified by the test. The verification information should include both data validations and existence or state verifications of objects in the application.
Recording a session on your application - As you navigate through your application, Quick Test graphically displays each step you perform in the form of a collapsible icon-based test tree. A step is any user action that causes or makes a change in your site, such as clicking a link or image, or entering data in a form.
Enhancing your test - Inserting checkpoints into your test lets you search for a specific value of a page, object or text string, which helps you identify whether or not your application is functioning correctly. NOTE: Checkpoints can be added to a test as you record it or after the fact via the Active Screen. It is much easier and faster to add the checkpoints during the recording process. Broadening the scope of your test by replacing fixed values with parameters lets you check how your application performs the same operations with multiple sets of data. Adding logic and conditional statements to your test enables you to add sophisticated checks to your test.
Debugging your test - If changes were made to the script, you need to debug it to check that it operates smoothly and without interruption.
Running your test on a new version of your application - You run a test to check the behavior of your application. While running, Quick Test connects to your application and performs each step in your test.
Analyzing the test results - You examine the test results to pinpoint defects in your application.
Reporting defects - As you encounter failures in the application when analyzing test results, you will create defect reports in Defect Reporting Tool.
How Does Run time data (Parameterization) is handled in QTP?
A) 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.
What is keyword view and Expert view in QTP?
A) QuickTest’s Keyword Driven approach, test automation experts have full access to the underlying test and object propertyes, via an integrated scripting and debugging environment that is round-trip synchronized with the Keyword View.Advanced testers can view and edit their tests in the Expert View, which reveals the underlying industry-standard VBScript that QuickTest Professional automatically generates. Any changes made in the Expert View are automatically synchronized with the Keyword View.
Explain about the Test Fusion Report of QTP ?
A) Once a tester has run a test, a TestFusion 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 TestFusion reports with QuickTest Professional, you can share reports across an entire QA and development team.
To which environments does QTP supports ?
A) QuickTest Professional supports functional testing of all enterprise environments, including Windows, Web, ..NET, Java/J2EE, SAP, Siebel, Oracle, PeopleSoft, Visual Basic, ActiveX, mainframe terminal emulators, and Web services.
Benefits of Test Automation Framework Approach:
Test Automation Framework built with systematic approach yields following benefits:
# Ensures consistency
# Significant reduction in the amount of code to develop & maintain thereby reducing the testing cycle time.
# Comprehensive coverage against requirements.
# Use of a "Common Standard" across the organization / Product team / Project team
# Maximizes reusability of test scripts ( Utility Functions)
# Provides a structured for test library having systematic maintenance of automation scripts
# Data Pooling
# Protects non-technical testers from the code
What are various types of properties when using object identification in QTP?
QTP uses three types of properties when identifying a object
1. Mandatory Properties - Always learn these properties for the object
2. Assistive Properties - Learn in case Mandatory properties are not enough to identify the object uniquely
3. Ordinal identifiers - Learn in case both mandatory and assistive properties are not able to recognize the objects correctly
How QTP recognizes Objects in AUT?
A) QuickTest stores the definitions for application objects in a file called the Object Repository. As you record your test, QuickTest will add an entry for each item you interact with. Each Object Repository entry will be identified by a logical name (determined automatically by QuickTest), and will contain a set of properties (type, name, etc) that uniquely identify each object. Each line in the QuickTest script will contain a reference to the object that you interacted with, a call to the appropriate method (set, click, check) and any parameters for that method (such as the value for a call to the set method). The references to objects in the script will all be identified by the logical name, rather than any physical, descriptive properties.
What are the types of Object Repositorys in QTP?
A) QuickTest has two types of object repositories for storing object information: shared object repositories and action object repositories. You can choose which type of object repository you want to use as the default type for new tests, and you can change the default as necessary for each new test. The object repository per-action mode is the default setting. In this mode, QuickTest automatically creates an object repository file for each action in your test so that you can create and run tests without creating, choosing, or modifying object repository files. However, if you do modify values in an action object repository, your changes do not have any effect on other actions. Therefore, if the same test object exists in more than one action and you modify an object’s property values in one action, you may need to make the same change in every action (and any test) containing the object.
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 Accessiblity 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
In how many ways we can add check points to an application using QTP.
A)We can add checkpoints while recording the application or we can add after recording is completed using Active screen (Note : To perform the second one The Active screen must be enabled while recording).
How does QTP identifes the object in the application
A)QTP identifies the object in the application by LogicalName and Class. For example : The Edit box is identified by Logical Name : PSOPTIONS_BSE_TIME20Class: WebEdit
If an application name is changes frequently i.e while recording it has name “Window1” and then while running its “Windows2” in this case how does QTP handles?
A) QTP handles those situations using “Regular Expressions”.
What is Parameterizing Tests?
A) When you test your application, you may want to check how it performs the same operations with multiple sets of data. For example, suppose you want to check how your application responds to ten separate sets of data. You could record ten separate tests, each with its own set of data. Alternatively, you can create a parameterized test that runs ten times: each time the test runs, it uses a different set of data.
What is test object model in QTP ?
A) The test object model is a large set of object types or classes that QuickTest 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 ofrelevant methods that QuickTest can record for it.A test object is an object that QuickTest creates in the test or component to represent the actual object in your application. QuickTest stores information about the object that will help it identify and check the object during the run session.A run-time object is the actual object in your Web site or application onwhich methods are performed during the run session.When you perform an operation on your application while recording,QuickTest:➤ identifies the QuickTest test object class that represents the object on whichyou performed the operation and creates the appropriate test object➤ reads the current value of the object’s properties in your application andstores the list of properties and values with the test object➤ chooses a unique name for the object, generally using the value of one of itsprominent properties➤ records the operation that you performed on the object using the appropriate QuickTest test object methodFor example, suppose you click on a Find button with the following HTMLsource code:QuickTest identifies the object that you clicked as a WebButton test object.It creates a WebButton object with the name Find, and records the followingproperties and values for the Find WebButton:It also records that you performed a Click method on the WebButton.QuickTest displays your step in the Keyword View like this:QuickTest displays your step in the Expert View like this:Browser(“Mercury Interactive”).Page(“Mercury Interactive”).WebButton(“Find”).Click
What is Object Spy in QTP?
A) Using the Object Spy, you can view the properties of any object in an openapplication. You use the Object Spy pointer to point to an object. The ObjectSpy displays the selected object’s hierarchy tree and its properties and valuesin the Properties tab of the Object Spy dialog box.
What is the Diff between Image check-point and Bit map Check point?
A) Image checkpoints enable you to check the properties of a Web image. You can check an area of a Web page or application as a bitmap. While creating a test or component, you specify the area you want to check by selecting an object. You can check an entire object or any area within an object. QuickTest captures the specified object as a bitmap, and inserts a checkpoint in the test or component. You can also choose to save only the selected area of the object with your test or component in order to save disk Space For example, suppose you have a Web site that can display a map of a city the user specifies. The map has control keys for zooming. You can record the new map that is displayed after one click on the control key that zooms inthe map. Using the bitmap checkpoint, you can check that the map zooms in correctly.You can create bitmap checkpoints for all supported testing environments(as long as the appropriate add-ins are loaded).Note: The results of bitmap checkpoints may be affected by factors such asoperating system, screen resolution, and color settings.
How many ways we can parameterize data in QTP ?
A) There are four types of parameters:Test, action or component parameters enable you to use values passedfrom your test or component, or values from other actions in your test. Data Table parameters enable you to create a data-driven test (or action)that runs several times using the data you supply. In each repetition, oriteration, QuickTest uses a different value from the Data Table. Environment variable parameters enable you to use variable values fromother sources during the run session. These may be values you supply, orvalues that QuickTest generates for you based on conditions and optionsyou choose. Random number parameters enable you to insert random numbers asvalues in your test or component. For example, to check how yourapplication handles small and large ticket orders, you can have QuickTestgenerate a random number and insert it in a number of tickets edit field.
How do u do batch testing in WR & is it possible to do in QTP, if so explain?
Ans: Batch Testing in WR is nothing but running the whole test set by selecting “Run Testset” from the “Execution Grid”.The same is possible with QTP also. If our test cases are automated then by selecting “Run Testset” all the test scripts can be executed. In this process the Scripts get executed one by one by keeping all the remaining scripts in “Waiting” mode.
If i give some thousand tests to execute in 2 days what do u do?
Ans : Adhoc testing is done. It Covers the least basic functionalities to verify that the system is working fine.
What does it mean when a check point is in red color? what do u do?
Ans : A red color indicates failure. Here we analyze the the cause for failure whether it is a Script Issue or Envronment Issue or a Application issue.
How do u do batch testing in WR & is it possible to do in QTP, if so explain?
Ans : You can use Test Batch Runner to run several tests in succession. The results for each test are stored in their default location. Using Test Batch Runner, you can set up a list of tests and save the list as an .mtb file, so that you can easily run the same batch of tests again, at another time. You can also choose to include or exclude a test in your batch list from running during a batch run
What does it mean when a check point is in red color? what do u do?
Ans : A red color indicates failure. Here we analyze the the cause for failure whether it is a Script Issue or Envronment Issue or a Application issue.
How to Import data from a “.xls” file to Data table during Runtime.
Ans : Datatable.Import “…XLS file name…” DataTable.ImportSheet(FileName, SheetSource, SheetDest) DataTable.ImportSheet “C:\name.xls” ,1 ,”name”
How to export data present in Datatable to an “.xls” file?
Ans : DataTable.Export “….xls file name…”
3 differences between QTP & Winrunner?
Ans :
(a) QTP is object bases Scripting ( VBS) where Winrunner is TSL (C based) Scripting. (b) QTP supports “.NET” application Automation not available in Winrunner (c) QTP has “Active Screen” support which captures the application, not available in WR.
(d) QTP has “Data Table” to store script values , variables which WR does not have. (e) Using a “point and click” capability you can easily interface with objects, their definitions and create checkpoints after having recorded a script – without having to navigate back to that location in your application like you have to with WinRunner. This greatly speeds up script development.
How to create a Runtime property for an object?
How to add a runtime parameter to a datasheet?
Ans: DataTable.LocalSheet
The following example uses the LocalSheet property to return the local sheet of the run-time Data Table in order to add a parameter (column) to it. MyParam=DataTable.LocalSheet.AddParameter(“Time”, “5:45″)
Analyzing the Checpoint results
A)Standard Checpoint :By adding standard checkpoints to your tests or components, you can compare the expected values of object properties to the object’s current values during a run session. If the results do not match, the checkpoint fails.
Table and DB Checkpoints:
By adding table checkpoints to your tests or components, you can check that a specified value is displayed in a cell in a table on your application. By adding database checkpoints to your tests or components, you can check the contents of databases accessed by your application. The results displayed for table and database checkpoints are similar. When you run your test or component, QuickTest compares the expected results of the checkpoint to the actual results of the run session. If the results do not match, the checkpoint fails. You can check that a specified value is displayed in a cell in a table by adding a table checkpoint to your test or component. For ActiveX tables, you can also check the properties of the table object. To add a table checkpoint, you use the Checkpoint Properties dialog box. Table checkpoints are supported for Web and ActiveX applications, as well as for a variety of external add-in environments. You can use database checkpoints in your test or component to check databases accessed by your Web site or application and to detect defects. You define a query on your database, and then you create a database checkpoint that checks the results of the query. Database checkpoints are supported for all environments supported by QuickTest, by default, as well as for a variety of external add-in environments. There are two ways to define a database query: (a) Use Microsoft Query. You can install Microsoft Query from the custom installation of Microsoft Office. (b) Manually define an SQL statement. The Checkpoint timeout option is available only when creating a table checkpoint. It is not available when creating a database checkpoint
Checking Bitmaps:
You can check an area of a Web page or application as a bitmap. While creating a test or component, you specify the area you want to check by selecting an object. You can check an entire object or any area within an object. QuickTest captures the specified object as a bitmap, and inserts a checkpoint in the test or component. You can also choose to save only the selected area of the object with your test or component in order to save disk space. When you run the test or component, QuickTest compares the object or selected area of the object currently displayed on the Web page or application with the bitmap stored when the test or component was recorded. If there are differences, QuickTest captures a bitmap of the actual object and displays it with the expected bitmap in the details portion of the Test Results window. By comparing the two bitmaps (expected and actual), you can identify the nature of the discrepancy. For more information on test results of a checkpoint, see Viewing Checkpoint Results. For example, suppose you have a Web site that can display a map of a city the user specifies. The map has control keys for zooming. You can record the new map that is displayed after one click on the control key that zooms in the map. Using the bitmap checkpoint, you can check that the map zooms in correctly. You can create bitmap checkpoints for all supported testing environments (as long as the appropriate add-ins are loaded). Note: The results of bitmap checkpoints may be affected by factors such as operating system, screen resolution, and color settings.
Text/Text Area Checkpoint :
In the Text/Text Area Checkpoint Properties dialog box, you can specify the text to be checked as well as which text is displayed before and after the checked text. These configuration options are particularly helpful when the text string you want to check appears several times or when it could change in a predictable way during run sessions. Note: In Windows-based environments, if there is more than one line of text selected, the Checkpoint Summary pane displays [complex value] instead of the selected text string. You can then click Configure to view and manipulate the actual selected text for the checkpoint. QuickTest automatically displays the Checked Text in red and the text before and after the Checked Text in blue. For text area checkpoints, only the text string captured from the defined area is displayed (Text Before and Text After are not displayed). To designate parts of the captured string as Checked Text and other parts as Text Before and Text After, click the Configure button. The Configure Text Selection dialog box opens Checking XML : XML (Extensible Markup Language) is a meta-markup language for text documents that is endorsed as a standard by the W3C. XML makes the complex data structures portable between different computer environments/operating systems and programming languages, facilitating the sharing of data. XML files contain text with simple tags that describe the data within an XML document. These tags describe the data content, but not the presentation of the data. Applications that display an XML document or file use either Cascading Style Sheets (CSS) or XSL Formatting Objects (XSL-FO) to present the data. You can verify the data content of XML files by inserting XML checkpoints. A few common uses of XML checkpoints are described below: An XML file can be a static data file that is accessed in order to retrieve commonly used data for which a quick response time is needed—for example, country names, zip codes, or area codes. Although this data can change over time, it is normally quite static. You can use an XML file checkpoint to validate that the data has not changed from one application release to another. An XML file can consist of elements with attributes and values (character data). There is a parent and child relationship between the elements, and elements can have attributes associated with them. If any part of this structure (including data) changes, your application’s ability to process the XML file may be affected. Using an XML checkpoint, you can check the content of an element to make sure that its tags, attributes, and values have not changed. XML files are often an intermediary that retrieves dynamically changing data from one system. The data is then accessed by another system using Document Type Definitions (DTD), enabling the accessing system to read and display the information in the file. You can use an XML checkpoint and parameterize the captured data values in order to check an XML document or file whose data changes in a predictable way. XML documents and files often need a well-defined structure in order to be portable across platforms and development systems. One way to accomplish this is by developing an XML schema, which describes the structure of the XML elements and data types. You can use schema validation to check that each item of content in an XML file adheres to the schema description of the element in which the content is to be placed.
Object Repositories types, Which & when to use? Deciding Which Object Repository Mode to Choose
A)To choose the default object repository mode and the appropriate object repository mode for each test, you need to understand the differences between the two modes. In general, the object repository per-action mode is easiest to use when you are creating simple record and run tests, especially under the following conditions: You have only one, or very few, tests that correspond to a given application, interface, or set of objects. You do not expect to frequently modify test object properties. You generally create single-action tests. Conversely, the shared object repository mode is generally the preferred mode when: You have several tests that test elements of the same application, interface, or set of objects. You expect the object properties in your application to change from time to time and/or you regularly need to update or modify test object properties. You often work with multi-action tests and regularly use the Insert Copy of Action and Insert Call to Action options.
Can we Script any test case with out having Object repository? or Using Object Repository is a must?
Ans: No. U can script with out Object repository by knowing the Window Handlers, spying and recognizing the objects logical names and properties available.
How to execute a WinRunner Script in QTP?
Ans : (a) TSLTest.RunTest TestPath, TestSet [, Parameters ] –> Used in QTP 6.0 used for backward compatibility Parameters :
The test set within Quality Center, in which test runs are stored. Note that this argument is relevant only when working with a test in a Quality Center project. When the test is not saved in Quality Center, this parameter is ignored. e.g : TSLTest.RunTest “D:\test1″, “” (b) TSLTest.RunTestEx TestPath, RunMinimized, CloseApp [, Parameters ] TSLTest.RunTestEx “C:\WinRunner\Tests\basic_flight”, TRUE, FALSE, “MyValue” CloseApp : Indicates whether to close the WinRunner application when the WinRunner test run ends. Parameters : Up to 15 WinRunner function argument
How to handle Run-time errors?
(a) On Error Resume Next : causes execution to continue with the statement immediately following the statement that caused the run-time error, or with the statement immediately following the most recent call out of the procedure containing the On Error Resume Next statement. This allows execution to continue despite a run-time error. You can then build the error-handling routine inline within the procedure. Using “Err” object msgbox “Error no: ” & “ ” & Err.Number & “ ” & Err.description & “ ” & Err.Source & Err.HelpContext
How to change the run-time value of a property for an object?
Ans : SetTOProperty changes the property values used to identify an object during the test run. Only properties that are included in the test object description can be set
How to retrieve the property of an object?
Ans : using “GetRoProperty”.
How to open any application during Scripting?
Ans : SystemUtil , object used to open and close applications and processes during a run session.
(a) A SystemUtil.Run statement is automatically added to your test when you run an application from the Start menu or the Run dialog box while recording a test E.g : SystemUtil.Run
“Notepad.exe” SystemUtil.CloseDescendentProcesses ( Closes all the processes opened by QTP )
Types of properties that Quick Test learns while recording?
Ans : (a) Mandatory (b) Assistive . In addition to recording the mandatory and assistive properties specified in the Object Identification dialog box, QuickTest can also record a backup ordinal identifier for each test object. The ordinal identifier assigns the object a numerical value that indicates its order relative to other objects with an otherwise identical description (objects that have the same values for all properties specified in the mandatory and assistive property lists). This ordered value enables QuickTest to create a unique description when the mandatory and assistive properties are not sufficient to do so.
What is the extension of script and object repository files?
Ans : Object Repository : .tsr , Script : .mts, Excel : Default.xls
How to supress warnings from the “Test results page”?
Ans : From the Test results Viewer “Tools > Filters > Warnings”…must be “Unchecked”.
When we try to use test run option “Run from Step”, the browser is not launching automatically why?
Ans : This is default behaviour.
Does QTP is “Unicode” compatible?
Ans : QTP 6.5 is not but QTP 8.0 is expected to be Unicode compatabile by end of December 2004.
How to “Turn Off” QTP results after running a Script?
Ans : Goto “Tools > Options > Run Tab” and Deselect “View results when run session ends”. But this supresses only the result window, but a og will be created and can viewed manulaly which cannot be restricted from getting created.
How to verify the Cursor focus of a certain field?
Ans : Use “focus” property of “GetRoProperty” method” 6
1. Any limitation to XML Checkpoints? Ans : Mercury has determined that 1.4MB is the maximum size of a XML file that QTP 6.5 can handle
How to make arguments optional in a function?
Ans : this is not possible as default VBS doesn’t support this. Instead you can pass a blank scring and have a default value if arguments r not required.
How to covert a String to an integer?
Ans : CInt()—> a conversion function available.
Inserting a Call to Action is not Importing all columns in Datatable of globalsheet. Why?
Ans : Inserting a call to action will only Import the columns of the Action called
How to add a constant number in a datatable?
A)This is more to do with MS excel then QTP!! but useful to know because at times it becomes frustrating to the novices.ust append ' to the number
Ex: if you wish to enter 1234567 in datatable then write it as '1234567
How can i check if a parameter exists in DataTable or not?
A)The best way would be to use the below code:
on error resume next
val=DataTable("ParamName",dtGlobalSheet)
if err.number<> 0 then
'Parameter does not exist
else
'Parameter exists
end if
How can i check if a checkpoint passes or not?
A) chk_PassFail = Browser(...).Page(...).WebEdit(...).Check (Checkpoint("Check1"))
if chk_PassFail then
MsgBox "Check Point passed"
else MsgBox "Check Point failed"
end if
My test fails due to checkpoint failing, Can i validate a checkpoint without my test failing due to checpoint failure?
A) Reporter.Filter = rfDisableAll 'Disables all the reporting stuff
chk_PassFail = Browser(...).Page(...).WebEdit(...).Check (Checkpoint("Check1"))
Reporter.Filter = rfEnableAll 'Enable all the reporting stuff
if chk_PassFail then
MsgBox "Check Point passed"
else
MsgBox "Check Point failed"
end if
What is the difference between an Action and a function?
A)Action is a thing specific to QTP while functions are a generic thing which is a feature of VB Scripting. Action can have a object repository associated with it while a function can't. A function is just lines of code with some/none parameters and a single return value while an action can have more than one output parameters.
Where to use function or action?
A) Well answer depends on the scenario. If you want to use the OR feature then you have to go for Action only. If the functionality is not about any automation script i.e. a function like getting a string between to specific characters, now this is something not specific to QTP and can be done on pure VB Script, so this should be done in a function and not an action. Code specific to QTP can also be put into an function using DP. Decision of using function/action depends on what any one would be comfortable using in a given situation.
When to use a Recovery Scenario and when to us on error resume next?
A) Recovery scenarios are used when you cannot predict at what step the error can occur or when you know that error won't occur in your QTP script but could occur in the world outside QTP, again the example would be "out of paper", as this error is caused by printer device driver. "On error resume next" should be used when you know if an error is expected and dont want to raise it, you may want to have different actions depending upon the error that occurred. Use err.number & err.description to get more details about the error.
How to use environment variable?
A) A simple defintion could be... it is a variable which can be used across the reusable actions and is not limited to one reusable action.
There are two types of environment variables:
1. User-defined
2. Built-in
We can retrieve the value of any environment variable. But we can set the value of only user-defined environment variables.
To set the value of a user-defined environment variable:
A)Environment (VariableName) = NewValue
To retrieve the value of a loaded environment variable:
A)CurrValue = Environment (VariableName)
Example
The following example creates a new internal user-defined variable named MyVariable with a value of 10, and then retrieves the variable value and stores it in the MyValue variable.
Environment.Value("MyVariable")=10
MyValue=Environment.Value("MyVariable")
What are the files and subfolders of a QuickTest Professional test?
A)The files and folders hold binary and text data that are required for the test to run successfully.
The following table provides a description, the type, and comments regarding the files that make up a QuickTest Professional test.
File Name Description Type Comments Regarding File
Test.tsp Test settings Binary Do not edit
Default.xls Data table parameters Excel similar Can be edited using Excel
Parameters.mtr Parameterization info Binary Do not edit
Action Action folder
Default.cfg Load test configuration file Text Do not edit
Default.prm Load test configuration file Text Do not edit
Default.usp Load test configuration file Text Do not edit
.usr Load test configuration file Text Do not edit
Thick_usr.dat Load test configuration file Text Do not edit
Thin_usr.dat Load test configuration file Text Do not edit
Files within Action folder:
File Name Description Type Comments Regarding File
Script.mts Action script Text Edit text preceding the @@
Resource.mtr Object Repository Binary Do not edit
Snapshots Active screen files Folder Do not edit
There are few more files extensions like
.MTB Batch File
.LCK Locked
How to rename a checkpoint (QTP 9.0)?
A) Example:
Window("Notepad").WinEditor("Edit").Check CheckPoint("Edit")
In the above example, the user would like to change the name of the CheckPoint object from "Edit" to something more meaningful.
Note:
This functionality is new to QuickTest Professional 9.0.This is not available for QTP 8.2 and below.
1. Right-click on the Checkpoint step in the Keyword View or on the Checkpoint object in Expert View.
2. Select "Checkpoint Properties" from the pop-up menu.
3. In the Name field, enter the new checkpoint name.
4. Click . The name of the checkpoint object will be updated within the script.
Example:
Window("Notepad").WinEditor("Edit").Check CheckPoint("NewCheckPointName")
Note:
You must use the QuickTest Professional user interface to change the name of the checkpoint. If you manually change the name of the checkpoint in the script, QuickTest Professional will generate an error during replay. The error message will be similar to the following:
"The "" CheckPoint object was not found in the Object Repository. Check the Object Repository to confirm that the object exists or to find the correct name for the object."
The CheckPoint object is not a visible object within the object repository, so if you manually modify the name, you may need to recreate the checkpoint to resolve the error.
Does QuickTest Professional support Internet Explorer 7.0?
A)
QuickTest Professional 9.1
QuickTest Professional 9.1 supports Microsoft Internet Explorer 7.0 Beta 3. Internet Explorer version 7.0 is now certified to work and to be tested with QuickTest Professional version 9.1.
QuickTest Professional 9.0
QuickTest Professional 9.0 supports Internet Explorer 7.0 Beta 2.
QuickTest Professional 8.2 and below
QuickTest Professional 8.2 and below do not include support for Internet Explorer 7.0.
Does QuickTest Professional support Firefox?
QuickTest Professional 9.1 and 9.2
QuickTest Professional 9.1 provides replay support for Mozilla Firefox 1.5 and Mozilla Firefox 2.0 Alpha 3 (Alpha-level support for Bon Echo 2.0a3).
Notes:
QuickTest Professional 9.1 will not record on FireFox. You can record a test on Microsoft Internet Explorer and run it on any other supported browser, such as FireFox.
The .Object property for web objects is not supported in FireFox.
QuickTest Professional 9.0
QuickTest Professional 9.0 provides replay support for Mozilla FireFox 1.5.
Notes:
QuickTest Professional 9.0 will not record on FireFox. You can record a test on Microsoft Internet Explorer and run it on any other supported browser, such as FireFox.
The .Object property for web objects is not supported in FireFox.
QuickTest Professional 8.2 and below
QuickTest Professional 8.2 and below do not have support for Firefox.
What is the lservrc file in QTP?
A) The lservrc file contains the license codes that have been installed
The lservrc file contains the license codes that have been installed. Whenever a new license is created, the license code is automatically added to this file. The lservrc file is a text file, with no extension.
File Location:
1) For a Concurrent (Floating) license installation:
"#server installation directory#\#language#"
Example:
C:\Program Files\XYZ Technologies\ABC Server\English\lservrc
2) For a Seat (Stand-alone) license installation:
#AQT/QTP installation directory#\bin"
Example:
C:\Program Files\Mercury Interactive\QuickTest Professional\Bin\lservrc
What to do if you are not able to run QTP from quality center?
A)This is for especially for newbies with QTP.
Check that you have selected Allow other mercury products to run tests and components from Tools--> Options--> Run Tab.
A)Does QuickTest Professional support Macintosh operating systems?
No, QTP is not expected to run on this OS.
To terminate an application that is not responding we use:
A)SystemUtil.CloseProcessByName
The method that adds to the test while implementing synchronization is:
A)WaitProperty
The command used to invoke other application from QTP:
A)InvokeApplication, SystemUtil.Run
The method used for sending information to the test results is:
A)Reporter.reportevent()
The command used to retrieve data from excel sheet is
A) Set ab = CreateObject("srcfilepath ") , Set ws = ab.getsheet(sheetid)
The method used to open the specified URL in a browser is:
A)navigate()
The 3 Parameter types available in data driver is:
A)DataTable,Environment,Random number
The method added to the test while parameterizing is:
A)Set DataTable(variable, dtGlobalSheet)
The length of the array can be get by the method:
A)ubound(array)
The Command used to insert the transactions in test is:
A). Services.StartTransaction "Name", Services.EndTransaction "Name"
Explain what the difference between Shared Repository and Per Action Repository
A)Shared Repository: Entire application uses one Object Repository , that similar to Global GUI Map file in WinRunner Per Action: For each Action, one Object Repository is created, like GUI map file per test in WinRunner
What is the difference between check point and output value?
An output value is a value captured during the test run and entered in the run-time but to a specified location. EX:-Location in Data Table[Global sheet / local sheet]
What is Hybrid Framework and how it is useful?
The combination of both keyword and data driven framework is known as a hybrid framework. At the time of the building of the framework the objects which are not going to change should be taken and hard coded in the application and from the data sheet the frequently changing objects should be taken. If any framework consists of 2 or more frameworks then it is a hybrid framework.
For what purpose step generator is used?
Step generator is used to insert steps in a test by selecting from a range of context-sensitive options and by entering the required values. It breaks the test to achieve proper testing results. It thus saves time instead of recording a step can be generated for a particular step. The step generator can be used from both the keyboard view and the expert view.
In what situations QTP will not recognize the Objects?
1. If the AUT change
2. If AUT is in another window
3. If synchronization is a problem If QTP is running faster than the application.
In what situations QTP will not recognize the Objects?
TP 9.2 provides two options fo object identification Tool->Object Identification it provides a furthur option under it called smart Identification..u can configure it to recognize the objects which are not recognised by QTP normally!!
Give me an example where you have used a COM interface in your QTP project?
- com interface appears in the scenario of front end and back end. for eg:if you r using oracle as back end and front end as VB or any language then for better compatibility we will go for an interface. of which COM will be one among those interfaces. Create object creates handle to the instance of the specified object so that we program can use the methods on the specified object. It is used for implementing Automation(as defined by Microsoft).
How many types of recording facility are available in QuickTest Professional (QTP)?
QTP provides three types of recording methods-
* Context Recording (Normal)
* Analog Recording
* Low Level Recording
What are assistive properties or an ordinal identifier?
When mandatory property values are not sufficient to uniquely identify the object within its parent object, QuickTest adds some assistive properties and/or an ordinal identifier to create a unique description. Note: You can retrieve or modify property values of the test object during the run session by adding GetTOProperty and SetTOProperty statements in the Keyword View or Expert View. You can retrieve property values of the runtime object during the run session by adding GetROProperty statements. If the available test object methods or properties for an object do not provide the functionality you need, you can access the internal methods and properties of any run-time object using the Object property. You can also use the attribute object property to identify Web objects in your application according to user-defined properties.
Explain the terms Password Encoder, Remote Agent, Test Batch Runner, Test Results Deletion tool?
Password Encoder—enables you to encode passwords. You can use the resulting strings as method arguments or Data Table parameter values. Remote Agent—determines how QuickTest behaves when a test or component is run by a remote application such as Quality Center. Test Batch Runner—enables you to set up QuickTest to run several tests in succession. Test Results Deletion Tool—enables you to delete unwanted or obsolete results from your system according to specific criteria that you define.
How to connect to a database?
code:
Const adOpenStatic = 3
Const adLockOptimistic = 3
Const adUseClient = 3
Set objConnection = CreateObject("ADODB.Connection")
Set objRecordset = CreateObject("ADODB.Recordset")
objConnection.Open "DRIVER={Microsoft ODBC for Oracle};UID=;PWD=
"
objRecordset.CursorLocation = adUseClient
objRecordset.CursorType = adopenstatic
objRecordset.LockType = adlockoptimistic
ObjRecordset.Source="select field1,field2 from testTable"
ObjRecordset.ActiveConnection=ObjConnection ObjRecordset.Open 'This will execute your Query
If ObjRecordset.recordcount>0 then
Field1 = ObjRecordset("Field1").Value
Field2 = ObjRecordset("Field2").Value
End if
What are the Run modes in QTP ?
There are 2 run modes in QTP
* Normal : It shows the execution of your QTP script step by step. This works good in case of debugging your script.
* Fast Run : It will not show the execution line by line.
What are the Debugging modes used in QTP ?
Different Debugging modes used in QTP are
* Step Into : To run only the current line of the active test or component.
* Step Out : Runs to the end of the called action or user-defined function, then returns to the calling action and pauses the run session.
* Step Over : to run only the current step in the active test or component. When the current step calls another action or a user-defined function,the called action or function is executed entirety, but the called action script is not displayed in the QuickTest window.
What are the draw backs of QTP ?
Disadvantages are
* QTP takes very long to open huge tests. Also CPU utilization becomes 100% in that case.
* QTP scripts are heavy as it stores all the html files (for active screen) as well.
* Block commenting is not provided till 8.2 version.
What are the extension of file..........
* Per test object repository : filename.mtr (Mercury Test Repository)
* Shared Oject repository : filename.tsr (Test Shared Repository)
* User Defined Libary File : filename .vbs
* Test Batch Runner File : filename .mtb
* QTP Recovery Scenarion File : filename .qrs
What are two types of automation in QTP ?
There are 2 types of automation
* Recording or generating the script and playing back using Repository
* Another one is Descriptive method.
Can we do more than capture / payback in QTP ?
Yes we can do. That is scripting we can write script which is more effective
What is Descriptive programming ?
With out mentioning the description in Object repository, we can directly mention the description in Test script is known as descriptive programming
What is Object repository ?
Object repository in qtp is like a storage place where it stores the properties of all the objects when we reocrd the script and later when we execute the script QTP checks that the objects in the application match the objects in the object repository and executes it, if both the objects matches the test will pass, if it cannot identify the object or there is a mismatch the script will fail.
Object repository is same as GUI map in winrunner where we have to make the tool capture the properties of object where as in QTP object repository automatically does that for us.
What are types of Object repository (OR)?
OR are of two types
* Per-action
* Shared
Tell about Per-action repository modes
In this, for each action a seperate object repository file is created. So object1 in Action1 is different from the same object1 in Action2
This mode is most useful, when the object does not change frequently and a few actions are associated with the test. If the object changes in the application, then we need to change each of the object repositor.
Tell about Shared object repository modes
In this, common object repository file can be used for muliple actions and multile tests. So Object1 is action1 is same for Action2, because all the objects are saved at one place. Here if the object changes, then we need to update a single object repository file.
What are the Advantage & Disadvantge Per-action repository ?
Advantage
* As you record operations on objects in your application, QuickTest automatically stores the information about those objects in the appropriate action object repository.
* When you save your test, all of the action object repositories are automatically saved with the test as part of each action within the test. The action object repository is not accessible as a separate file (as is the shared object repository).
Disadvantages
* Modifying the test object properties, values, or names in one object repository does not affect the information stored for the same test object in another object repository or in other tests - Time Consuming
* If you add objects to one of the split actions, the new objects are added only to the corresponding action object repository.
What are the Advantage & Disadvantge Shared object repository ?
Advantage
* Only one instance of the object in the repository so reduce the repetitions
* one time change to the object properties would bring change in every script using the object
Disadvantge
* Complexity increase as objects of all the action are in the same repository
What is Check points ?
A checkpoint verifies that expected information is displayed in an Application while the test is running. Checkpoints are used to compare actual and expected results.
How many Check points are there in QTP ?
They are 4 types of checkpoints
* GUI Check point
* Bitmap Checkpoint
* Database Checkpoint
* Test Checkpoint
What is the use of Check points ?
The Check points is useful to get the point in time from where to begin the recovery in case of failure.
Can we change the name of the Check points ?
No, QTP is do not allow to change the name of Check point, because these class names are internally built. But in version 9 (just released) it is possible to cahange not in previous versions
What is Transaction ?
A Transaction is a logical unit of work that comprises one or more SQL statements executed by a single user. or It is a group of statements between two commits
What is use of Step Generator ?
Step Generator is used to insert a statement(function ro method) of a particular object which is available in the Object Repository
What is Source Control ?
The practice of tracking changes made to code is called Source Control.
Familiar Source control Tools are CVS, VSS, ClearCase etc
What is Batch testing ?
Group of tests executing sequentially one by one is called Batch Testing. Every test Batch consists of mutiple dependent test cases. In those batches every end state is base state to next case. Test batch is also known as Test suit or Test belt.
Generally Test engineers are executing test programs as a batches because "End state of one test is base state to another test".
The result of one Script failure or pass , fails or passes the whole batch test.
What will you when Object is not indentifed by the Obect Repository ?
Use Smart identifcation.
What is Smart identifcation ?
Smart Identification is used by QTP, whenever it is unable to identify any object during run time. While identifying an object, QTP tries to match the mandatory properties first, if it couldn't find the object, then it adds assistive properties one by one to identify the object correctly. This operation is done by smart identifier and it is displayed in the results section along with one warning message. It's generally used to identify Web elements only.
What is Envoirement variable ?
Envoirement variable is variable which is global through the testing.
What is the typesof Envoirement variable ?
There are 3 types of environmental variables
* User-Defined Internal
* User-Defined External
* Built-In
What are Exception in QTP ?
The four exceptions are
* Pop exception
* Object state
* Test run error
* Application crash
Can We use Test Director with QTP ?
Yes. We cant use Test Director 7.2 with QTP 8.2. Because QTP 8.2 supports QC (Quality Center)
We can use QTP 8.2 with Test director 8.0.
What are Action ?
There are 3 types of Actions available in QTP.
* Non-reusable
* Reusable
* External Actions
What is Framework ?
A framework is nothing but a folder structure . It contains all the components that are using in Automation Architecture. Here components means Object Repository, Library,Logs, Test Data, Script, Result etc
What is Compiled modules ?
In qtp the compiled modules are called library files .
What is Automation Framework ?
Automation frame work is nothing but a set of rules defined for developping and organising the test scripts or
It is a process to develop the automation scripts and reduce maintenance. This framework completely depends on the application, types of testing and tools that you are using. Its hard to provide generalised framework for all applications:
In how many ways we can Parameterize our test ?
we can parameterize our tests in 4 ways.
* Test or component parameter
* Data Table parameter
* Environmental variable parameter
* Random number parameter
What are tyes of Table ?
Types of tables are
* run time data table
* design time data table
What is Index Property for identifying the objects in QTP?
While learning an object, QTP can assign a value to the test object’s Index property to uniquely identify the object. The value is based on the order in which the object appears within the source code. The first occurrence is 0.
Index property values are object-specific. Therefore, if you use Index:=3 to describe a WebEdit test object, QTP searches for the fourth WebEdit object in the page.
However, if you use Index:=3 to describe a WebElement object, QTPt searches for the fourth Web object on the page—regardless of the type—because the WebElement object applies to all Web objects.
What are the situations best suited to Recording in QTP?
Recording can be useful in the following situations:
# Recording helps novice QuickTest users learn how QTP interprets the operations you perform on your application, and how it converts them to QTP objects and built-in operations.
# Recording can be useful for more advanced QTP users when working with a new application or major new features of an existing application (for the same reasons described above). Recording is also helpful while developing functions that incorporate built-in QTP keywords.
# Recording can be useful when you need to quickly create a test that tests the basic functionality of an application or feature, but does not require long-term maintenance.
No comments:
Post a Comment