QTP Interview Questions And Answers (126)

Q1: How to do the batch testing using QTP
A1: go to tools, options and select the test batch runner and select the scripting functions one by one by keeping it in wait mode and execute it.
Q2: How to execute a Win Runner Script in QTP?
A2: insert->call to win Runner->select test or function
Q3: Inserting a Call to Action is not importing all columns in Datatable of globalsheet. Why?
A3: As the call is to an Action, the data in the Global sheet will not be available. Only which are necessary for the Action like repository, action's sheet will be imported. So the test's global sheet and its data will not be available in the calling test.
Q4: What is output value?
A4: An output value is a value retrieved during the test run and entered into your data table. You can subsequently use this output value as input data in your test. This enables you to use data retrieved during a test in other parts of the test.
Q5: How to do Batch run in qtp? Provide the steps?
A5: goto tools select the batch test runner. add the items to be tested and say run
Q6: How to make arguments optional in a function?
A6: Suppose there is a login window in the user name we can type any thing but while running its giving some error we can avoid that error actually so, we can make that tsl as an optional so that if an error occurs it continues but not stop for example
Optional.Dialog("Login").WinEdit("Name:").Set "ssss"
these line make an optional now
Q7: How to retrieve the property of an object?
A7.1: Spy the object a dialog box comes with the properties and the associated methods
A7.2: Example: Dim link_Text link_Text=Browser("abcd").Page("efgh").Link.GetROProperty ("innertext")
Q8: How to supress warnings from the "Test results page"?
A8: Test case warnings are suppress by
Tools>general options>uncheck the warnings
Q9: How to execute a Win Runner Script in QTP?
A9: Insert->callto win Runner->select test or function
Q10: How to get the object property?
A10.1: using getroproperty or using objspy or in the tree view we can select particular object and right-clicking we can see all properties right any thing mistake make it correct
A10.2: Just spy that object by using GUI spy, then it will show the object properties, if it is not having the standard properties then go for GUI map configuration and add whatever the properties u want
Q11: How we can take data in the username field text box into variable in web application?explain with example and give all functions to get data into variables.
A11.1: just declare a variable
x=browser(browser).page(pagename).setROproperty("innertext")
msgbxo x
A11.2: Any Application, it may be web or it may be window based applications, we use getroproperty () method to get the data from the Edit box.Same way if u want to set the data to the edit box we use set()method. For example:
Dim variable name
Variable name = Browser (browser).page
(pagename).GetROproperty("Logical name")
if u want to print in dialogbox use msgbox()function OR
if u want to print in test result use reporter. reporter
event() function
Q12: What is the use of Regular expression?
A12.1: By using RE we can instruct QTP not to consider values of an object but only consider the format.Ex: if u r testing a date field with different values then QTP consider only date format not changing dates.
A12.2: depends on events our application objects (or)windows labelsare varying .To create data driven test on this type of objects and window Test Engineers are inserting regular expression in corresponding gui map entry.

Q13: What is the Diff between Image check-point and Bit map Check point?
A13: image check point we can use this in web testing to find the source and etc bitmap checkpoint to use this we can find the images difference and specific screen area differences
Q14: Can anybody give the script to add sheet, add column, add values under that column in the rows?
A14.1: U can try with Add Parameter method. If u have help chk for this. The example for this will have "....Get sheet (...).Add Parameter (..)..."
A14.2: We can create sheet, parameter and can assign value in one step:
DataTable.AddSheet
("MySheet").AddParameter "Parametername","Value"
Q15: what is TOM in qtp?
A15: Test Object Model
Q16: where is the bitmap checkpoint be saved
A16: Any check point will be saved in a Temp/the script saved Folder along with the script there is no any other place to save.
Q17: Anybody explain me, the concept of checkpoint declaration in the QTP mainly for the Objects, Pages, Text and Tables?
A17: A checkpoint verifies that expected information is displayed in a Application while the test is running. You can add eight types of checkpoints to your test for standard web objects using QTP.
Object, Page and Table checkpoints can be added using Standard check point.
1. A page checkpoint checks the characteristics of a Application
2. An object checkpoint (Standard) checks the values of an object on a Application.
3. A table checkpoint checks information within a table on a Application
4. A text checkpoint checks that a text string is displayed in the appropriate place on a Application.
Q18: How many check points are there in QTP and what are they?A18: QTP supports 9 types of check points.
1. Standard check point.
2. Image check point.
3. Bitmap check point.
4. Page check point.
5. Text check point.
6. Text Area check point.
7. Database check point.
8. Accessibility check point.
9. XML check point.
Q19: What is Parameterizing Tests?
A19.1: When converting test into data driven tests - we replace fixed values with parameters/variable - is known as parameterize the tests.
A19.2 When you test ur application we may want to test how the application performs same operations with multiple sets of data

Q20: One build is delivered, in that build button name is submit. but in the next built that name of the button changed as login. Will u continue with previous recorded script or u make any changes?
A20.1: So we want to change the logical name of the button through regedit.exe, i.e. after executing this we can change the logical name of that particular button
A20.2: U can change the logical name of the object which object u change in object repository. or u add new object to the object Repository.
Q21: how to test background color and dynamic images during runtime
A21: It is possible only in web applications only. By using check points we have to test the back ground color and dynamic images for e.g. Yahoo mail page back ground color is blue

Q22: Can we directly automate test scripts according to requirements?
A22: No, we cannot automate test scripts using requirements.
Q23: When the Low Level Recording is Used in QTP?
A23.1: 1.if fails to record in Context Sensitive
2. If it fails to record in analog recording
3. Whem the Object is not identified
A23.2: When QTP fails to recognize object in Default mode, we switch to Low Level recording in order to record on Object level.
A23.3: Sometimes low level recording is used to record unexpected defects that arise due to mouse movement and key strokes.
A23.4: If QTP fails to recognize the object in application then the low level recording mode will be used for recognizing objects in application. In low level recording mode QTP will recognize the objects as a "Window" or "WinObject".we can see in Expert View.
A23.5: Some of the objects are not recognizing in default recording mode then switch to low level recording. Means it Captures objects, x & y co-ordinates of screen, keyboard Inputs and also mouse clicks.
Q24: How to add check point?
A24: We can add check points mainly 2 ways they are:
1. Right Click on any icon(step) for which v want to add chk point in Tree view and select add check point.
2.Simply way is go 4 Active screen, select the object on which u want to add check point and select add check point.
Q25: What is the extension of script and object repository files in QTP?
A25: Extension for Script is .mts
Extension for Repository is if it is per action (.mtr)
else shared (.tsr)
Q26: How to add a runtime parameter to a data sheet?
A26: 1) You can pass datasheet value to test during run time
DataTable.SetCurrentRow(1)
var= Datatable.Value("Column Name","Sheet name")
2) you can write value to datasheet during run time
DataTable.SetCurrentRow(2)
Datatable.Value("Column Name","Sheet name") = Value
Q27: What scripting language QTP of?
A27: We can use scripting languages in QTP like Perl, shell and vb scripts.
Q28: Per-Action Vs Shared repository?
A28.1: U can relate this with Global Sheet and Local Sheet of Datatable
A28.2: 1.Shared repository objects can be used for the entire test where as Per-action repository objects can be used for that particular action only.
2. Shared repository occupies less memory compare to per-action repository.
3. If any change occurs in application we need to make changes only once in shared repository where as per-action repository needs change in every action repository.
A28.3: In per-action instructs QTP to refer to the external action repository whereas in shared instructs QTP to use test shared object repository for this action.
A28.4: Per-action: In qtp we select per-action mode then for each action it creates an object repository. This type of process is memory wastage process.
Shared repository: In qtp we select shared mode then for all actions it creates one object repository in a test. This not memory wastage process we can this repository in other tests also.
Q29: What are the abbreviations for tsr and mtr?
A29: .tsr: Test Script Repository
.mtr: Modular Test Repository
.mts: Mercury Test Script
.vbs: vb Script
Q30: Difference between Call Run action and copy of action?
A30: Call Run Action: It calls the existing action from the calling action. It calls the main action only. If we make any changes to that called action it will affect all other actions which called it.
Copy of Action: It creates the copy of existing action. It is completely different from main action with its own Object
Repository (in case of Per Action mode). If we change the main Action it will not affect its Copy and vice versa
Q31: Syntax for how to call one script from another? And Syntax to call one "Action" in another?
A31: If u want to call the script from one action to another then the below syntax usedsuppose u have created a test1 ,in that you have created the all steps for action1.and you have created a action2 .now you want to call your script from action
run action "action1 (test1) iteration1"
Q32: How you automate test scripts one by one or module wise or all at once?
A32: Test Automation is process which follows the framework designed for the company. This framework varies from one organization to other. Here are some basic steps which are followed in general...
Step1: Segregate the test cases to be automated.
Step2: Prepare the test data for the selected test cases
Step3: Make scripts for repeatable or functional scenarios
Step4: Convert those scripts as Reusable functions
Step5: Make test scripts by calling the reusable functions and adding the conditions as per your requirements.
Q33: What is Expert view?
A33: Expert view is one view in which VBscript is generated during recording.
Q34: Tell about descriptive programming in qtp8.2?
A34: Descriptive Programming is all about identifying an object uniquely. And there is no defined frame work for it. Frame Work depends on the project.
This is the code for Yahoo Photos Website you can do the same for the yahoo by changing the values in the required places.
CODE: Browser ("title:=Yahoo! Photos*.*").page
("title:=Yahoo! Photos*.*").Web Edit ("name:=login").set "srinivas"
Browser ("title:=Yahoo! Photos*.*").page("title:=Yahoo!
Photos*.*").Web Edit("name:=passwd").set "test"
Browser ("title:=Yahoo! Photos*.*").page("title:=Yahoo!
Photos*.*").WebButton ("name:=Sign In").click
Q35: How u does batch testing in WR & is it possible to do in QTP, if so explain?
A35: it is possible to run test batch in QTP, the option is
Programs->Quick test professional->Tools->test Batch runner
then it will open test batch runner window then u have to add the test that u want to automate for qtp tool, how to add the tests is..
File->New
Batch->Add
like that u can add, what ever the test u want to automate
Q36: What is the extension of script and object repository files?
A36: The extension for Script file is .mts and the extension of the repository file is .tsr
Q37: What is the extension of script and object repository files?
A37: Extension for test script :->
* The extension of Test Script File: .mts
Extension for test repository :->
* The extension of test repository (per test): .tsr
* The extension of test repository (shared): .mtr
Q38: What is the difference between image and bitmap check point?
A38.1: Image check point - It will capture your whole image.
Bitmap Check point- Using this you can capture desired area of image or other portion.
A38.2: Image checkpoint: by using image check point we can use path of the image and source it's using only for web test
Bitmap check point: by using this we can check versions variations and particular image before and after.
A38.3: image check point we can use this in web testing to find the source and etc bitmap checkpoint to use this we can find the images difference and specific screen area differences

Q39: HOW to invoke any recorded script in QTP with out using RECORD & PLAYBACK CONCEPT?
A39.1: invoke_record (path of the record)
A39.2: by using reusable functions and calling them in the program
Q40: What is Tree view?
A40: It is an icon based view generated during recording by QTP.
Q41: Tell about automation object model (Aom) in qtp?
A41: Aom IS THE CONCEPT OF "TO AUTOMATE THE QTP ITSELF"
Q42: Tell me Three major differences between QTP & Winrunner?
A42: a) Win runner using TSL for programming Resource availability is less but QTP using VB script we can find more resource.
b) in QTP we can See the result With Step by step With Screenshot
c) The GUI map can be difficult to understand and implement
Q43: What is Optional step?
A43: When running a test, if a step does not succeed in opening dialog box, QTP does not necessarily abort the test run. It bypasses any step designated "optional" and continues running the test.
By default, automatically QTP marks as optional steps that open certain dialog boxes. You can manually designate additional steps as optional.
Q44: What does VBS file contain...??? what is VBS file.. ???
A44: vbs file contains the user defined functions which are reusable that can be used in our test or component according to our requirement
Q45: How QTP recognizes Objects in AUT?
A45: Through object repository qtp can recognize the object in AUT
Q46: Take a situation when you are working with QTP, suddenly system has crashed. so you again start the system. My question is how can QTP directly opened when the system desktop appears.
A46: we can set the error or event in the recovery scenario wizard and if the system faces such situation by the recovery scenario the system will get back to the desired action or events
Q47: How to create runtime property for an object?
A47: Example:
Browser("abcd").SetROProperty("abs_x",158)
Q48: what is Unicode Compatibility???? How this does makes a difference from Win runner?
A48: Unicode compatibility is nothing but u can Test Applns which are developed in other than English Language also.i.e QTP Supports Japanise,chinese language appls also.
Where as win runner doesn't support Unicode compatibility.
Q49: Can we do Load Testing with QTP?
A49.1: You can not create a load in QTP.QTP is a functional regression testing tool.QTP can only act like 1 user.You need a tool like Load Runner to actually create a load.
A49.2: As being an Regression Tool we cannot emulate Load on the tool as this tool is an Regression tool for the revisioning the Test of the Application.
A49.3: NO because load testing is completely releated to performance testing and qtp is a completely functionality & Regression tool, so that we can not emulate the load test with qtp.
A49.4: By using start transaction and end transaction options we can partially conduct performance testing. And also by using data driven testing (or looping one functionality using for loop we can partially conduct load Testing. But this can compare with load runner
Q50: Explain about reusable actions?
A50: If we want to use the 'call to existing action' option, we have to make an action as reusable action, for that we have to go for action properties and click the Check button. Let action1 is a reusable action then we call it to any other action. If we change the script in action1 it is affects in all actions in which we called action1.
Q51: How to make an Action as reusable?
A51: Go to Tree View. Select the action and right click. Go to
Action Properties and check the checkbox 'Reusable action'.
Q52: How many ways we can parameterize data in QTP?
A52.1: There are four types of parameters.
1. Test, action or component parameters.
2. Data Table parameters.
3. Environment variable parameters.
4. Random number parameters.
A52.2: four ways
1) From Keyword driven/Tree view
2) From Active Screen
3) From Expert View
4) From tool bar
Q53: How do you handle XML exceptions in QTP (Here it is Exception, not the checkpoint)
A53: using recovery scenario in QTP we can handle any type of exceptions.
Q54: WHAT IS A TEST STRATEGY & WHAT IS THE DIFFERENCE BETWEEN TEST STRATEGY & TEST PLAN?
A54.1: Test strategy is a company level document and which says the approach for testing. the test strategy doc also says that the scope, business issues, test deliverables, tools used ,risk analysis etc, where as test plan is document which says what to test, when to test ,how to test and who to test. The test plan document was prepared by the test lead.
A54.2: Test strategy: I hope that brief version of your test cases
Test plan: this is one of the document in your testing process, it contains testing environment, s/w & h/w requriements,test data creation etc.
Q55: What is test object model in QTP?
A55: Test Object Model in QTP, is the combination of Test Object and Run Object information of the objects used.
Q56: Explain about the Test Fusion Report of QTP ?
A56: Once a tester has run a test, a Test Fusion report displays all aspects of the test run: a high-level results overview, an expandable Tree View of the test specifying exactly where application failures occurred, the test data used, application screen shots for every step that highlight any discrepancies, and detailed explanations of each Checkpoint pass and failure. By combining Test Fusion reports with Quick Test Professional, you can share reports across an entire QA and development team.
Q57: How to Import data from a ".xls" file to Data table during Runtime?
A57: datatable.Import ("file path")
datatable.Importsheet ("file path", sheetid)
Q58: How to get the column count and column name from the resultset in the database connection program?
A58: you use following sql query
select column name, count (column name) from table name.
Q59: In how many ways you perform batch testing?
A59: Start-> Programs-> QuickTestPro-> Tools-> Test Batch Runner
Here, you can call any number of scripts and run at once. All the scripts are run one after the other in the order they are placed in batch runner.
Q60: How many type of status messages are there.Explain?
A60.1: micPass Status as Pass
micFail Status as Fail
micDone Status as Done
example
Reporter.ReportEvent misPass,"RequirmentNo:1.2.1","Update
Functionality is Checked"
A60.2:Status of the report step:
0 or micPass: Causes the status of this step to be passed
and sends the specified message to the report.
1 or micFail: Causes the status of this step to be failed and sends the specified message to the report. When this step runs, the test or component fails.
2 or micDone: Sends a message to the report without affecting the pass/fail status of the test or component.
3 or micWarning: Sends a warning message to the report, but does not cause the test or component to stop running, and does not affect the pass/fail status of the test or component.

