qtp interview questions_sai

60
Qtp Interview Questions faced 1. If we have duplicate buttons in the page, but we have only one object information in object repository then wt we will do. Answer: We should add second object to object Repository or we should write descriptive programming for that. 2. If we want to find how many spaces in that particular file, how we can do that. 3. How we will test Window API using QTP. 4. Wt diff between Function & Sub : function returns value where as sub won’t return anything. 5. How we can connect data base using QTP 6. Variant Type in QTP 7. In QTP which is default data type: Variant 8. What is diff between stores & voltes: specs & object stores in Voltes – files physically stored in stores? 9. What is policy? : All business roles 10. What are pre-requisites for releasing part in OOTP: specs & files checked in &it should have attached ECO. 11.how u will handle UI with QTP?? : by Frame work 12. How many check points in QTP: 10 13. How u will implement frame work for qtp 13. when u r migrating QTP 8.2 to 9.1 what are issues u get? 14. Wt is major diff between Client Server & Web Application: 15. Wt we will come to know after peer Review. 16 wt we will get after going through defect summary report 17 how we will do Estimation 18 wt is diff between Load and Stress testing 19 wt is scalability testing RE: what is the difference between testing in client-s... Client server Technology: 1. Number of clients is predicted or known 2. Client and server are the entities to be tested 3. Both server and client locations are fixed and known to the user 4. Server to server interaction is prohibited

Upload: api-3811145

Post on 14-Nov-2014

119 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Qtp Interview Questions_sai

Qtp Interview Questions faced

1. If we have duplicate buttons in the page, but we have only one object information in object repository then wt we will do.Answer: We should add second object to object Repository or we should write descriptive programming for that.2. If we want to find how many spaces in that particular file, how we can do that.3. How we will test Window API using QTP.4. Wt diff between Function & Sub : function returns value where as sub won’t return anything.5. How we can connect data base using QTP6. Variant Type in QTP7. In QTP which is default data type: Variant8. What is diff between stores & voltes: specs & object stores in Voltes – files physically stored in stores?9. What is policy? : All business roles 10. What are pre-requisites for releasing part in OOTP: specs & files checked in &it should have attached ECO.11.how u will handle UI with QTP?? : by Frame work12. How many check points in QTP: 1013. How u will implement frame work for qtp13. when u r migrating QTP 8.2 to 9.1 what are issues u get?14. Wt is major diff between Client Server & Web Application: 15. Wt we will come to know after peer Review.16 wt we will get after going through defect summary report17 how we will do Estimation18 wt is diff between Load and Stress testing19 wt is scalability testing

RE: what is the difference between testing in client-s...

Client server Technology:1. Number of clients is predicted or known

2. Client and server are the entities to be tested 3. Both server and client locations are fixed and known to the

user 4. Server to server interaction is prohibited 5. Low multimedia type of data transaction

6. Designed and implemented on intranet environment

Web based Technology 1. Number of clients is difficult to predict (millions of clients)

2. Client, Server and network are the entities to be tested 3. Server location is certain, client locations are not certain

4. Server to server interaction is normal 5. Rich multimedia type of data transaction

6. Designed and implemented on internet environment 

Page 2: Qtp Interview Questions_sai

:

Q.What is difference between client server and Web Testing?Vijay: Well Srividya I would like to add one more testing type i.e Desktop Testing in this discussion. So now we have three testing types Desktop application testing, Client server application testing and Web application testing.

Each one differs in the environment in which they are tested and you will lose control over the environment in which application you are testing, while you move from desktop to web applications.

Desktop application runs on personal computers and work stations, so when you test the desktop application you are focusing on a specific environment. You will test complete application broadly in categories like GUI, functionality, Load, and backend i.e DB.

In client server application you have two different components to test. Application is loaded on server machine while the application exe on every client machine. You will test broadly in categories like, GUI on both sides, functionality, Load, client-server interaction, backend. This environment is mostly used in Intranet networks. You are aware of number of clients and servers and their locations in the test scenario.

Web application is a bit different and complex to test as tester don’t have that much control over the application. Application is loaded on the server whose location may or may not be known and no exe is installed on the client machine, you have to test it on different web browsers. Web applications are supposed to be tested on different browsers and OS platforms so broadly Web application is tested mainly for browser compatibility and operating system compatibility, error handling, static pages, backend testing and load testing.

What is the difference between client-server testing and web based testing and what are things that we need to test in such applications?

Ans: Projects are broadly divided into two types of:

2 tier applications 3 tier applications

CLIENT / SERVER TESTINGThis type of testing usually done for 2 tier applications (usually developed for LAN)Here we will be having front-end and backend.

The application launched on front-end will be having forms and reports which will be monitoring and manipulating data

Page 3: Qtp Interview Questions_sai

E.g: applications developed in VB, VC++, Core Java, C, C++, D2K, PowerBuilder etc.,The backend for these applications would be MS Access, SQL Server, Oracle, Sybase, Mysql, Quadbase

The tests performed on these types of applications would be- User interface testing- Manual support testing- Functionality testing- Compatibility testing & configuration testing- Intersystem testing

WEB TESTINGThis is done for 3 tier applications (developed for Internet / intranet / xtranet)Here we will be having Browser, web server and DB server.

The applications accessible in browser would be developed in HTML, DHTML, XML, JavaScript etc. (We can monitor through these applications)

Applications for the web server would be developed in Java, ASP, JSP, VBScript, JavaScript, Perl, Cold Fusion, PHP etc. (All the manipulations are done on the web server with the help of these programs developed)

The DBserver would be having oracle, sql server, sybase, mysql etc. (All data is stored in the database available on the DB server)

The tests performed on these types of applications would be- User interface testing- Functionality testing- Security testing- Browser compatibility testing- Load / stress testing- Interoperability testing/intersystem testing- Storage and data volume testing

A web-application is a three-tier application.This has a browser (monitors data) [monitoring is done using html, dhtml, xml, javascript]-> webserver (manipulates data) [manipulations are done using programming languages or scripts like adv java, asp, jsp, vbscript, javascript, perl, coldfusion, php] -> database server (stores data) [data storage and retrieval is done using databases like oracle, sql server, sybase, mysql].

The types of tests, which can be applied on this type of applications, are:1. User interface testing for validation & user friendliness2. Functionality testing to validate behaviors, i/p, error handling, o/p, manipulations, services levels, order of functionality, links, content of web page & backend coverage’s3. Security testing

Page 4: Qtp Interview Questions_sai

4. Browser compatibility5. Load / stress testing6. Interoperability testing7. Storage & data volume testing

A client-server application is a two tier application.This has forms & reporting at front-end (monitoring & manipulations are done) [using vb, vc++, core java, c, c++, d2k, power builder etc.,] -> database server at the backend [data storage & retrieval) [using ms access, sql server, oracle, sybase, mysql, quadbase etc.,]

The tests performed on these applications would be1. User interface testing2. Manual support testing3. Functionality testing4. Compatibility testing5. Intersystem testingSome more points to clear the difference between client server, web and desktop applications:

Desktop application:1. Application runs in single memory (Front end and Back end in one place)2. Single user only

Client/Server application:1. Application runs in two or more machines2. Application is a menu-driven3. Connected mode (connection exists always until logout)4. Limited number of users5. Less number of network issues when compared to web app.

Web application:1. Application runs in two or more machines2. URL-driven3. Disconnected mode (state less)4. Unlimited number of users5. Many issues like hardware compatibility, browser compatibility, version compatibility, security issues, performance issues etc.

As per difference in both the applications come where, how to access the resources. In client server once connection is made it will be in state on connected, whereas in case of web testing http protocol is stateless, then there comes logic of cookies, which is not in client server.

