Wednesday, 28 January 2009

QTP Local Test Settings

Record and Run Options

Here is a list of the highlights that can be found in the Test Settings Dialogue where local record and run test settings can be set. This can be found by selecting "Settings" from the File menu i.e. File > Settings.

All settings in the Test Setting form are Local Test Options and will only affect the current test.

Properties Tab
Here we can set add-ins like activeX & web etc via the Modify button

The Generate Script button will create a QTP script which contains instructions to automatically set the current Test Settings. This can then be run as a prerequisite in a test environment and all settings will be set in accordance with that and therefore be applied to all subsequent tests.

Run Tab
Here we can set whether to run 1 iteration only, run all rows (in the data table), or run from row x to x. This allows us to run a subset of the total number of rows from the data table.

Set what to do when an error occurs:
1. Pop-up msgbox
2. Proceded to next action iteration
3. Proceded to next step
4. Stop run

Object synchronization timeout is set here (For web objects QTP waits for the amount of time set in Browser navigation timeout option, plus the time set for the object)
Browser navigation timeout is set in Test Settings in the web tab
For more on QTP timeouts see QTP Timout Settings

Recourses Tab
Function libraries can be added in via the Recourses tab

Parameters Tab
Input & output Parameters are set shown in here

Environment Tab
Environmental variables are stored in here. We can access these and use them in our tests using their logical name which is allocated by QTP. This contains items such as ActionIteration which may be useful to know in debugging. So for instance to discover the Action Iteration our syntax would look like this

intActionIteration = Environment("ActionIteration")

We can also create our own environmental variables such as IP addresses and DNS names of various Test Environments which we may want to point to. This is achieved by selecting User-Defined from the variable type and then importing our file.

Web Tab
This is where the browser navigation timeout is set. It also has the facility to allow entering of Login credentials for the Active Screen where sensitive or restricted data may be displayed.

Recovery Tab
This is where the Recovery Scenarios are set and managed.

The default setting is a pop-up msgbox describing the error.
QTP offers 3 inbuilt options to choose from in response to a recovery scenario being activated.

1. Proceed to next iteration action.
2. Stop Run
3. Proceed to next step

There is a choice of how recovery scenarios can be triggered, or activated via a drop down as follows:

1. On every step (may result in slow performance)
2. On error
3. Never

Greater flexibility is allowed by the option for us to import our own recovery scenario files.

The Set as Default button sets the current recovery scenarios to be the default for all tests. (This button is only enabled when the current scenarios are different to the existing default).

No comments: