Wednesday, April 8, 2009

QTP Interview Questions 6

"1.Object Repository types, which and when to use?
Deciding which object repository mode to choose the default object repository mode and 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 r creating simple recored 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 expert 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 test that test elements of the same application, interface or set of objects.
you expert the object properties in your application to change from time to time and / or you regularly need to up date or modify test object properties.
You often work with multi action tests and regularly use insert copy of action and insert called to action options.

2. Can we script any test case with out having object repository ? or using object repository is a must?
No. You can script with out object repository by knowing the window handlers, spying and recognizing the objects logical names and properties available.

3. How to execute a WR script in QTP?
a)TSL test, test path, test set.[parameters]–>used in QTP 6.0 for backward compatibility.
Parameters:the test set with in 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 a quality center, this parameter is ignored. Ex . TSL test “D:\Tset1″
B) TSL test.runtestex testpsth,run minimize, close app [parameter] TSL test.runtestex “C:\Win Runner/Tests/Basic_Flight”,True,False,”My Value”.
Close App:indicates whether to close the WR application when the WR tset run ends.
Parameter: up to 15 WR function argument.

4.How to handle time errors?
On Error Resume next:causes execution to continue with the statement immediately following the statement that causes the run time error, or with the statement immediately following tie most recent call out of the procedure containing the on error resumes next statement.
This allows execution to continue despite a run time error. you can then build the error handling routine inline with in the procedure using “Err” object MSG box “error no:” “&”.”&Err.description” “&Err.source& context”.

5.How to change the run time value of property for an object?
Set to property 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.

6. How to retrieve the property of an object?
Using GETRO property.

7. How to open any application during scripting?
Systemutil, object used to open and close applications and processes during a run session. A 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. Ex. “notepad.exe”
systemutil.close descendant processes (closes all the processes open by QTP ).

8.Types of properties that QTP learns while recording?
Mandatory and assistive. In addition to recording the mandatory and assistive properties specified in the object identification dialog box, QTP can also record a backup ordinal identifier for each test object. The ordinal identifier assigns the object in numerical value that indicates it’s order relative to other objects with an otherwise identical description (objects that have the same vales foe all properties specified in the mandatory and assistive property list). This ordered value enable QTP to create a unique description when the mandatory and assistive properties are not sufficient to do so.

9.What is the extension of script and object repository files?
Object repository: .TSR, script: .MTS, Excel: default.ELS

10. How to suppress warning from the test result page?
From the test result viewer “tools > filters > warnings ” must be unchecked.

11.When we try to use test run option run from step, the browser is not launching automatically? Why?
This is default behavior.

12. Does QTP is unicode compatible ?
QTP 6.5 is not but QTP 8.0 is expected to be Unicode compatible by end of Dec 2004.

13.How to turn off QTP results after running a script?
Go to tools > option > run tab and deselect view results when run session ends. But this suppresses only the result window, but a log will be created and can viewed manually which can not be restricted from getting created.

14.How to get font size of a web edit?

15. Is there any way to automatically update the data source name in data base checkpoints object when we migrate test to a new release?

16. How to verify the cursor focus of a certain field?
Use focus property of GETRO property method

17.Any limitation to XML check points ?
Mercury has determined that 1.4mb is the maximum size of XML file that QTP 6.5 can handle.

18. How to make arguments optional in a function?
This is not possible as default VBS does not support this. Instead you can pass a blank scoring and have a default value if arguments are not required.

19. How to convert a sting to an integer?
CInt ()—> a conversion function available.

20. Inserting a call to action is not importing all columns in data table of global sheet. Why?
Inserting a call to action will only import the columns of the action called


No comments:

My Ad