2017 October Release

How to Edit and/or Improve a TestPermanent link for this heading

After a test has been recorded you can edit and improve it for creating sensible tests. Here are some tips how you can enhance your test.

Structuring a Test and Reusing FilesPermanent link for this heading

Insert ElementsPermanent link for this heading

It makes sense to structure a test into sequences and use cases. You can insert them in the Fabasoft app.test Recorder in the "Outline" view.

Insert Use CasePermanent link for this heading

You can insert a use case into a sequence by selecting the element where the use case should be inserted (see chapter “Insert Use Case”) and clicking the "Insert Use Case" button.

A dialog box opens where you can define a name for the use case, the number of iterations (which means how often the use case should be carried out) and a condition (see chapter “How to Use If Conditions”) when the use case should be carried out. It is not necessary to fill the fields but it is useful to enter a name.

The use case has been inserted and you can now insert steps into this use case.

Field Name

Description

name

Defines the name of the use case. The name is displayed in the outline and written to the report file.

if

In the if field you can enter a condition. The use case and its nested statements are only carried out if the condition returns true.

iterations

Defines the number of times the use case is executed.

Note: If you are using parameters within iterations, they are only resolved once when the use case is entered. Changing the affected parameters in the use case body has no effect on iterations.

Default is 1.

domain

Overrides the domain which should be used in nested statments if there is an authentication request. Note that domain="" overrides the domain with an empty value, whereas if it is not defined on the use case, the superior domain will be used.

username

Overrides the user name which should be used in nested statments if there is an authentication request. Note that username="" overrides the user name with an empty value, whereas if it is not defined on the use case, the superior user name will be used.

password

Overrides the password which should be used in nested statments if there is an authentication request. Note that password="" overrides the password with an empty value, whereas if it is not defined on the use case, the superior password will be used

Insert SequencePermanent link for this heading

You can insert a sequence into a test by selecting the element where the sequence should be inserted (see chapter “Position of Newly Inserted Elements in the "Outline" View”) and clicking the "Insert Sequence" button.

A dialog box opens where you can define a name for the sequence, the number of iterations (which means how often the sequence should be carried out - please note that you cannot reference a parameter in this field), a condition as well as login data (user and password) and a location where the sequence should be carried out. It is not necessary to fill the fields but it is useful to enter a name.

The sequence has been inserted and you can now insert steps and use cases into this sequence.

Insert Parameter TablePermanent link for this heading

If you use parameters is your test, you can use a parameter table at the beginning of the test. In a parameter table you can set parameters to fixed values. Please note that references to other test parameters are not resolved in the parameter table whereas references to system parameters are resolved (if they are currently available).

For inserting a parameter table select the test (because usually you insert a parameter table at the beginning of a test - further information can be found in the chapter “Position of Newly Inserted Elements in the "Outline" View”) and click "Insert Parameter Table".

The parameter table is inserted and you can now insert set statements by selecting it in the "Outline" view and recording set statements (set the parameter to a fixed value see chapter “Set Statement”).

Note: You can also insert elements when opening the context menu in the "Outline" view.

Reference Files in the Fabasoft app.test RecorderPermanent link for this heading

If you have recorded a use case file which you want to use in different sequences you can reference this single file within a sequence. Therefore, select the use case in the "Outline" view after inserting it and change to the "Properties" view. Turn on the "Advanced Properties". A Filename field is shown where you can select a use case file by clicking the "..." button.

A dialog box opens where you can select the use case to be referenced. Click "OK" after selecting the corresponding use case.

The reference is entered into the Filename field. If the use case does not have a name (Name field in the "Properties" view is empty), the reference is displayed in the "Outline" view.

Note: You can also reference sequence and parameter table files by selecting the corresponding file in the "Properties" view analog to referencing a use case file.

If you want to open a referenced file, open the context menu of the reference in the "Outline" view and select "Open Declaration".

The referenced file is opened in the Fabasoft app.test Studio.

Save and Load Files in the "Outline" viewPermanent link for this heading

Save files out of a test filePermanent link for this heading

If you have recorded a use case within a test and would like to save it in a separate file (e.g. for referencing it in another test file), just open the context menu of the use case in the "Outline" view and select "Save as...".

A dialog box opens where you can enter a name for the use case to be saved as well as select the folder (and the project) where it should be saved. Click "OK" afterwards.

The use case file is created and shown in the "Projects" view.

Load files into the "Outline" viewPermanent link for this heading

You can also directly load files without referencing them in the "Outline" view before (sequence or use case).

For loading a sequence file select the element in the "Outline" view in (or after – see chapter “Position of Newly Inserted Elements in the "Outline" View”) which the sequence should be inserted, open the context menu and select "Load Sequence".

You can select a sequence file in the dialog box that has opened and click "OK" afterwards.

The selected sequence has been inserted. This is shown in the "Outline" view. Please note that the whole sequence is inserted and not a reference to the sequence file!

Note: You can also load a use case directly by selecting "Load Use Case" in the "Outline" view (again the insertion rules are valid for inserting a use case).

Enhance a Test by Using Validation StatementsPermanent link for this heading

It is very important to use validations in a test. A validation is used to check if the result of an execution (or of a set of executions) is the expected one. Following, you will find some examples where validations might be useful.

Check if Field Has Been Set CorrectlyPermanent link for this heading

