Software Testing Experience

Thursday, April 24, 2008

QTP Frequently Asked Questions Part - 2

66)What are the types of Object Repositories in QTP?

A)There are two types of Object Repository files in QTP

1) Per-Action Repository file The Extension of Per-Action is .mtr
2) Shared Repository file The Extension of Shared is .tsr


We can use Per-Action as Shared one, but we cannot use Shared Object Repository as per-Action mode. when u use like this both file uses same extensions i.e (.tsr)


67)How QTP recognizes Objects in AUT?
A)through object repository qtp can recognize the object in

68)Explain QTP Testing process ?

A)QTP testing process is
1:
Preparing for Record and Run settings
2:Develope the basic script
3:Edit the script

4:Debug the script 5:Run the script 6:Analyze the results 7:Summarise the results

69)how you test broken link using the automated tool QTP ?

A)Gofor Insert->Standered check point->select one object->then select it's parent page->

so i t displays page ckeck point properties then select "Broken link" option from that wizard This the way we can check the broken links..

70)what is batch run ?

A)In QTP, here v do not require to call the tests by scripting.

We can simply run them by selecting the required tests from Test batch runner option and we can stop required tests during test run and the results will be stored in their corresponding result folders

71)What type of VB script u had done in expert view?

A)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.

72)Which object repository we use in real time and can we
merge 2 object repostiory and how?

A)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 repository.If you go to

QTP-->Test-->Settings-->Resourses
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

73)can we enable smart identification for test object

A)Tools->Object identification->check the check box Enable smart identification

74)Can anybody give the script to addsheet, add column,add
values under that column in the rows??

A)DataTable.AddSheet("MySheet").AddParameter "Parametername","Value"
75)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?

A)i'm afraid thats not the correct answer. As far as i know 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.

Go to keyword view.
Click on the drop down and select test flow.
Now change the order of flow by dragging the required action to top.

76)how to get the object property

A)using getroproperty or using objspy or in the treeview we can select particular object and right-clicking we can see all ties right any thing mistake make it correct Just spy that obect by using GUI spy,then it will show the object properties,if it is not having the standered properties then go for GUI mapconfiguration and add whatever the properites u want

77)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

A)syncronization is the best way to do that perticular task wait() function sends wr in sleepmode,it's wastage of the time if wrong plz....


Synchronization the data or we can also use the delay() function with the specified time intervals.


78)One build is delivered. in that build button name is submit.but in the next buit that name of the button changed as login.are u continue with previous recorded script or u make any changes?


A)So we want to change the logical name of the button through regedit.exe ., ie after executing this we can change the logical name of that particular button U change the logical name of the object which object u change in object repository. or u add new object to the object repository.


79)When The Low Level Recording is Used in QTP


A)Some of the objects are not recognising 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.


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.Sometimes low level recording is used to record unexpected defects that arise due to mouse movement and key strokes.


80)what is qtp automation frame work,what is the use of that
frame work?


A)framework is nothing but separating each and everything related 2 script such as env,tests,or,functions,ip files,results etc


81)Inserting a Call to Action is not Importing all columns in Datatable of globalsheet. Why?


A)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.


82)How to make arguments optional in a function?


A)Suppose there is alogin 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 countinues but not stop


for example


Optional.Dialog("Login").WinEdit("Name:").Set "ssss"


these line make an optional now


83)What is the limitation to XML Checkpoints?


A)An XML checkpoint checks the contents of individual XML data files or XML documents that are part of your Web application.


84)How to Import data from a ".xls" file to Data table during
Runtime.


A)datatable.Import("file path")


datatable.Importsheet("file path",sheetid)


85)How many ways we can parameterize data in QTP?


A)There are four types of parameters.


1.Test, action or component parameters.


2.Data Table parameters.


3.Environment variable parameters.


4.Random number parameters.


86)What is the use of Accessibility check point?


A)when u develop a web application it is necessary to fallow the W3C guidelines. the Accesbility Check Point is used to find wether the web application fallow the W3C guidelines or not.


87)How to open an application through scripting?


A)For web applications we use


web_browser_invoke(IE,"http://mail.yahoo.com/");


for other applications :


invoke_application("uday.exe","DirectoryPath",SW_SHOW/SW_SHOWMAXIMISED/SW_MINIMISED);


Browser = "IE"


StartURL = "www.hotmail.com"


IF Browser = "IE" THEN


set IE = CreateObject("InternetExplorer.Application")


IE.Visible = true


IE.Navigate StartURL


END IF


88)How to retrive the property of an object?


A)using GetROproperty()


89)How to create runtime property for an object?


A)Browser("abcd").SetROProperty("abs_x",158)


90)How to add a runtime parameter to a data sheet?


A)Datatable.GetSheet("Global").AddParameter("NewColumn_Name")


This adds a new column called NewColumn_Name in the datatable under Global Sheet


91)Tell me few important difference Between QTP and WinRunner?


A)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 ActiveScreen 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 ActiveScreen.


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 QuickTest 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 TestFusion 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.QuickTest 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.TP Supports .netApplications & Full fledge java Applications, these are not suppoerted by winrunner .


QTP having 9 check points where winrunner is having 4 check


points.


we can create reuasble action in QTP but not in winner.


these are the major differences.


92)How to export QTP results to an .xls file?


A)Datatable.Export("C:ResultsActuals.xls")


93)How many type of status messages are there ..explain?


A)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.


