Categories

Tests executions

Designing tests and maintaining test scripts are two essential aspects of the software testing process. The Agilitest editor enables you to build your tests and modify them directly in the interface during execution in "step by step" mode.

A range of functions are available at action level to configure and modify the execution of your tests.

“Step by step” execution mode

The step-by-step mode is a special mode dedicated to editing and modifying tests.

Agilitest lets you replay actions independently of each other, so you can run them step by step.

To do this, click on the play button that appears on the line of each action you hover.

play button

Agilitest will then immediately perform this action on the software being tested and send you the result.

action executed

This operating mode allows you to run your test step by step, selecting actions one after the other and checking that each action has been carried out.

Execution options

Marking a stopping point during execution

It is possible to add a breakpoint to an action during test execution, for debugging purposes.

To do this, click on the tick below the action index to display the "Stop" icon.

stop icon

When you run your test, it will stop at the stop point you specified.

Manage the number of tries for an action

It is possible to increase or decrease the maximum number of attempts. This tells Agilitest that it must try several times to wait for the feedback of the application before generating a failure.

This contributes greatly to the robustness of the tests when you know that your server may be in a situation where it does not deliver the desired page immediately.

The maximum number of attempts is limited to 50, but the waiting time between each attempt follows an exponential curve: this makes it possible to quickly check the conditions for success when they are met, but also to wait "a certain amount of time" for a long processing to be carried out.

action tries

These tests can also be separated by a time interval. The higher the value, the longer Agilitest will wait between tests.

wait time

Managing waiting times with Java

Another solution is to use a Java code piece, here's how:

In the Agilitest explorer, select the view to “Java ATS scripts

JAVA ATS script view

Click on the button to “Create a Java ATS script”.

create Java script button

You can also create a Java script by clicking on “New component”, at the top left of the editor.

new component

Enter the name of the script you want to use as a standby function

The editor opens a java code editing window. Paste the following code into the testMain function () :

try {    final int ms = Integer.parseInt(prm(0, "1000"));    Thread.sleep(ms);} catch (Exception e) {}

Finally, drag and drop the Java script from the Agilitest explorer to the script where you want to call it in your test.

callscript java

💡 Tip

If you want to be able to specify the waiting time directly from your ATS script in Agilitest, you can declare a parameter passed by value to the script and then use the following code:

try {        final int ms = getParameter(0).toInt();        Thread.sleep(ms);} catch (Exception e) {}

To indicate that an action may fail

You can tell Agilitest that this action can fail without the test failing.

To do this, click on the square at the bottom right.

fail action indicated

This will display a double green arrow indicating that the action may fail.

action marked failed

This feature is necessary to compensate for certain sporadic application behaviour,

Example : A popup that doesn't appear all the time.

Execution in reduced mode

If you wish, you can run your test in reduced mode, which will temporarily close the Agilitest window for the duration of the test.

Click on the parameters in the channel management tab below the project explorer,

parameters button

Then tick the “Execute in reduced mode” box.

execute reduced mode

The Agilitest editor will be scaled down to give you a better view of what's going on in your application, which can be useful if you only have one screen.

execution in reduced mode

Execute in Java mode

ATS has been designed to generate Java code to execute compiled tests, which is particularly well suited to launching continuous integration tests, or running complete test campaigns in Agilitest.

Execution in Java mode is fast and efficient. Unlike execution in step-by-step mode, which allows you to build and modify your script, execution in Java mode allows you to execute end-to-end in a production environment.

There are three ways of running tests in Java mode:

  1. Directly from the script

Instead of running your script step by step from the Agilitest editor, you can choose to run the test in Java mode.

To do this, right-click on the script in your project explorer. and select “Java execution

java execution

This will compile your script and open a Java execution window

java window

             2. Create an execution suite

It is possible to create execution suites. These suites group together a set of scripts that will be compiled and executed with Java.

To do this, open your project menu then click on "Execution management" to open the Project builder.

executions management

From this page, you can create suites in the "Executions" area.

executions

Once you have created your suite, click on "Generate" → "Compile" → "Execute" to execute your script in Java mode.

compile builder

This will open the Java Terminal window

java terminal

               3. Java execution outside Agilitest

You can enter the command line in your terminal to execute the code without using Agilitest.

To retrieve the command line, copy the command line from the project’s builder,

command line

Then copy the command line into your terminal on your computer to execute it without using Agilitest.

Element not found

In test automation, it can happen that an element is no longer recognized during execution due to changes made to the software.

To remedy this, Agilitest lets you adjust tests directly in the editor.

Location and analysis

You can use the video of the failed test execution and/or a report with screenshots to understand and locate the recognition failure. There are two possibilities:

  • The item originally searched for no longer exists in the software under test.
  • The element initially searched for exists but is no longer recognized.

Correct the test

  1. If the required element no longer exists

The test can be modified by deleting this action in the editor.

To do this, right-click and select "Delete".

delete button

Check the previous and following actions that may be related to test execution, if necessary.

            2. If the element you are looking for exists, but is no longer recognized

The test must therefore be modified, in particular by updating the recognition criteria for this element in the Agilitest editor.

To do this, Agilitest indicates precisely which attribute is not found to locate this element.

element not found

Open the capture tool from the editor,

capture tool

Capture the element by pressing the CTRL key while hovering your mouse on the element,

selection of attributes

Adjust detection attributes.

It's possible to use a "regular expression" on each attribute for robustness.

Remember to validate detection uniqueness using the built-in statistical test.

statistics

Drag and drop these new attributes onto the action concerned by this "non-detection" to update it.

element dragged in the editor

Save your modifications.

Still require support?
Contact support