Q61: After running scripts how you report results ,there is any specific report form?
A61.1: report.reportevent event status,stepname,details
A61.2: Using QTP utility statement we can send report to Test
Result Window.Here the utility statement is syntax is
report.reportevent event status,stepname,details
Argument-1: event status is 4 types
1)micpass
2)micfail
3)micdone
4)micwarning
Argument-2: The status of object we are going to report
Argument-3: The details of the object.
Q62: 1) what is the Exact Meaning of Environment Variables? 2) What is Compile Module in QTP? What exactly it contains Functions or Actions?
A62: Win runner contains compile module. But qtp does not support compile module. compile module means library files in qtp ,which contains functions not the actions.

Q63: Associated files in QTP?
A63; Associated files are the script files(in which the functions/methods are defined)
Ex: If you want to add a associated file, make a file with functions in vb script, having extension .vbs
Using the file.
In Test ->Settings ->Resources. add a associated file by selecting from proper location.It can be made default for a test.
Q64: How to export data present in Datatable to an ".xls" file?
A64: DataTable.Export ("Path of the sheet")
or DataTable.ExportSheet("Path of the sheet",Index of the runtime data table u want to export")
Q65: How can we retrieve ten rows from the data table using loop concept?
A65: Assume "Column1" is my column name in the Global Data table, then use this code:
for i=1 to 10
datatable.setcurrentrow (i)
Return value=datatable.value("Column1","Global")
Msgbox (return value)
Next
Q66: What kind of errors can b handled in QTP in real time scenario?
A66: 1) Pop-up Window
2) Object state
3) Test run error
4) Application Crash