94)How to get line numbers in your editor in expert view?


A)Tools -> EditorOptions -> General -> Show Line Numbers


95)difference Between LowLevel and Normal Recording Modes?


A)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 QuickTest recognizes the specific object or the specific operation. This mode records at the object level and records all run-time objects as Window or WinObject test objects. Use low-level recording for recording in an environment or on an object not recognized by QuickTest. You can also use low-level recording if the exact coordinates of the object are important for your test or component.Low-Level Recording:Is useful if the exact coordinates of the object are important for ur test.Normal recording:Is useful when the recording operations that cannot be recorded at the level of an object.


96)Can we do Load Teting with QTP?


A)by using start transaction and end trasaction options we can parially conduct performance testiong.And also by using fata driven testing (or loopina one functionality using for loop we can parially conduct load testing. But this can compare with loadrunner.


97)Which Databases supports for QTP?


A)Oracle,MS-Access, SQL Server


98)What is the use of Regular expression?


A)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.depends on events our application objects (or)windows lables are varying .To create datadriven test on this type of objects and window Test Engineers are inserting regular expression in corresponding gui map entry.


99)What is the current version of QTP?


A)Mercury released beta version not full fledge 9.0


100)How you handles Pop-up windows which are Dynamically changing in Runtime?


A)We use smart-identification for this


101)What are the enhancements u did after recording ur script?


A)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.


102)Explain about reusable actions?


A)if we eant 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.


103)Tell me the situations where we will use Data Driven?


A)If v r testing an application which generate reports on different dates, login page, an application which uploads different files on different dates etc then 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.


104)What is output value?


A)An Outputvalue is a step in which one or more values are captured at a specific point in Test and stores for the duration of Run.An output value is a value retrived 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 retrived during a test in other parts of the test.


105)How to connect to data base?


A)Public Function database(Str,SQLstr,outResult1,outResult2)


'//Variable Declarations


Dim objConn, rsOut




'//Create a connection object.


Set objConn = CreateObject("ADODB.Connection")




'//Create a ResultSet Object to store the results.


Set rsOut = CreateObject("ADODB.Recordset")




'//Open the Created Connection object


objConn.Open Str




'//Pass the SQL query string and retrieve the Results


through the connection object


rsOut.Open SQLstr,objConn




If rsOut.EOF <> True AND rsOut.BOF <> True Then




'//Store the different column values


retrieved from a record in different variables.


outResult1=rsOut("col1")




outResult2=rsOut("col2")




rsOut.movenext


End If




End Function


106)Use of Debug Viewer?


A)Debug viewer is used to view, set ,or modify the current value of object and varaibles in test when it stops at break point to look at the values of variables at run time for easy debugging


107)How u perform Batch Program in QTP?


A)we can perform bacth programming in QTP using tool called Test Batch Runner which comes with QTP by adding the paths of all Tests which are need to be grouped and executing same.


108)What is Virtual object wizard in QTP?


A)Virtual Object Wizard in the QTP is used to map an object, which is not recognized by the QTP as Virtual Object in order to recognize it during the Run time virual object wizard is used to recognize object which were fail to recognize in any manner.but is final solutions and it is not at all advisable.becuase it recognize the objects by using coordianates, so if a single fixel is changed also it fails.


109)How many types of Recordings are there in QTP and what are they?


A)There are 3 types of Recording modes available in QTP.


They are



1, Standard Recording mode: It is default mode


2, Analog Recording mode


3, Low Level Recording mode


110)How to parameterize in QTP?


A)Paramaterization can be done in this way:


#1. In the sheet "Action 1", write some parameters undercolumn A like name1, name2.


#2. In the code,


Browser("browser_name").Page("page_name).Webedit("textbox_name").Set Datatable("A","Action 1").


111)How to make an Action as reusable?


A)Go to Tree View. Select the action and right click. Go to Action Properties and check the chekbox 'Reusable acion'.


112)Can u call winRunner scripts from QTP?


A)Yes We can Call the Win Runner scripts from QTP using follwing function: TSLTest.RunTestEx from the Expert view or Call to Win Runner test Dialog box



113)Associated files in QTP?


A)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.


114)What is Expert view?


A)Expert view is one view in which VBscript is generated during recording.


115)What is Tree view?


A)It is an icon based view generated during recording by QTP.


116)How many check points are there in QTP and what are they?


A)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.


117)Recovery Manager means..?


A)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.


118)What is runtime objects and test objects? What is the difference between them?


A)TEST OBJECT:A test object is an object that QuickTest creates in the test to represent the actual object in the application.QTP stores information about the object that will help to identify and check the object during the test run.


RUNTIME OBJECT:Is an actual object in the application on


which methods are performed during the test run.


119)Use of Multiple Actions in QTP?


A)When v create a new test, it contains one action.by dividing ur tests into multiple actions, v can design more modular and efficient tests.reusablility,reliability,clear


120)What is Active Screen in QTP?


A)In Active Screen window, QTP captures AUT screens and highlights the object on which we perform action during recording.


121)Per-Action Vs Shared repository?


A)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 respository.


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.


Per-action:In qtp we select per-action mode then for each action it creates a object repositary.This type of process is memory westage process.


Shared repository:In qtp we select shared mode then for all actions it creates one object repositary in a test.This not memory westage process we can this repository in other tests also.

Labels:

posted by Balaji Visharaman at 12:49 AM

0 Comments:

Post a Comment

<< Home