Thursday, March 20, 2008

FAQ - Automation - QTP ( 61 to 70 )


61. What are Method Arguments?

A. Using Method arguments you parameterize method arguments in the Method Arguments dialog box. to open the Method Arguments dialog box, right-click a step containing a method in the test tree and choose Method Arguments. The Method Arguments dialog box opens and displays the method arguments in the step.


62. Well, I would like to run my test with different sets of data, How can I make it with the options available in QTP?

A. Listed are the different Data Table Iterations
Run one iteration only:
Runs the test only once, using only the first row in the global Data Table.

Run on all rows:
Runs the test with iterations using all rows in the global Data Table.
Run from row __ to row __ :
Runs the test with iterations using the values in the global Data Table for the specified row range.


63. What are different data tables available?

A. 1. Global Sheet
The Global sheet contains the data that replaces parameters in each iteration of the test.
2. Action Sheets
Each time you add a new action to the test, a new action sheet is added to the Data Table. Action sheets are automatically labeled with the exact name of the corresponding action. The data contained in an action sheet is relevant for the corresponding action only.


64. What is an Action?

A. An Quick test script contains different actions. An action contains the script i.e. A piece of business scenario like, login to application, logout etc.

Well again it depends on how you create your framework (If you would like to know more about frame work check out this link. Good one. http://www-128.ibm.com/developerworks/rational/library/591.html) for testing the applications.
I would suggest every action has a piece of business scenario which would help to re-use the script in a better way. Before deciding what are re-usable scripts. Firstly, identify all the common scenarios that occur in different business flows across different modules.
Then prepare the scripts and make generic. You can call all these functions by making this common function library available at Test options > Resources.



65. What is Copy of action?

A. Copy of Action:
When you insert a copy of an action into a test, the action is copied in its entirety, including checkpoints, parameterization, and the corresponding action tab in the Data Table. If the test you are copying into uses per-action repository mode, the copied action’s action object repository will also be copied along with the action.


66. What are re-usable actions?

A. Reusable Actions:
Determines whether the action is a reusable action. A reusable action can be called multiple times within a test and can be called from other tests. Non-reusable actions can be copied and inserted as independent actions, but cannot be inserted as calls to the original action.


67. What about Call of Action?

A. You can insert a call (link) to a reusable action that resides in your current test (local action), or in any other test (external action).


68. When to Insert transactions?

A. Inserting Transactions:

During the test run, the Start Transaction signals the beginning of the time measurement. You define the beginning of a transaction in the Start Transaction dialog box

The End Transaction signals the end of the time measurement


69. What are regular expressions?

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

* Parameterizing a step

* Creating checkpoints with varying values

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. When one of these special characters is preceded by a backslash (\), QuickTest searches for the literal character.

Here is an example:
The actual pattern for the regular expression search is set using the Pattern property of the RegExp object. The RegExp.Global property has no effect on the Test method.
The Test method returns True if a pattern match is found; False if no match is found.
The following code illustrates the use of the Test method.
Function RegExpTest (patrn, strng)
Dim regEx, retVal ' Create variable.
Set regEx = New RegExp ' Create regular expression.
regEx.Pattern = patrn ' Set pattern.
regEx.IgnoreCase = False ' Set case sensitivity.
retVal = regEx.Test(strng) ' Execute the search test.
If retVal Then
RegExpTest = 'One or more matches were found.'
Else
RegExpTest = 'No match was found.'
End If
End Function
MsgBox(RegExpTest('is.', 'IS1 is2 IS3 is4'))

70. Create a script to print the message


A.
Dim MyVar
MyVar = MsgBox ('Hello World!', 65, 'MsgBox Example')
' MyVar contains either 1 or 2, depending on which button is clicked.

No comments: