Wednesday, February 2, 2011

QTP FAQ 11

Please refer the QuickTest Plus Helpfile and refer the link

Libraries Funtions->Microsoft Object->Database function collections

here you would get database releated functions

Analog Recording: enables to record exact mouse movement, drag mouse and keyboard operation in relation to either the screen or the application window

lowlevel and analog recording are almost same, except if the exact coordinates of the object are important for your test or component then should use this recording mode
Testconnection("Select * from emptable")

Function testconnection(query)

Set cnn = CreateObject("ADODB.Connection")
Set rs = CreateObject("ADODB.Recordset")
cnn.ConnectionString ="DRIVER={Oracle in OraHome92};SERVER=servername;UID=userid;PWD=pwd;DBQ=dbinstance"
cnn.open

rs.open query,cnn
rs.movefirst

for i = 0 to rs.fields.count
msgbox rs(i)
next

End Function
You can add an external Action programatically using the Command

RunAction ActionName, [IterationMode , IterationRange]

Before you can use the RunAction statement in the Expert View for an external action, you must first call or copy the external action into your test by choosing Insert > Copy of Action or Call to Action. If the external action does not exist in your test, the RunAction statement is not recognized.


Example

The following example calls the SearchFlight action, and runs all iterations of the action.

Call RunAction "SearchFlight", rngIterations, rngAll

============
Q.139 What is the descrirptive progrmaing?.what is the use of descriptive programing?
QTP uses it's object repository to refer to objects present in your test and which have been recorded, if you wish to use objects that were not recorded and are not present in your object repository then we use descriptive programming, where QTP does not refer to object repository but the property name and value are mentioned in the code itself for QTP to use it for e.g

this is not Desc. prog.

Browser("Mercury Tours").Page("Mercury Tours").WebEdit("username")

This is desc prog.

Browser("Title:=Mercury Tours").Page("Title:=Mercury Tours").WebEdit("Name:=Author", "Index:=3").Set "Mark Twain"

where we mention the Property name "Title" and it's value "Mercury Tours" in the code itself.
For testing Oracle Apps with QTP, I would suggest you define your test cases using MS Word documents. Then categorize them by complexity into low, med and high. After that, I would target your low complexity scripts for QTP and use them as regression testing scripts.

1)To obtain a text from List box just select the range of items inthe list box and use GetSelection method along with the object name. You also have GetContent method to get all the items from the list.

2) To obtain a text from cell, Record: Click inside the cell and use GetROProperty("text") then you can see the text value. Same is the case with Table also.
Step Into

Choose Debug > Step Into, click the Step Into button, or press F11 to run

only the current line of the active test or component. If the current line of

the active test or component calls another action or a function, the called

action/function is displayed in the QuickTest window, and the test or

component pauses at the first line of the called action/function.

Step Out

Choose Debug > Step Out or click the Step Out button, or press SHIFT+F11

only after using Step Into to enter a action or a user-defined function. Step

Out runs to the end of the called action or user-defined function, then

returns to the calling action and pauses the run session.

Step Over

Choose Debug > Step Over or click the Step Over button, or press F10 to

run only the current step in the active test or component. When the current

step calls another action or a user-defined function, the called action or

function is executed in its entirety, but the called action script is not

displayed in the QuickTest window.

There are 3 execution mode in QTP they r:

1. Normal - the default mode where expected & actual results are verified & output is given.

2. Update - When u want to update the expected result then update mode is used.

3. Debug- this requires Microsoft debugger..
u have asked a very big question in a single line ...... transfering ur testing from Manual to Automation depends upon lot of factors.Depending upon these factors u decide the 'Framework'. Framework is nothing but the approach by which u implement QTP to ur project.There are various type of framework avilable....Data, Library, Keyword Driven to name few...

It is used to hold all the bulids of diff versions


QTP identifies the object in the application by Logical Name and Class.


Using BRD ans functional and Design docs we Build the test scripts,which should be able to find the deffects on AUT at the time of Test Run.
Use Err.description

Example. msgbox "Error:"&err.description
com interface appears in the scenario of front end and back end. for eg:if you r using oracle as back end and front end as VB or any language then for better compatibility we will go for an interface. of which COM will be one among those interfaces. Create object creates handle to the instance of the specified object so that we program can use the methods on the specified object. It is used for implementing Automation(as defined by Microsoft).

Step INto
To run only the current line of the active tesdt or component.
Step Out
Step Out runs to the end of the called action or user-defined function, then returns to the calling action and pauses the run session.
Step Over
to run only the current step in the active test or component. When the current step calls another action or a user-defined function,the called action or function is executed in its entirety, but the called action script is not displayed in the QuickTest window.
Ex:Execute this below code
public Function myfunc()
msgbox "one"
msgbox "two"
msgbox "three"
End Function
myfunc 'Insert Break Point here "use the
myfunc 'Step Into F11, Step Out Shift F11, and Step Over F10 commands
myfunc

No comments:

Post a Comment