For client server application users are well known, whereas for web application any user can login and access the content, he/she will use it as per his intentions.

Page 5: Qtp Interview Questions_sai

So, there are always issues of security and compatibility for web application.

VBScript Data Types

VBScript has only one data type called a Variant. A Variant is a special kind of data type that can contain different kinds of information, depending on how it is used. Because Variant is the only data type in VBScript, it is also the data type returned by all functions in VBScript.

At its simplest, a Variant can contain either numeric or string information. A Variant behaves as a number when you use it in a numeric context and as a string when you use it in a string context. That is, if you are working with data that looks like numbers, VBScript assumes that it is numbers and does what is most appropriate for numbers. Similarly, if you're working with data that can only be string data, VBScript treats it as string data. You can always make numbers behave as strings by enclosing them in quotation marks (" ").

Variant Subtypes

Beyond the simple numeric or string classifications, a Variant can make further distinctions about the specific nature of numeric information. For example, you can have numeric information that represents a date or a time. When used with other date or time data, the result is always expressed as a date or a time. You can also have a rich variety of numeric information ranging in size from Boolean values to huge floating-point numbers. These different categories of information that can be contained in a Variant are called subtypes. Most of the time, you can just put the kind of data you want in a Variant, and the Variant behaves in a way that is most appropriate for the data it contains .

The following table shows subtypes of data that a Variant can contain.

Subtype DescriptionEmpty Variant is uninitialized. Value is 0 for numeric variables or a zero-

length string ("") for string variables.Null Variant intentionally contains no valid data. Boolean Contains either True or False.Byte Contains integer in the range 0 to 255. Integer Contains integer in the range -32,768 to 32,767. Currency -922,337,203,685,477.5808 to 922,337,203,685,477.5807.Long Contains integer in the range -2,147,483,648 to 2,147,483,647.Single Contains a single-precision, floating-point number in the range -

Page 6: Qtp Interview Questions_sai

3.402823E38 to -1.401298E-45 for negative values; 1.401298E-45 to 3.402823E38 for positive values.

Double Contains a double-precision, floating-point number in the range -1.79769313486232E308 to -4.94065645841247E-324 for negative values; 4.94065645841247E-324 to 1.79769313486232E308 for positive values.

Date (Time) Contains a number that represents a date between January 1, 100 to December 31, 9999.

String Contains a variable-length string that can be up to approximately 2 billion characters in length.

Object Contains an object.Error Contains an error number.

Assigning Values to Variables

Values are assigned to variables creating an expression as follows: the variable is on the left side of the expression and the value you want to assign to the variable is on the right. For example:

B = 200

Scalar Variables and Array Variables

Much of the time, you only want to assign a single value to a variable you have declared. A variable containing a single value is a scalar variable. Other times, it is convenient to assign more than one related value to a single variable. Then you can create a variable that can contain a series of values. This is called an array variable. Array variables and scalar variables are declared in the same way, except that the declaration of an array variable uses parentheses ( ) following the variable name. In the following example, a single-dimension array containing 11 elements is declared:

Dim A(10)

Although the number shown in the parentheses is 10, all arrays in VBScript are zero-based, so this array actually contains 11 elements. In a zero-based array, the number of array elements is always the number shown in parentheses plus one. This kind of array is called a fixed-size array.

You assign data to each of the elements of the array using an index into the array. Beginning at zero and ending at 10, data can be assigned to the elements of an array as follows:

A(0) = 256A(1) = 324A(2) = 100

Page 7: Qtp Interview Questions_sai

. . .A(10) = 55

Similarly, the data can be retrieved from any element using an index into the particular array element you want. For example:

. . . SomeVariable = A(8) . . .

Arrays aren't limited to a single dimension. You can have as many as 60 dimensions, although most people can't comprehend more than three or four dimensions. You can declare multiple dimensions by separating an array's size numbers in the parentheses with commas. In the following example, the MyTable variable is a two-dimensional array consisting of 6 rows and 11 columns:

Difference between Function & SubA Function procedure is a series of VBScript statements enclosed by the Function and End Function statements. A Function procedure is similar to a Sub procedure, but can also return a value. A Function procedure can take argumentsa Function procedure has no arguments, its Function statement must include an empty set of parentheses.

Function Celsius(fDegrees) Celsius = (fDegrees - 32) * 5 / 9End Function

A Sub procedure is a series of VBScript statements (enclosed by Sub and End Sub statements) that perform actions but don't return a value. A Sub procedure can take arguments (constants, variables, or expressions that are passed by a calling procedure). If a Sub procedure has no arguments, its Sub statement must include an empty set of parentheses ().

Sub ConvertTemp() temp = InputBox("Please enter the temperature in degrees F.", 1) MsgBox "The temperature is " & Celsius(temp) & " degrees C."End Sub

Retrieving and Setting Test Object Property Values

Page 8: Qtp Interview Questions_sai

Test object properties are the set of properties defined by QuickTest for each object. You can set and retrieve a test object's property values, and you can retrieve the values of test object properties from a run-time object.

When you run your test, QuickTest creates a temporary version of the test object that is stored in the test object repository. You use the GetTOProperty, GetTOProperties, and SetTOProperty methods to set and retrieve the test object property values of the test object.

The GetTOProperty and GetTOProperties methods enable you to retrieve a specific property value or all the properties and values that QuickTest uses to identify an object.

The SetTOProperty method enables you to modify a property value that QuickTest uses to identify an object.

Note: Because QuickTest refers to the temporary version of the test object during the test run, any changes you make using the SetTOProperty method apply only during the course of the test run, and do not affect the values stored in the test object repository.

For example, the following statements would set the Submit button's name value to my button, and then retrieve the value my button to the ButtonName variable:

Browser("QA Home Page").Page("QA Home Page").WebButton("Submit").SetTOProperty "Name", "my button"

ButtonName=Browser("QA Home Page").Page("QA Home Page").WebButton("Submit").GetTOProperty("Name")

You use the GetROProperty method to retrieve the current value of a test object property from a run-time object in your application.

For example, you can retrieve the target value of a link during the test run as follows:

link_href = Browser("Mercury Technologies").Page("Mercury Technologies").Link("Jobs").GetROProperty("href")

How to Fetch date from data base using QTP

Const adOpenStatic = 3Const adLockOptimistic = 3Const adUseClient = 3Set objCon=CreateObject("ADODB.Connection") Set objRec=CreateObject("ADODB.Recordset")objCon.Open "DRIVER={Oracle in

Page 9: Qtp Interview Questions_sai

OraHome92};SERVER={Servername};UID={Username};PWD={Password};DBQ={Dbnmae}"objRec.CursorLocation = adUseClientobjRec.Open "Select {Col name} from tablename",objCon,adOpenStatic,adLockOptimisticWhile(objRec.EOF)    objRec.MoveNext    Msgbox "Result" & objRec.Fields.Item("{Col name}")& vbCrLf Wend

objRec.CloseobjCon.CloseSet objRec=NothingSet objCon=NothingMsgbox "Executed Sucessfully"

How to connect to the Database from QTP?

Answer# 2

Through scripting this is way to connect the databaseExample:-

set conn=Createobject("ADODB.Connection") Srvname="Driver={Microsoft ODBC for Oracle}:Server=DBserver,UID=Sa,Password=sa" conn.open Srvname Set Rec = CreateObject("ADODB.Recordset") SQL="select * from Users" Rec.open SQL ,conn Username=Rec.fields("employee name") Msgbox Username

Re: How to connect to the Database from QTP?

Answer# 6

Thru Self scripting:set conn=createobject("adodb.connection")set rs=createobject("adodb.recordset")' Oracle client is required to be installed on your boxconn.open= "Provider=OraOLEDB.Oracle.1;Password=***;Persis

Page 10: Qtp Interview Questions_sai

tSecurity Info=True;User ID=****;SERVER=****;DataSource=****;DBQ=****;"sql="your sql"rs.open sql,conn

rs.closeset rs=nothing

conn.closeset conn=nothing

QuickTest enables you to add checks to your test or component. A checkpoint is a verification point that compares a current value for a specified property with the expected value for that property. This enables you to identify whether your Web site or application is functioning correctly.

When you add a checkpoint, QuickTest adds a checkpoint to the current row in the Keyword View and adds a Check CheckPoint statement in the Expert View. When you run the test or component, QuickTest compares the expected results of the checkpoint to the current results. If the results do not match, the checkpoint fails. You can view the results of the checkpoint in the Test Results window.

Note: If you want to retrieve the return value of a checkpoint (a boolean value that indicates whether the checkpoint passed or failed), you must add parentheses around the checkpoint argument in the statement in the Expert View. For example:

a = browser("MyBrowser").page("MyPage").check (checkPoint("MyProperty"))

About Choosing the Object Repository Mode

When you plan and create tests, you must consider how you want to store the objects in your test. You can have a separate object repository for each action and store the objects for each action in its corresponding object repository, or you can store all the objects in your test or component in a common (shared) object repository file that can be used among multiple tests.

QuickTest's TestGuard technology enables you to maintain the reusability of your tests or components by storing all the information regarding your test objects in the shared object repository. When objects in your application change, test object information can be updated in one central location for multiple tests or components

Page 11: Qtp Interview Questions_sai

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.

Managing the Testing Process Using Quality Center

You can use QuickTest together with Quality Center (formerly TestDirector), the Mercury centralized quality solution. You can use Quality Center to create a project (central repository) of manual and automated tests and components, build test cycles, run tests and components, and report and track defects. You can also create reports and graphs to help you review the progress of test planning, runs, and defect tracking before a software release.

You can use the Description object to return a Properties collection object containing a set of Property objects. A Property object consists of a property name and value. You can then specify the returned Properties collection in place of an object name in a statement. (Each property object contains a property name and value pair.)

To create the Properties collection, you enter a Description.Create stateme

nt using the following syntax:

Set MyDescription = Description.Create()

Once you have created a Properties object (such as MyDescription in the example above), you can enter statements to add, edit, remove, and retrieve properties and values to or from the Properties object during the run session. This enables you to determine which, and how many properties to include in the object description in a dynamic way during the run session.

Page 12: Qtp Interview Questions_sai

Once you have filled the Properties collection with a set of Property objects (properties and values), you can specify the Properties object in place of an object name in a test statement.

For example, instead of entering:

Window("Error").WinButton("text:=OK", "width:=50").Click

you can enter:

Set MyDescription = Description.Create()MyDescription("text").Value = "OK"MyDescription("width").Value = 50Window("Error").WinButton(MyDescription).Click

Note: When using programmatic descriptions from a specific point within a test object hierarchy, you must continue to use programmatic descriptions from that point onward within the same statement. If you specify a test object by its object repository name after other objects in the hierarchy have been described using programmatic descriptions, QuickTest cannot identify the object.

For example, you can use Browser(Desc1).Page(Desc1).Link(desc3), since it uses programmatic descriptions throughout the entire test object hierarchy.

You can also use Browser("Index").Page(Desc1).Link(desc3), since it uses programmatic descriptions from a certain point in the description (starting from the Page object description).

However, you cannot use Browser(Desc1).Page(Desc1).Link("Example1"), since it uses programmatic descriptions for the Browser and Page objects but then attempts to use an object repository name for the Link test object (QuickTest tries to locate the Link object based on its name, but cannot locate it in the repository because the parent objects were specified using programmatic descriptions).

When working with Properties objects, you can use variable names for the properties or values in order to generate the object description based on properties and values you retrieve during a run session.

You can create several Properties objects in your test or component if you want to use programmatic descriptions for several objects.

Retrieving ChildObjects

You can use the ChildObjects method to retrieve all objects located inside a specified parent object, or only those child objects that fit a certain programmatic description. In order to retrieve this subset of child objects, you first create a description object and add

Page 13: Qtp Interview Questions_sai

the set of properties and values that you want your child object collection to match using the Description object.

Note: You must use the Description object to create the programmatic description for the ChildObjects description argument. You cannot enter the programmatic description directly into the argument using the property:=value syntax.

Once you have "built" a description in your description object, use the following syntax to retrieve child objects that match the description:

Set MySubSet=TestObject.ChildObjects(MyDescription)

For example, the statements below instruct QuickTest to select all of the check boxes on the Itinerary Web page:

Set MyDescription = Description.Create()

MyDescription("html tag").Value = "INPUT"

MyDescription("type").Value = "checkbox"

Set Checkboxes = Browser("Itinerary").Page("Itinerary").ChildObjects(MyDescription)

NoOfChildObjs = Checkboxes.Count

For Counter=0 to NoOfChildObjs-1

       Checkboxes(Counter).Set "ON"

Next

For more information about the ChildObjects method, refer to the QuickTest Professional Object Model Reference.

Using Programmatic Descriptions for the WebElement Object

The WebElement object enables you to perform methods on Web objects that may not fit into any other Mercury test object class. The WebElement test object is never recorded, but you can use a programmatic description with the WebElement object to perform methods on any Web object in your Web site.

For example, when you run the statement below:

Browser("Mercury Tours").Page("Mercury Tours").WebElement("Name:=UserName", "Index:=0").Click

Page 14: Qtp Interview Questions_sai

or

set WebObjDesc = Description.Create()

WebObjDesc("Name").Value = "UserName"

WebObjDesc("Index").Value = "0"

Browser("Mercury Tours").Page("Mercury Tours").WebElement(WebObjDesc).Click

QuickTest clicks on the first Web object in the Mercury Tours page with the name UserName.

For more information about the WebElement object, refer to the QuickTest Professional Object Model Reference.

Using the Index Property in Programmatic Descriptions

The index property can sometimes be a useful test object property for uniquely identifying an object. The index test object property identifies an object based on the order in which it appears within the source code, where the first occurrence is 0.

Index property values are object-specific. Thus, if you use an index value of 3 to describe a WebEdit test object, QuickTest searches for the fourth WebEdit object in the page

If you use an index value of 3 to describe a WebElement object, however, QuickTest searches for the fourth Web object on the page regardless of the type, because the WebElement object applies to all Web objects.

For example, suppose you have a page with the following objects:

an image with the name Apple an image with the name UserName a WebEdit object with the name UserName an image with the name Password a WebEdit object with the name Password

The description below refers to the third item in the list above, as it is the first WebEdit object on the page with the name UserName.

WebEdit("Name:=UserName", "Index:=0")

The following description, however, refers to the second item in the list above, as that is the first object of any type (WebElement) with the name UserName.

Page 15: Qtp Interview Questions_sai

Note: WebElement("Name:=UserName", "Index:=0") If there is only one object, using index=0 will not retrieve it. You should not include the index property in the object description.

factorial value

In the following example, QuickTest calculates the factorial value of the number of passengers using the For statement.

passengers = Browser("Mercury Tours").Page("Find Flights").WebEdit("numPassengers").GetROProperty("value")total = 1For i=1 To passengers       total = total * iNextMsgBox "!" & passengers & "=" & total       

total = 1

For i=1 To 11

total = total * i

msgbox total

Next

For...Each Statement