Q67: Recovery Manager means..?
A67: It provides a wizard that guides through the process of defining a recovery scenario. Here recovery scenario is a definition of an unexpected event and the operation(s) necessary to recovery the test run.
Q68: In how many ways we can add check points to an application using QTP?
A68: 1. Place the cursor in the script where u want checkpoint and right lick in there option is there checkpoint.
2. go after recording script u may go to active screen area there snapshots what ever u record in u r application that images will be there put u r mouse point to that image and right click there also u will get checkpoint option
3. Insert menu---checkpoint
Q69: What is iteration? How it is related to Test Results in QTP
A69: Here iteration means repeat the processes, with same values or different values, when You take the data driven test with different values... the test process repeats that much of time.
Q70: How you automate test scripts?
A70: we can automate test scripts by means automation reference model, by whichwe can automate the qtp itself
Q71: Tell me few important differences Between QTP and Win Runner?
A71.1: qtp:To compare static and dynamic images through qtp
Win runner: to conduct testing on static images only.
QTP: In this three types recording is possible they are 1)GENERAL RECORDING 2)ANALOG RECORDING 3)LOW LEVEL
RECORDING
WINRUNNER: In Win Runner two types of recording is possible
they are 1)CONTEXT SENSITIVE RECORDING 2)ANALOG RECORDING
A71.2: 1.QTP supports different technologies like SAP applications, Macromedia applications, PeopleSoft etc which is not supported by Win Runner
Comparing to win runner it's a user friendly tool. Using the QTP we can generate the clear results.
We used to write the code in win runner is TSL and similarly it's like C. QTP supports the VBS.
A71.3: 1. QTP allows even novice testers to be productive in minutes. You can create a test script by simply pressing a Record button and using an application to perform a typical Business process. Each step in the business process is automated documented with a plain-English sentence and screen shot. Users can easily modify, remove, or rearrange test steps in the Keyword View.
2. QTP can automatically introduce checkpoints to verify application properties and functionality, for example to validate output or check link validity. For each step in the Keyword View, there is an Active Screen showing exactly how the application under test looked at that step. You can also add several types of checkpoints for any object to verify that components behave as expected, simply by
Clicking on that object in the Active Screen.
3. 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.
4. Advanced testers can view and edit their test scripts in the Expert View, which reveals the underlying industry standard VBScript that Quick Test Professional automatically generates. Any changes made in the Expert View are automatically synchronized with the Keyword View.
5.Once a tester has run a script, a Test Fusion report displays all aspects of the test run: a high-level results
overview, an expandable Tree View of the test script 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 Mercury Quality Management, you can share reports across an entire QA and development team.
6. QTP also facilitates the update process. As an application under test changes, such as when a “Login” button is renamed “Sign In,” you can make one update to the
Shared Object Repository and the update will propagate to all scripts that reference this object. You can publish
test scripts to Mercury Quality Management, enabling other QA team members to reuse your test scripts, eliminating duplicative work.