In your test you set an input field to a specific value. This results in setting another field too (as when setting the "Category" of a case, the "Short Form" field should be set, too). For checking if the "Short Form" field has been set correctly, you can use a set statement for saving the value in a parameter. Afterwards, you can check in a validation statement if this value has been set correctly.

Example

<Execution action="Quicksearch" location="PAGES.Explore.Category" value="*" />
<Execution action="Click" location="PAGES.Explore.Category[0].Job Advertisement" />
<Set parameter="ShortForm" location="PAGES.Explore.CONTROLS.Short Form" />
<Validation ok='"{~ShortForm~}"=="HR"' />

Check Success of Document ImportPermanent link for this heading

If you have imported a document in Fabasoft Folio, it is quite useful to check if the import has been successful. Therefore, check in a set statement if the object exists in Fabasoft Folio and validate the result.

Example

<Execution action="Import" location="PAGES.Explore.Object List.BUTTONBAR.SelectTool" value="{~importdocs~}An Introduction to Fabasoft app.test.pdf" />
<Set parameter="ImportSuccessful" location='PAGES.Explore.CONTROLS.Object List.ROWS["Name"=="An Introduction to Fabasoft app.test"]' eval="Exists" />
<Validation ok="{~ImportSuccessful~}" />

Count the Rows of a ListPermanent link for this heading

Often it is also necessary to check if a list (object list or compound property list) has the expected amount of rows. In this example you check if the history of a record contains the expected amount of rows.

Example

<Set parameter="Rows" location="PAGES[0].CONTROLS.History" eval="Count" />
<Validation ok="{~Rows~}&gt;=3" />

Validate if Renaming SucceededPermanent link for this heading

Another example is to check if the renaming of a cell in an object list (by using the F2 key) has been executed correctly.

Example

<Execution action="Click" location="PAGES.Explore.Object List[1].Date of Contract" />
<Execution action="Keypress" location="WINDOWS[LAST]" value="F2Key" />
<Execution action="Set" location="PAGES.Explore.Object List[1].Date of Contract" value="01.10.2009" />
<Execution action="Keypress" location="WINDOWS[LAST]" value="ReturnKey" />
<Set parameter="DateOfContract" location="PAGES.Explore.CONTROLS.Object List.ROWS[1].Date of Contract" />
<Validation ok="{~DateOfContract~}==01.10.2009" />

Enhance a Test by Adapting the TimingPermanent link for this heading

When recording a test it might happen that some executions might take longer than the defined default timeout (in Fabasoft app.test 30 seconds for executions, 60 seconds for starting a sequence and 90 seconds for starting a context; this can be changed in the "Preferences" of Fabasoft app.test).Therefore, you can adapt the timeout for single statements. Three ways for adapting the timeout are available:

  • Change the timeout for one single statement
  • Define a time Fabasoft app.test should wait before executing a statement
  • Define a time Fabasoft app.test should wait after executing a statement

Define a Specific Timeout for one Single StatementPermanent link for this heading

You can set a specific timeout value for the following sorts of elements:

  • Sequence
  • Execution
  • Context Switch
  • Set

An individual timeout is needed if you know that the statement will take longer to be carried out than the defined default timeout (e.g. if switching to another context will probably take longer than the default timeout because the document takes longer to be opened).

You can enter a timeout value by selecting the corresponding element in the "Outline" view and changing to the "Properties" view.

Switch on the advanced properties by clicking the "Show Advanced Properties" button.

Now you can enter a timeout for this single context switch into the Timeout field (in milliseconds). After pressing the Return key the value is undertaken.

Note: If you define a timeout value for a sequence or a context, it only applies for starting the sequence/context and not for all statements contained in this section. For those statements the appropriate default timeout is used. If you define a timeout on a referenced Sequence or Context, it will override the timeout defined in the reference target.

Example

<Sequence name="MySequence" timeout="100000">
  ...
  <Context clienttype="OFFICE" location="My Word" options="Locked" timeout="300000">
    ...
</Context>
  ...
</Sequence>

Wait Before Executing a StatementPermanent link for this heading

You can furthermore define with an execution statement that the Fabasoft app.test Player should wait a defined time till the statement should be carried out. Therefore, select the execution statement in the "Outline" view and go to the "Properties" view.

In the advanced properties you can enter a time in milliseconds into the WaitBefore field. The Fabasoft app.test Player waits the defined time before the execution is carried out.

Wait After Executing a StatementPermanent link for this heading

You can also define a time (in milliseconds) the Fabasoft app.test Player should wait after carrying out an execution. This might be reasonable if the web browser needs some time to handle an execution and the resulting requests. This means that the action defined in the execution statement is fired, the Fabasoft app.test Player waits the defined time and then continues with the next statement - even if carrying out the action has not finished yet! If the browser is not ready after the defined time, a warning occurs in the report.

For defining a waiting time after an execution select the statement in the "Outline" view and go to the "Properties" view.

In the advanced properties you can enter a time in milliseconds into the WaitAfter field. The Fabasoft app.test Player waits the defined time after carrying out the execution before he goes on to the next statement.

Wait Until ExistsPermanent link for this heading

If you define the option "WaitUntilExists" for an execution or a set statement, the Fabasoft app.test Player waits until the control specified by the location exists before the statement will be carried out.

Example

<Execution action="Click" location="BUTTON.Yes" options="WaitUntilExists" />

<Set parameter="Title" location="CONTROLS.Title" options="WaitUntilExists" />