A For...Each loop instructs QuickTest to execute one or more statements for each element in an array or an object collection. It has the following syntax:

For Each item In array

       statement

Next

Item Description

Page 16: Qtp Interview Questions_sai

item A variable representing the element in the array.

array The name of the array.

statement A statement, or series of statements, to be executed during the loop.

The following example uses a For...Each loop to display each of the values in an array.

MyArray = Array("one","two","three","four","five")

For Each element In MyArray

msgbox element

Next

Do...Loop Statement

The Do...Loop statement instructs QuickTest to execute a statement or series of statements while a condition is true or until a condition becomes true. It has the following syntax:

Do [{while} {until} condition]

       statement

Loop

Item Description

condition A condition to be fulfilled.

statement A statement or series of statements to be executed during the loop.

In the following example, QuickTest calculates the factorial value of the number of passengers using the Do...Loop.

Page 17: Qtp Interview Questions_sai

passengers = Browser("Mercury Tours").Page("Find Flights").WebEdit("numPassengers").GetROProperty("value")total = 1i = 1Do while i <= passengers        total = total * i        i = i + 1LoopMsgBox "!" & passengers & "=" & total 

While Statement

A While statement instructs QuickTest to execute a statement or series of statements while a condition is true. It has the following syntax:

While condition

       statement

Wend

Item Description

condition A condition to be fulfilled.

statement A statement or series of statements to be executed during the loop.

In the following example, QuickTest performs a loop using the While statement while the number of passengers is fewer than ten. Within each loop, QuickTest increments the number of passengers by one upto ten.

passengers = Browser("Mercury Tours").Page("Find Flights").WebEdit("numpassengers").GetROProperty("value")

While passengers < 10

       passengers = passengers + 1

Wend

msgbox("The number of passengers in the party is " & passengers)

Page 18: Qtp Interview Questions_sai

passengers = 5

While passengers < 10

passengers = passengers + 1

msgbox("The number of passengers in the party is " & passengers)

Wend

With Statement

With statements make your script more concise and easier to read and write or edit by grouping consecutive statements with the same parent hierarchy.

Note: Applying With statements to your script has no effect on the run session itself, only on the way your script appears in the Expert View.

The With statement has the following syntax.

With object

       statements

End With

Item Description

object An object or a function that returns an object.

statements One or more statements to be executed on an object.

For example, you could replace this script:

Window("Flight Reservation").WinComboBox("Fly From:").Select "London"

Window("Flight Reservation").WinComboBox("Fly To:").Select "Los Angeles"

Page 19: Qtp Interview Questions_sai

Window("Flight Reservation").WinButton("FLIGHT").Click

Window("Flight Reservation").Dialog("Flights Table").WinList("From").Select "19097 LON "

Window("Flight Reservation").Dialog("Flights Table").WinButton("OK").Click

with the following:

With Window("Flight Reservation")

       .WinComboBox("Fly From:").Select "London"

       .WinComboBox("Fly To:").Select "Los Angeles"

       .WinButton("FLIGHT").Click

       With .Dialog("Flights Table")

              .WinList("From").Select "19097 LON "

              .WinButton("OK").Click

       End With 'Dialog("Flights Table")

End With 'Window("Flight Reservation")

Note that entering With statements in the Expert View does not affect the Keyword View in any way.

Running DOS Commands

You can run standard DOS commands in your QuickTest test using the VBScript Windows Scripting Host Shell object (WSCript.shell). For example, you can open a DOS command window, change the path to C:\, and execute the DIR command using the following statements:

Dim oShell

Set oShell = CreateObject ("WSCript.shell")

oShell.run "cmd /K CD C:\ & Dir"

Set oShell = Nothing

Page 20: Qtp Interview Questions_sai

For more information, refer to the Microsoft VBScript Language Reference (choose Help > QuickTest Professional Help > VBScript Reference > VBScript).

The Debug Viewer pane contains three tabs to assist you in debugging your test or component—Watch Expressions, Variables, and Command. To view the Debug Viewer

pane, click the Debug Viewer button or choose View > Debug Viewer.

Watch Expressions

The Watch Expressions tab enables you to view the current value of any variable or other VBScript expression.

Variables

The Variables tab enables you to view the current value of all variables that have been recognized up to the last step performed in the run session.

Command

The Command tab enables you to execute a line of script in order to set or modify the current value of a variable or VBScript object in your test or component. When you continue the run session, QuickTest uses the new value that was set in the command.

Understanding and Using Regular Expressions

Regular expressions enable QuickTest to identify objects and text strings with varying values. You can use regular expressions when:

defining the property values of an object in dialog boxes or in programmatic descriptions

parameterizing a step creating checkpoints with varying values

For example, you can use a regular expression if you want to create a text checkpoint on a date text string, but the displayed date changes according to the current date. If you define the date as a regular expression, the checkpoint checks that the captured text string matches the expected date format, rather than checking the exact date value.

A regular expression is a string that specifies a complex search phrase. By using special characters, such as a period (.), asterisk (*), caret (^), and brackets ([ ]), you can define the conditions of a search.

Page 21: Qtp Interview Questions_sai

For example, your site may include a form in which the user inputs data and clicks the Send button to submit the form. When a required field is not completed, the form is displayed again for the user to complete. When resubmitting the form, the user clicks the Resend button. You can define the value of the button's name property as a regular expression, so that QuickTest ignores variations in the button name when clicking the button

Using Action, or Component Parameters in Steps in the Expert View

Instead of selecting input (or output) parameters from the appropriate dialog boxes while parameterizing steps or inserting output value steps, you can enter input and output parameters as values in the Expert View using the Parameter utility object in the format: Parameter("ParameterName").

Suppose you have test steps that enter information in a form in order to display a list of purchase orders in a table, and then return the total value of the orders displayed in the table.

You can define input parameters, called SoldToCode and MaterialCode, for the codes entered in the Sold to and Materials edit boxes of the form so that the Orders table that is opened is controlled by the input parameter values passed when the test is called.

You can define an output parameter, called TotalValue, to store the returned value. The output value (TotalValue) could then be returned to the application that called the test.

The example described above might look something like this (parameters are in bold font):

Browser("Mercury").Page("List Of Sales").WebEdit("Sold to").Set Parameter("SoldToCode")

Browser("Mercury").Page("List Of Sales").WebEdit("Materials").Set Parameter("MaterialCode")

Browser("Mercury").Page("List Of Sales").WebButton("Enter").Click

NumTableRows = Browser("Mercury").Page("List Of Sales").WebTable("Orders").RowCount

Parameter("TotalValue") = Browser("Mercury").Page("List Of Sales").WebTable("Orders").GetCellData(NumTableRows,"Total")

Outputting Values

Page 22: Qtp Interview Questions_sai

QuickTest enables you to retrieve values in your test or component and to store them as output values. You can subsequently retrieve these values and use them as input at a different stage in the run session.

Choosing the Recording Mode

QuickTest's normal recording mode records the objects in your application and the operations performed on them. This mode is the default and takes full advantage of QuickTest's test object model, recognizing the objects in your application regardless of their location on the screen.

When working with specific types of objects or operations, however, you may want to choose from the following, alternative recording modes:

Analog Recording—enables you to record the exact mouse and keyboard operations you perform in relation to either the screen or the application window. In this recording mode, QuickTest records and tracks every movement of the mouse as you drag the mouse around a screen or window.

This mode is useful for recording operations that cannot be recorded at the level of an object, for example, recording a signature produced by dragging the mouse.

Note: You cannot edit analog recording steps from within QuickTest.

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.

Note: Steps recorded using low-level mode may not run correctly on all objects.

Dim Names(9) ' Declare an array with 10 elements.Dim Names() ' Declare a dynamic array.Dim MyVar, MyNum ' Declare two variables.

Following example shows how you can increase the size of the last dimension of a dynamic array without erasing any existing data contained in the array.

ReDim X (10, 10, 10)

Page 23: Qtp Interview Questions_sai

. . .ReDim Preserve X (10, 10, 15)

Dim MyVariableDim MyArray(3)MyArray(0) = "Sunday"MyArray(1) = "Monday"MyArray(2) = "Tuesday"MyVariable = IsArray(MyArray) ' MyVariable contains "True".If MyVariable=true Then

msgbox " it is array"else msgbox" it is not array"

End If

Erase frees the memory used by dynamic arrays. Before your program can refer to the dynamic array again, it must redeclare the array variable's dimensions using a ReDim statement.

The following example illustrates the use of the Erase statement.

Dim NumArray(9)Dim DynamicArray()ReDim DynamicArray(9) ' Allocate storage space.Erase NumArray ' Each element is reinitialized.Erase DynamicArray ' Free memory used by array.

Function Show Keys Dim a, d, i, s ' Create some variables. Set d = CreateObject ("Scripting.Dictionary") d.Add "a", "Athens" ' Add some keys and items. d.Add "b", "Belgrade" d.Add "c", "Cairo" 'a = d.Keys ' Get the keys. a = d.items ' Get the Items

For i = 0 To d.Count -1 ' Iterate the array. s = s & a(i) & " & " ' Create return string. Next ShowKeys = sEnd Functionmsgbox ShowKeys

RE: How the exception handling can be done using QTP

Along with Recovery Scenarios we can also use the exception handling capabilities of vbscript i.e. the Err object or the On Error Resume Next and the On Error Go to 0

statements. 

Page 24: Qtp Interview Questions_sai

RE: How the exception handling can be done using QTP

QTP provides a good exception handling mechanism. In QTP 8.2 it is known as "Recovery Scnario Manager". It support 4 excptions 

(I)  pop up   (II) Object state (III) Test run error  (IV) Application crash

   I will give u one example that once we playback our recorded script and the AUT screen is minimized then a run time error will occured "eg. application is not visible

or object is not visible". Than we make a handler for that.  This time  " test run error" handler is used.

  - create a notepad file in hard disk    c:exceptio.txt

  - give the path in library file   - goto next

   -give scnario name  -check  "add in current test " and "add to default scnario"

  -after doing this some code is pasted in your txt file   now record script to restore window

  eg.   window("login").restore

   now that recorded script save into txt file and run the test.

If it not working then make sure  the scenario added into setting or not.to enable that goto

Test->settings->recovery

write a test case for air conditioner

Answer# 2

*check whether the plug is installed or not*check whether the power is there or not

Re: What is the first test in software testing process a)Monkey testing b)Unit Testing c)Static analysis d)None of the aboveAnswer

# 1

C--> Static Testing

It is nothing but, reporting bugs in Requirements

Re: which metrics you collect after testing process?

Answer# 1

Use of testing metrics is :

Often encouraged by the organization :(ANDOfen discouraged by the testers :)

Because they feel that organization may use these metrics Against them.

There are a no. of metrics collected after a testing Process is over.Like :

Page 25: Qtp Interview Questions_sai

1. Number of remarks(Claims made by tester that application showed an unexpected behaviour)2. Number of defects(Remarks accepted by dev. as defects)3. Defect severity index.(average of the severity of defects found)4. Time to find a defect.5. Test coverage6. Test case effectiveness7. Defects/KLOC8. defect category9. Residual defect density(estimate of the no. of defects that may have been unresolved in the product phase)10. Defect remark ration many more..

Re: whatis the diffrence bug ,error,defect

Answer# 3

ERROR:IF it is found in developers Environment by developers only.BUG:Testers find while testing an Application/build.DEFECT:If the developers accept the bug and fix it than it defect

Re: 1.what is sanity and smoke testing and which one performed first?

Answer# 3

i think both are wrong..

Sanity means : After reciving build/ Software check whether it is ready for major testing Ex: when we have many tesctcases will check two or three tcs on sampling basis

Smoke testing is similar to sanity, but when it released to production, what you u do is called smoke

11.Keyword view in QTP is also termed as

Icon based view

12.What is the use of data table in QTP?

Parameterizing the test

Page 26: Qtp Interview Questions_sai

13.What is the use of working with actions?

To design a modular and efficient tests

14.What is the file extension of the code file and object repository file in QTP?

The extension for code file is .vbs and the extension for object repository is .tsr

15.What are the properties we can use for identifying a browser and page when using descriptive programming?

The name property is used to identify the browser and the title property is used to identify the page

16.What are the different scripting languages we can use when working with QTP?

VB script

17.Give the example where we can use a COM interface in our QTP project?

COM interface appears in the scenario of front end and back end.

18.Explain the keyword createobject with example

createobject is used to create and return a reference to an automation object.

For example:Dim ExcelSheetSetExcelSheet=createobject(“Excel.Sheet”)

19.How to open excel sheet using QTP script?

You can open excel in QTP by using the following commandSystem.Util.Run”Path of the file”

20.Is it necessary to learn VB script to work with QTP?

Its not mandate that one should mastered in VB script to work with QTP. It is mostly user friendly and for good results we need to have basic VB or concepts which will suffice

21.If WinRunner and QTP both are functional testing tools from the same company. Why a separate tool QTP came in to picture?

QTP has some additional functionality which is not present in WinRunner. For example,you can test(Functionality and Regression testing) an application developed in .Net technology with QTP,which is not possible to test in WinRunner

Page 27: Qtp Interview Questions_sai

22.Explain in brief about the QTP automation object model

The test object model is a large set of object types or classes that QTP uses to represent the objects in our application. Each test object has a list of properties that can uniquely identify objects of that class

23.What is a Run-Time data table?

The test results tree also includes the table-shaped icon that displays the run-time data table-a table that shows the values used to run a test containing data table parameters or the data table output values retrieved from a application under test

24.What are all the components of QTP test script?

QTP test script is a combination of VB script statements and statements that use QuickTest test objects ,methods and properties

25. What is test object?

Its an object that QTP uses to represent an object in our application. Each test object has one or more methods and properties that we can use to perform operations and retrieve values for that object. Each object also has a number of identification properties that can describe the object.

26.What are all the rules and guidelines want to be followed while working in expert view?

Case-sensitivity

VB script is not case sensitive and does not differentiate between upper case and lower case spelling of words.

Text strings

When we enter value as a string, that time we must add quotation marks before and after the string

Variables

We can use variables to store strings,integers,arrays and objects. Using variables helps to make our script more readable and flexible.

Parentheses

To achieve the desired result and to avoid the errors,it is important that we use parentheses() correctly in our statements.

Page 28: Qtp Interview Questions_sai

Comments

We can add comments to our statements using apostrophe(’),either at a beginning of the separate line or at the end of a statement

Spaces

We can add extra blank spaces to our script to improve clarity. These spaces are ignored by the VB script

Testing

1. Tell me about Yourself?2. Testing process followed in your company …3. Testing Methodology4. Where u maintains the Repositories?5. What is CVS?6. Bug Tool used?7. 8. How will you validate the How will you prepare traceability matrix if there is no Business Doc and Functional Doc?functionality of the Test cases, if there is no business requirement document or user requirement document as such…9. Testing process followed in your company?10. Tell me about CMM LEVEL -4 …what are steps that to be followed to achieve the CMM -IV standards?11. What is Back End testing?12. What is Unit Testing?13. How will u write test cases for an given scenario…i.e. main page, login screen, transaction, Report Verification?14. How will u write traceability matrix?15. What is CVS and why it is used?16. What will be specified in the Defect Report…?17. What is Test summary Report…?18. What is Test Closure report…?19. Explain Defect life cycle…20. What will be specified in the Test Case…21. What are the Testing methodologies that u have followed in your project ?22. What kind of testing that u have been involved in and explain about it….23. What is UAT Testing?24. What is joins and what are the different types of joins in SQL and explain the same?25. What is Foreign Key in SQL…?