7. Quick Test Professional supports functional testing of all popular environments, including Windows, Web, .Net, Visual Basic, ActiveX, Java, SAP, Siebel, Oracle, PeopleSoft, terminal emulators, and Web services.
A71.4: In win runner 2 types of TSL test script i.e.
1. Main test
2. Compiled module
But in QTP,
Only one type of test script i.e. Main test. It doesn't support compiled module.
A71.5: Main difference between win runner & QTP is QTP Supports .net Applications & Full fledge java Applications, these are not supported by win runner.
QTP having 9 check points where win runner is having 4 checkpoints.
We can create reusable action in QTP but not in winner.
These are the major differences.

Q72: Use of Multiple Actions in QTP?
A72: When we create a new test, it contains one action. by dividing ur tests into multiple actions; we can design more modular and efficient tests.
Q73: can we run the scripts of qtp 8.2 in the qtp7.0?
A73: No, because 8.2 is the advanced version(add some additional properties) of 7.0.so,we run the scripts of qtp 7.0 in qtp 8.2

Q74: How to covert a String to an integer?
A74: you can use cint function
Cint (10) will convert integer 1


Q75: Scalability testing comes under in which tool?
A75.1: Scalability testing comes under performance testing. Load testing, scalability testing both are same.
A75.2: scalability testing ors load testing or capability testing means performance testing, it comes under load runner testing tool
Q76: What is Object Spy?
A76.1: Object Spy is used to view the Run time and Test Object properties and methods of application
A76.2: Object Spy is used to read the object properties & the physical description.
Q77: what is the use of VIRTUAL OBJECTS? explain ?
A77: To enable Quick Test to click at the required coordinates during a run session, you can define a virtual object for an area of the bitmap, which includes those coordinates, and map it to the button class. When you run a test, Quick Test clicks the bitmap in the area defined as a virtual object so that the Web site opens the correct destination page.
Q78: Can u call win Runner scripts from QTP?
A78: Yes we can call the Win Runner scripts from QTP using following function:
TSLTest.RunTestExfrom the Expert view or Call to Win Runner test Dialog box
Q79: How to create a Runtime property for an object in QTP?
A79: Using GetROProperty()

Q80: What is the current version of QTP?
A80: Mercury released beta version not full fledge 9.0
Q81: How to open any application during Scripting in QTP?
A81.1: you can launch any exe files using following code
systemUtil.Run "PATH\Filename.EXE"
Ex:
systemUtil.Run "C:\Calc.exe"
A81.2: invoke application (PATH\Filename.EXE")
Q82: What is keyword view and Expert view in QTP?
A82: Quick Test’s Keyword Driven approach, test automation experts have full access to the underlying test and object properties, 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 Quick Test Professional automatically
generates. Any changes made in the Expert View are automatically synchronized with the Keyword View.

Q83: can we enable smart identification for test object
A83.1: We can do using 'Enable Smart Identification' check box in 'Object Identification' in Tools menu.
A83.2: Tools->Object identification->check the check box Enable smart identification
Q84: What is smart identification?
A84: Smart identification comes into picture when Quick Test fails to recognize an object uniquely using the recorded
Properties. It follows the following process to identify the object:
1.Quick Test “forgets” the recorded test object description and creates a new object candidate list containing the objects (within the object’s parent object) that match all of the properties defined in the base filter property list.
2.From that list of objects, Quick Test filters out any object that does not match the first property listed in the Optional Filter Properties list. The remaining objects become the new object candidate list.
3.If the new object candidate list contains more than one object, then step 2 is repeated with the second property
Listed in Optional Filter Properties list.
4.Step 3&4 are repeated until an the object in recognized uniquely.
Q85: What type of VB script u had done in expert view?
A85: In Expert view we can use the VB keyword for scripting like Function:
1. Mid Returns a specified number of characters from a string.
2. Strcom Returns a value indicating the result of a string comparison.
3. Instr Returns the position of the first occurrence of one string within another.
4. Isdate Returns a Boolean value indicating whether an expression can be converted to a date.
so many functions are there that you can use in the expert view.
Q86: I have recorded a test over web application (with IE6.0) in analog mode. But, while running it my test gets failed. Why? (Note: my systray has 3 open web applications)
A86: QTP provides an option to enter the url on which you are going to run the script. If u doesn’t provide this, the script might NOT recognize the url as you have said you have opened 3 IE windows.
Q87: What are Environment Variables?
A87: In qtp the variable which you have in one action cant be used in some other action, so by using environment variables we can use the variables in one action in to another action.
Q88: I have 5 no. of Action in my Test. Out off which i should make 3rd action as my start-up action. How should i make it?
A88: The only way we can do is through the "Test Flow".
You can switch to the "Keyword View" and choose "Toolbars" under "View" and then choose "Action". This will provide u with a new combo box where u can choose "Test Flow". Then u can drag and arrange the Actions in which ever order u want them to get executed.
Q89: How to suppress warnings from the "Test results page"?
A89.1: if you want Pass result in the Result page
Reporter.reportevent micPass ...
if you want fail result in the Result page
Reporter.reportevent micFail...
if you want Warning result in the Result page
Reporter.reportevent micWarning...
if you don't want any result symbol only u want text in the Result page
Reporter.reportevent micDone...

A89.2: From test result window, Click View->Filter menu then uncheck the warning check box to filter the warning from the test result.
Q90: Which object repository we use in real time and can we merge 2 object repository and how?
A90: There are usually two types of object repository
1. Shared Mode (.Tsr)
2. Per-Action (.Mtr)
We usually use 1.Shared Mode (.Tsr) object repository.
We can merge two object repositories. If you go to
QTP-->Test-->Settings-->Resources
You can use the Resources tab of the Test Settings dialog box to associate specific files with your test, such as VBScript library files and Data Table files, and to specify the object repository mode and file to use for your test
Q91: What is Active Screen in QTP?
A91: In Active Screen window, QTP captures AUT screens and highlights the object on which we perform action during recording.
Q92: when you press a link it displays "the page cannot be displayed" then as a tester how you will find the problem, what type of problem must be it?
A92: If we can’t predict that specified error is occurred at specified event then we will go for the recovery scenario. This handles the four types
1. Pop-up window
2. Object state
3. Test run error.
4. Applicatin crash
Q93: How to capture screen shots when an error occurs?
A93.1: If (----------) Then 'Error Occurs
Browser ("abcd").micType micALT+micPRTSCR
A93.2: Browser ("browser_name").Page ("page_name").Capture Bitmap
"C:\snap.bmp"
Q94: What do you do if QTP doesn't recognize object, what action should be taken?
A94.1: first of all we have find the object by means of object repository if it is not identifying the nature of the object we can go for object identification ,even though if QTP is not recognizing the object we can map the object by means of virtual manager wizard.
A94.2: Using Virtual Object wizard Qtp,
Other one is Smart Identification.
A94.3: QTP does not recognize the object means, you don’t have proper add-ins. In this case, QTP treats the objects as non-
Standard objects. We can map these non-standard objects to standard objects by using virtual object wizard. Once mapped successfully, QTP can identify the objects.
Q95: How to handle Run-time errors?
A95: QTP have Recovery scenario concept we can handle run time error through Recovery Scenario.

Q96: How to use Regular Expressions in QTP? give an example.
A96: In QTP, dealing of Regular Expressions and varying object descriptions can be handled by using Description Programming.
An example of using Regular expression is:
u just record yahoo login operation and click on Inbox link.
Assume u got 10 new mails, then it shows like Inbox (10).
Read one mail, now it shows like Inbox (9). Now try to play the recorded script. It wont work. Now use Regular expression in Inbox link like:
"Inbox.*". At that time it will work.

Q97: Can the mode of object repository be change during run time? E.g. if the mode is per-action during design time can i change it to shared and vice-versa? Any scripting possible?
A97: Once if we save any of the two modes, we cannot change them in to other mode. Because the Object Repository type option
box under Resources Tab becomes disable. Using script also it is not possible, the same problem comes here also
Q98: Explain the check points in QTP?
A98: 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 an 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 Accessibility 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

Q99: How to retrieve the property of an object in QTP?
A99: using Getroproperty("text") we will find out the what ever object properties u want other wise by using object spy also we will get object properties

Q100: What are the types of Object Repositories in QTP?
A100: 1 per section rep (.mtr)
2 shared object repository (in real time we use this).tsr

Q101: what r advance features u had done in QTP?
A101: 1. I used regular expression concept.
2. Test Batch run.
3. Calling existing action.

Q102: How to change the run-time value of a property for an object in QTP?
A102: suppose if u want to change runtime property of the edit box simply type
Browser ("").page ("").winedit ("username").set "bhaskar"
Q103: How to change the run-time value of a property for an object in QTP?
A103: Use 'SetToProperty' method of an object to change the property of object at run-time....
Example:
Browser ("").page ("").winedit
("Username").setToProperty "Property", Value Property can be any physical property of the object such as Name, type, color........

Q104: Use of Debug Viewer?
A104: Debug viewer is used to view, set, or modifies the current value of object and variables in test when it stops at break point to look at the values of variables at run time for easy debugging.
Q105: What is the enhancements u did after recording ur script?
A105: After recording script:
* Placing for loop or If loop in order to get the messages as the operation passes or fails.
* Adding the Checkpoints in order to check the functions.
* Doing parameterization in order to using the multiple data for more than one iteration or easy data changes.
Q106: How to merge object repositories?
A106: In QTP8.2 provide a facility to add repositories. When u installed qtp 8.2 software to show a option in Tools Merge object Repositories. Through which U can add object Rep.

Q107: Difference between Low-Level and Normal Recording Modes?
A107.1: Low-Level Recording: Is useful if the exact coordinates of the object are important for your test.
Normal recording: Is useful when the recording operations that cannot be recorded at the level of an object.
A107.2: Low level record is used to record the session even the object is not recognized by the QTP
A107.3: Normal Level Is Object Context Level; where QTP recognize object with Physical Description Of only interacted object.
Low-Level Recording—enables you to record on any object in your application, whether or not Quick Test recognizes the specific object or the specific operation. This mode records at the object level and records all run-time objects as Window or Win Object test objects. Use low-level recording for recording in an environment or on an object not recognized by Quick Test. You can also use low-level recording if the exact coordinates of the object are important for your test or component.
Q108: What is API?
A108: Application program interface

Q109: What is the differnce between action & script?
A109: A sequence of related statements is called "Action".
But a script will contain more than one Action
Q110: How you handle Pop-up windows which are dynamically changing in Runtime?
A110: We use smart-identification for this

Q111: what happen in object repository (shared)if we call an existing action from an external action ? and what happen in object repository (per action)if we call an existing action from an external action ?
A111: The existing action already recorded the objects into object repository pertaining to the when you call the external action; it will add the objects to the existing one.
Q112: How to export QTP results to an ".xls" file?
A112.1: In qtp automatically .xls file will export to result window
A112.2: Datatable.export stmt
Q113: How to "Turn Off" QTP results after running a Script?
A113: Go To Menu. Tools > Options > Run (Tab)
Uncheck the "View Results when run session ends"
It will turn Off the QTP.
Q114: How to open an application through scripting?
A114.1: We can use SystemUtil.run method or Invoke Application statement to open the application.
A114.2: Suppose you trying the web application use the following script
web_browser_invoke (URL);
A114.3: For web applications we use
web_browser_invoke (IE,"http://mail.yahoo.com/");
For other applications:
invoke_application ("uday.exe","Directory
Path", SW_SHOW/SW_SHOWMAXIMISED/SW_MINIMISED);
A114.4: Browser ("Browser").Navigate ("URL")
A114.5: Browser = "IE"
StartURL = "www.hotmail.com"
IF Browser = "IE" THEN
Set IE = CreateObject ("InternetExplorer.Application")
IE.Visible = true
IE.Navigate StartURL
END IF

Q115: How to change the Default synchronization method time and where?
A115.1: Test->Settings->select Run tab and change the default value
A115.2: Default synchronization method time can be changed by:
In Menu Test->Settings, choose the tab "Run", change the Object synchronization timeout.
Q116: what is the Command used to start the QTp from Run.(start-> Run)
A116: systemutil.run"path of the file"
Q117: Tell me the situations where we will use Data Driven?
A117.1: If v r testing an application which generates reports on different dates, login page, an application which uploads different files on different dates etc.
A117.2: When u want to test functionality of an application with multiple sets data then u go to DATA DRIVEN TEST.
It is very difficult to test in manual for that we go to DATA DRIVEN TEST.

Q118: Explain QTP testing process?
A118: QTP testing process is
1: Preparing for Record and Run settings
2: Develop the basic script
3: Edit the script
4: Debug the script
5: Run the script
6: Analyze the results
7: Summarize the results
Q119: How u perform exception handling in QTP? what is other name for this?
A119: The other name for Exception handling is Recovery scenario.
There are 4 Triggers
1. Popup Window.
2. Object State.
3. Test Error.
4. System Crash.
The solution is
1. Function call.
2. Keyboard or mouse Operation.
3. Restart.

Q120: Use of environment variables?
A120.1: Environment values can be used in any Action of your script, those act as Global Variables
A120.2: The variables declared in Action1, we cannot able to use them in Action2. So, using Environment key we can access any variable in any Actions. These variables are known as environment variables.
Q121: Synchronization methods?
A121: In QTP, Only one type of synchronization method is there.
Object/window property.
*

Q122: How Does Run time data (Parameterization) is handled in QTP?
A122: 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.
Q123: What is throw object?
A123: It is exception handling
Q124: What is the limitation to XML Checkpoints?
A124: An XML checkpoint checks the contents of individual XML data files or XML documents that are part of your Web application.
Q125: What is the use of Accessibility check point?
A125.1: Accessibility check point identifies areas or ur web site that may not conform to the W3C web content accessibility guidelines.
A125.2: When u develop a web application it is necessary to fallow the W3C guidelines. the Accessibility Check Point is used to find whether the web application fallow the W3C guidelines or not.
Q126: We are submitting data one form to another form.defaultly it is time period set as 5sec. but it is taken 15sec what to do?
A126: Synchronizing the data or we can also use the delay () function with the specified time intervals.

0 comments:

Post a Comment