KLA Tencor

Page 29: Qtp Interview Questions_sai

1. Bug life cycle?2. Explain about the Project. …And draw the architecture of your project?3. What are the different types of severity?4. Defect tracking tools used?5. What are the responsibilities of an tester?6. Give some example how you will write the test cases if an scenario involves Login screen.

Aztec

1. What are the different types of testing followed …..2. What are the different levels of testing used during testing the application?4. What type of testing will be done in Installation testing or system testing?5. What is meant by CMMI …what are different types of CMM Level?6. Explain about the components involved in CMM-4 level7. Explain about Performance testing ?8. What is Traceability matrix and how it is done ?9. How can you differentiate Severity and Priority based on technical and business point of view.10. What is the difference between Test life cycle and defect life cycle ?11. How will u ensure that you have covered all the functionality while writing test cases if there is no functional spec and there is no KT about the application?

Kinds of Testing

WHAT KINDS OF TESTING SHOULD BE CONSIDERED?

1. Black box testing: not based on any knowledge of internal design or code.Tests are based on requirements and functionality2. White box testing: based on knowledge of the internal logic of an application’s code. Tests are based on coverage of code statements, branches, paths, and conditions.3. Unit testing: the most ‘micro’ scale of testing; to test particular functions or code modules. Typically done by the programmer and not by testers, as it requires detailed knowledge of the internal program design and code. Not always easily done unless the application has a well-designed architecture with tight code; may require developing test driver modules or test harnesses.4. Incremental integration testing: continuous testing of an application as new functionality is added; requires that various aspects of an applications functionality be independent enough to work separately before all parts of the program are completed, or that test drivers be developed as needed; done by programmers or by testers.6. Integration testing: testing of combined parts of an application to determine if they function together correctly the ‘parts’ can be code modules, individual applications, client and server applications on a

Page 30: Qtp Interview Questions_sai

networked. This type of testing is especially relevant to client/server and distributed systems.7. Functional testing: black-box type testing geared to functional requirements of an application; testers should do this type of testing. This does not mean that the programmers should not check their code works before releasing it(which of course applies to any stage of testing).8. System testing: black –box type testing that is based on overall requirements specifications; covers all combined parts of system.9. End to end testing: similar to system testing; the ‘macro’ end of the test scale; involves testing of a complete application environment in a situation that mimics real-world use, such as interacting with database, using network communications, or interacting with other hardware, applications, or systems if appropriate.10. Sanity testing: typically an initial testing effort to determine if a new software version is performing well enough to accept it for a major testing effort. For example, if the new software is crashing systems every 5minutes warrant further testing in item current state.11. Regression testing: re-testing after fixes or modifications of the software or its environment. It can be difficult to determine how much re-testing is needed, especially near the end of the development cycle. Automated testing tools can be especially useful for this type of testing.12. Acceptance testing: final testing based on specifications of the end-user or customer, or based on use by end users/customers over some limited period of time.13. Load testing: testing an application under heavy loads, such as testing of a web site under a range of loads to determine at what point the system’s response time degrades or fails.14. Stress testing: term often used interchangeably with ‘load’ and ‘performance’ testing. Also used to describe such tests as system functional testing while under unusually heavy loads, heavy repletion of certain actions or inputs Testing the Application behavior by giving input of large numerical values, large complex queries to a database system, etc.15. Performance testing: term often used interchangeable with ‘stress’ and ‘load’ testing. Ideally ‘performance’ testing (and another ‘type’ of testing) is defined in requirements documentation or QA or test plans.16. Usability testing: testing for ‘user-friendliness’. Clearly this is subjective, and will depend on the targeted end-user or customer. User interviews, surveys, video recording of user sessions, and other techniques can be used programmers and testers are usually not appropriate as usability testers.17. Install/uninstall testing: testing of full, partial, or upgrade install/uninstall processes.18. Recovery testing: testing how well a system recovers from crashes, hardware failures or other catastrophic problems.19. Security testing: testing how well system protects against unauthorized

Page 31: Qtp Interview Questions_sai

internal or external access, damage, etc, any require sophisticated testing techniques.20. Compatibility testing: testing how well software performs in a particular hardware/software/operating system/browsers/network/etc environment.21. Exploratory testing: often taken to mean a creative, informal software test that is not based on formal test plans of test cases; testers may be learning the software as they test it.22. Ad-hoc testing: similar to exploratory testing, but often taken to mean that the testers have significant understanding of the software testing it.23. User acceptance testing: determining if software is satisfactory to an end-user or customer.24. Comparison testing: comparing software weakness and strengths to competing products.25. Alpha testing: testing of an application when development is nearing completion; minor design changes may still be made as a result of such testing. Typically done by end-users or others, not by programmers or testers.26. Beta testing: testing when development and testing are essentially completed and final bugs and problems need to be found before final release. Typically done by end-users or others, not by programmers or testers.27. Mutation testing: method for determining if a set of test data or test cases is useful, by deliberately introducing various code changes (‘bugs’) and retesting with the original test data/cases to determine if the ‘bugs’ are detected proper implementation requires large computational resources.

Our software testing methodology is applied in four distinct phases: unit testing, system

testing, integration testing, and acceptance testing.

Unit Testing—The programmers conduct unit testing during the development phase. Programmers can test their specific functionality individually or with other units. However, unit testing is designed to test small pieces of functionality rather than the system as a whole. This allows the programmers to conduct the first round of testing to eliminate bugs before they reach the testing staff.

System Testing—The system is tested as a complete, integrated system. System testing first occurs in the development environment but eventually is conducted in the production environment. Dedicated testers, project managers, or other key project staff perform system testing. Functionality and performance testing are designed to catch bugs in the system, unexpected results, or other ways in which the system does not meet the stated requirements. The testers create detailed scenarios to test the strength and limits of the system, trying to break it if possible. Editorial reviews not only correct typographical and grammatical errors, but also improve the system’s overall usability by ensuring that on-screen language is clear and helpful to users. Accessibility reviews ensure that the system is accessible to users with disabilities.

Integration Testing—Incremental integration testing involves continuous testing of an application as new functionality is added. This requires that aspects of an application's functionality be able to work separately before all parts of the application are completed. Full integration testing tests combined parts of an application to determine if they function together correctly.

Page 32: Qtp Interview Questions_sai

Acceptance Testing—The software is assessed against the requirements defined in the system requirements document. The user or client conducts the testing in the production environment. Successful acceptance testing is required before submitting to the client for approval.

TEST PLAN : We describe what to Test ? 1.Scope.2.Approach.3.What are the modules to test.

TEST STATERGY : We describe How to Test ?

We define the methodology ?

Re: what is the difference between Test strategy and test plan?

Answer# 7

Test Strategy - Here we are going to mention what are things we are going to test with the details on Methodlogoies in brief.

Test Plan - Here we are going to talk about the type of testing we do,resource planning,Risk and Mitigation plan ,Test environment,etc..... in details for a particular project

 

For any given initial seed, the same number sequence is generated because each successive call to the Rnd function uses the previous number as a seed for the next number in the sequence.

Before calling Rnd, use the Randomize statement without an argument to initialize the random-number generator with a seed based on the system timer.

To produce random integers in a given range, use this formula:

Int((upperbound - lowerbound + 1) * Rnd + lowerbound)

Here, upperbound is the highest number in the range, and lowerbound is the lowest number in the range.

Page 33: Qtp Interview Questions_sai

Note   To repeat sequences of random numbers, call Rnd with a negative argument immediately before using Randomize with a numeric argument. Using Randomize with the same value for number does not repeat the previous sequence

The following example illustrates use of the Randomize statement.

Dim MyValue, ResponseRandomize ' Initialize random-number generator.Do Until Response = vbNo MyValue = Int((6 * Rnd) + 1) ' Generate random value between 1 and 6. MsgBox MyValue Response = MsgBox ("Roll again? ", vbYesNo)

Loop

Data Base Connection using ADO DB objects

set conn=Server.CreateObject("ADODB.Connection")conn.Provider="Microsoft.Jet.OLEDB.4.0"conn.Open "c:/webdata/northwind.mdb"set rs=Server.CreateObject("ADODB.Recordset")rs.open "SELECT * FROM customers",conn

RE: How can you show the data from a particular row an...

Dear guys,

Try this below code

NumColumns=datatable.GlobalSheet.GetParameterCountNumRows=datatable.GlobalSheet.getrowcountFor i = 1 to NumRowsDatatable.SetCurrentRow(i)For j = 1 to NumColumnstblCellText = Datatable(j,dtGlobalsheet)If tblCellText <> "" ThenMsgbox "The Text in Row: " & i & " and Column: " & j & " is: " & tblCellTextEnd IfNext Next

We

2. Datatable.getsheet("Sheet Name").getparameter("Column Name").valuebyrow(rownumber)

try this simple code:enter some values in datatable....

Page 34: Qtp Interview Questions_sai

a=inputbox ("Enter the row : ")b=inputbox ("Enter Column:")msgbox "Row:" & a & "Column:" & bdatatable.SetCurrentRow(Cint(a))c=datatable.Value(CInt(b),2)msgbox c

This code will fetch the row and column from user and will show the specific value from the datatable...hope this works for you

Choosing Which Steps to Report During the Run Session

You can use the Report.Filter method to determine which steps or types of steps are included in the Test Results. You can completely disable or enable reporting of steps following the statement, or you can indicate that you only want subsequent failed or failed and warning steps to be included in the report. You can also use the Report.Filter method to retrieve the current report mode.

The following report modes are available:

Mode

0 or rfEnableAl

All events are displayed in the Test Results.Default.

Page 35: Qtp Interview Questions_sai

l

1 or rfEnableErrorsAndWarnings

Only events with a warning or fail status are displayed in the Test Results.

2 or rfEnabl

Only events with a fail status are displayed in the Test Results.

Page 36: Qtp Interview Questions_sai

eErrorsOnly

3 or rfDisableAll

No events are displayed in the Test Results.

To disable reporting of subsequent steps, enter the following statement:

Reporter.Filter = rfDisableAll

To re-enable reporting of subsequent steps, enter:

Reporter.Filter = rfEnableAll

To instruct QuickTest to include only subsequent failed steps in the Test Results, enter:

Reporter.Filter = rfEnableErrorsOnly

To instruct QuickTest to include only subsequent failed or warning steps in the Test Results, enter:

Page 37: Qtp Interview Questions_sai

Reporter.Filter = rfEnableErrorsAndWarnings

To retrieve the current report mode, enter:

MyVar=Reporter.Filter

1. Sub ChkFirstWhile()

Dim counter, myNum

counter = 0

myNum = 20

Do While myNum > 10

myNum = myNum - 1

counter = counter + 1

msgbox " myNum :="&myNum& " " &"Counter:="&counter

Loop

MsgBox "The loop made " & counter & " repetitions."

End Sub

ChkFirstWhile()

2.Sub ChkLastWhile()

Dim counter, myNum

counter = 0

myNum = 9

Do

myNum = myNum - 1

Page 38: Qtp Interview Questions_sai

counter = counter + 1

msgbox " myNum :="&myNum& " " &"Counter:="&counter

Loop While myNum > 10

MsgBox "The loop made " & counter & " repetitions."

End Sub

ChkLastWhile()

3. Sub ChkFirstUntil()

Dim counter, myNum

counter = 0

myNum = 20

Do Until myNum = 10

myNum = myNum - 1

counter = counter + 1

msgbox " myNum :="&myNum& " " &"Counter:="&counter

Loop

MsgBox "The loop made " & counter & " repetitions."

End Sub

ChkFirstUntil()

4. Sub ChkLastUntil()

Dim counter, myNum

counter = 0

Page 39: Qtp Interview Questions_sai

myNum = 1

Do

myNum = myNum + 1

counter = counter + 1

msgbox " myNum :="&myNum& " " &"Counter:="&counter

Loop Until myNum = 10

MsgBox "The loop made " & counter & " repetitions."

End Sub

ChkLastUntil()

5. Sub ExitExample()

Dim counter, myNum

counter = 0

myNum = 9

Do Until myNum = 10

myNum = myNum - 1

counter = counter + 1

msgbox " myNum :="&myNum& " " &"Counter:="&counter

If myNum < 10 Then Exit Do

Loop

MsgBox "The loop made " & counter & " repetitions."

Page 40: Qtp Interview Questions_sai

End Sub

ExitExample()

6. Sub DoMyProc5Times()

Dim x

For x = 1 To 5

msgbox "x is :" &x

Next

End Sub

DoMyProc5Times()

7. Sub TwosTotal()

Dim j, total

For j = 2 To 10 Step 2

total = total + j

msgbox "Total:" &total

Next

MsgBox "The total is " & total

End Sub

TwosTotal()

Page 41: Qtp Interview Questions_sai

8.Sub NewTotal()

Dim myNum, total

For myNum = 16 To 2 Step -2

total = total + myNum

msgbox "Total:" &total

Next

MsgBox "The total is " & total

End Sub

NewTotal()

RE: what is the difference between data driven framewo...

Hi, Data driven Test:If want to run the one script with multiple sets of data that time we prefer Data Driven Test.Data Driven Frame work:If you want use the script

multiple times ,that time you are storing some where and calling when you want that perticular script.Key word Diven frame work:Key word driven frame work is you are

storing some different diferent scripts in some ohter places using public functionwhenever you want that script insted of writing just you are calling that

perticular script by giving single word or letter. it will come and do that perticular operation any number of times IF YOU WANT MORE CLARIFICATION ABOUT THIS

PLAZ CONTACT ME. Mob:09342845103MAIL:[email protected] 

Scalability Testing, part of the battery of non-functional tests, is the testing of a software application for measuring its capability to scale up or scale out [1]- in terms of any of its non-functional capability - be it the user load supported, the number of transactions, the data volume etc.

Performance, Scalability & Reliability (PSR) are usually considered together by Software Test professionals

Review is "A process or meeting during which artifacts of software product are examined by

project stockholders, user representatives, or other interested parties for feedback or

approval”. Software Review can be on Technical specifications, designs, source code, user

documentation, support and maintenance documentation, test plans, test specifications,

standards, and any other type of specific to work product, it can be conducted at any stage of

the software development life cycle.

Purpose of conducting review is to minimize the defect ratio as early as possible in Software

Page 42: Qtp Interview Questions_sai

Development life cycle. As a general principle, the earlier a document is reviewed, the greater

will be the impact of its defects on any downstream activities and their work products.

Magnitude cost of defect fixing after the release of the product is around 60-100x. Review can

be formal or informal. Informal reviews are referred as walkthrough and formal as Inspection.

Walkthrough: Method of conducting informal group/individual review is called walkthrough, in

which a designer or programmer leads members of the development team and other

interested parties through a software product, and the participants ask questions and make

comments about possible errors, violation of development standards, and other problems or

may suggest improvement on the article, walkthrough can be pre planned or can be conducted

at need basis and generally people working on the work product are involved in the

walkthrough process.

The Purpose of walkthrough is to:

·         Find problems

·         Discuss alternative solutions

·         Focusing on demonstrating how work product meets all requirements.IEEE 1028 

recommends three specialist roles in a walkthrough:

Leader: who conducts the walkthrough, handles administrative tasks, and ensures orderly

conduct (and who is often the Author)

Recorder: who notes all anomalies (potential defects), decisions, and action items identified

during the walkthrough meeting, normally generate minutes of meeting at the end of

walkthrough session.

Author: who presents the software product in step-by-step manner at the walk-through

meeting, and is probably responsible for completing most action items.

Walkthrough Process: Author describes the artifact to be reviewed to reviewers during the

meeting. Reviewers present comments, possible defects, and improvement suggestions to the

author. Recorder records all defect, suggestion during walkthrough meeting. Based on

reviewer comments, author performs any necessary rework of the work product if required.

Recorder prepares minutes of meeting and sends the relevant stakeholders and leader is

normally to monitor overall walkthrough meeting activities as per the defined company

process or responsibilities for conducting the reviews, generally performs monitoring activities,

commitment against action items etc.

Inspection: An inspection is a formal, rigorous, in-depth group review designed to identify

problems as close to their point of origin as possible., Inspection is a recognized industry best

practice to improve the quality of a product and to improve productivity, Inspections is a

formal review and generally need is predefined at the start of the product planning, The

objectives of the inspection process are to

Page 43: Qtp Interview Questions_sai

·         Find problems at the earliest possible point in the software development process

·         Verify that the work product meets its requirement

·         Ensure that work product has been presented according to predefined standards

·         Provide data on product quality and process effectiveness

·         Inspection advantages are to build technical knowledge and skill among team members

by reviewing the output of other people

·         Increase the effectiveness of software testing. 

IEEE 1028 recommends three following roles in an Inspection:

Inspector Leader: The inspection leader shall be responsible for administrative tasks

pertaining to the inspection, shall be responsible for planning and preparation, shall ensure

that the inspection is conducted in an orderly manner and meets its objectives, should be

responsible for collecting inspection data

Recorder: The recorder should record inspection data required for process analysis. The

inspection leader may be the recorder.

Reader: The reader shall lead the inspection team through the software product in a

comprehensive and logical fashion, interpreting sections of the work product and highlighting

important aspects

Author:  The author shall be responsible for the software product meeting its inspection entry

criteria, for contributing to the inspection based on special understanding of the software

product, and for performing any rework required to make the software product meet its

inspection exit criteria.

Inspector: Inspectors shall identify and describe anomalies in the software product.

Inspectors shall be chosen to represent different viewpoints at the meeting (for example,

sponsor, requirements, design, code, safety, test, independent test, project management,

quality management, and hardware engineering). Only those viewpoints pertinent to the

inspection of the product should be present.  Some inspectors should be assigned specific

review topics to ensure effective coverage. For example, one inspector may focus on

conformance with a specific standard or standards, another on syntax, and another for overall

coherence. These roles should be assigned by the inspection leader when planning the

inspection.

All participants in the review are inspectors. The author shall not act as inspection leader and

should not act as reader or recorder. Other roles may be shared among the team members.

Individual participants may act in more than one role. Individuals holding management

positions over any member of the inspection team shall not participate in the inspection

Inspection Process: Following are review phases:

·         Planning

Page 44: Qtp Interview Questions_sai

·         Overview

·         Preparation

·         Examination meeting

Planning:

·         Inspection Leader perform following task in planning phase

·         Determine which work products need to be inspected

·         Determine if a work product that needs to be inspected is ready to be inspected

·         Identify the inspection team

·         Determine if an overview meeting is needed. 

The moderator ensures that all inspection team members have had inspection process

training. The moderator obtains a commitment from each team member to participate. This

commitment means the person agrees to spend the time required to perform his or her

assigned role on the team. Identify the review materials required for the inspection, and

distribute materials to relevant stake holders

Overview: Purpose of the overview meeting is to educate inspectors; meeting is lead by

Inspector lead and is presented by author, overview is presented for the inspection, this

meeting normally acts as optional meeting, purpose to sync the entire participant and the area

to be inspected.

Preparation: Objective of the preparation phase is to prepare for the inspection meeting by

critically reviewing the review materials and the work product, participant drill down on the

document distributed by the lead inspector and identify the defect before the meeting

Examination meeting: The objective of the inspection meeting is to identify final defect list

in the work product being inspected, based on the initial list of defects prepared by the

inspectors [identified at preparation phase and the new one found during the inspection

meeting. The Lead Auditor opens the meeting and describes the review objectives and area to

be inspected. Identify that all participants are well familiar with the content material, Reader

reads the meeting material and inspector finds out any inconsistence, possible defects, and

improvement suggestions to the author. Recorder records all the discussion during the

inspection meeting, and mark actions against the relevant stake holders. Lead Inspector may

take decision that if there is need of follow up meeting. Author updates the relevant document

if required on the basis of the inspection meeting discussion

Rework and Follow-up: Objective is to ensure that corrective action has been taken to

correct problems found during an inspection. 

Understand/gathers project requirements from the customer.

Page 45: Qtp Interview Questions_sai

-Possesses knowledge of different estimation techniques with the ability to use at least

one

-Ability to provide and review estimates at the project level

-Strong understanding of different types of testing methods (manual, performance,

automation)

-Ability to define test strategy and test approach

-Ability to create test plans for complex scenarios

-Determines testing goals and objectives

-Strictly follows the standards defined creating test plans/scripts and its execution for all

scenarios

-Evaluate and recommend test tools for automated test approach

-Expert knowledge of test management tool – Selenium, JMeter, Part Cover

-Owns responsibility to assign and manage deliverables for a small team

-Understands the project schedule and plans/prioritizes the work schedule for a team and

meets time deadlines

consistently.

Levels of the CMM

Level 1 - Ad hoc (Chaotic)

It is characteristic of processes at this level that they are (typically) undocumented and in a state of dynamic change, tending to be driven in an ad hoc, uncontrolled and reactive manner by users or events. This provides a chaotic or unstable environment for the processes

Page 46: Qtp Interview Questions_sai

Level 2 - Repeatable

It is characteristic of processes at this level that some processes are repeatable, possibly with consistent results.

Process discipline is unlikely to be rigorous, but where it exists it may help to ensure that existing processes are maintained during times of stress.

Level 3 - Defined

It is characteristic of processes at this level that there are sets of defined and documented standard processes established and subject to some degree of improvement over time. These standard processes are in place (i.e., they are the AS-IS processes) and used to establish consistency of process performance across the organization

Level 4 - Managed

It is characteristic of processes at this level that, using process metrics, management can effectively control the AS-IS process (e.g., for software development ). In particular, management can identify ways to adjust and adapt the process to particular projects without measurable losses of quality or deviations from specifications. Process Capability is established from this level.

Organizational implications:(a) Quantitative quality goals tend to be set for process output - e.g., software or software maintenance.(b) Using quantitative/statistical techniques, process performance is measured and monitored and generally predictable and controllable also.

Level 5 - Optimized

It is characteristic of processes at this level that the focus is on continually improving process performance through both incremental and innovative technological changes/improvements