# US 2016/0328312 A1 · Enhanced stability of automation execution via use of state machine pattern and expected conditions when executing an action on an application element

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2016/0328312 A1
- Document ID: US20160328312A1
- Status: Published application
- Kind: A1
- Application number: 14/983,727
- Filed: 2015-12-30
- Published: 2016-11-10
- Earliest claimed: 2015-05-04
- Assignees: Halogen Software Inc.
- Applicants: Halogen Software Inc.
- Inventors: Chris Loder; Mathieu Jobin
- Web page: https://patentgrep.com/patent/US20160328312A1

## CPC

- G06F 11/3688: {for test execution, e.g. scheduling of test suites}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

An automation testing framework is provided for testing user interface elements in an application. Actions may be executed on elements of the application using a state machine in order to eliminate a need to insert wait periods into the test tool. An adaptive delay is applied to execution of the user interface element when execution cannot be validated prior to re-execution of the user interface element. The adaptive delay removes testing instability and accelerating testing of the application.

## Claims

### Claim 1

A computing device for automated testing of an application, the computing device comprising:
a processing unit for executing instructions;
a memory unit for storing instructions, which when executed by the processing unit configure the computing device to provide:
an automation framework providing an application programming interface (API) for controlling interactions with one or more user interface elements of the application; and
an execution state machine for executing action on user interface elements through the automation framework, the execution state machine comprising a plurality of states associated with the user interface element defined in the application, wherein one of the states is associated to the user interface element during execution of a test step in the automation framework wherein when a failure of an action on the user interface element occurs an adaptive delay is applied before attempting to re-execute the action until the state of the user interface element is validated or the adaptive delay is exceeded.

### Claim 2 (depends on 1)

The computing device of claim 1 wherein the state machine defines the plurality of states as:
an UNKNOWN state when the user interface element is being loaded;
a FOUND state when the user interface element is successfully loaded;
a VALIDATING state when the result of an attempted action is being validated; and
an UNSTABLE state when the validation of the action fails in the VALIDATING state.

### Claim 3 (depends on 2)

The computing device of claim 2, wherein when transitioning from the VALIDATING state to the UNSTABLE state upon failing the attempted action the adaptive delay is applied.

### Claim 4 (depends on 3)

The computing device of claim 3, wherein the adaptive delay increases the delay upon each subsequent delay.

### Claim 5 (depends on 2)

The computing device of claim 2, wherein when validating the attempted action in the VALIDATING state, one or more conditions are checked against expected conditions resulting from execution of the action.

### Claim 6 (depends on 5)

The computing device of claim 5, wherein the expected conditions are selected from a plurality of predefined conditions.

### Claim 7 (depends on 6)

The computing device of claim 6, wherein the plurality of predefined conditions comprise one of:
AlertVisible;
ElementAttributeContains;
ElementAttributeNotContains;
ElementChanged;
ElementCheckboxValueEquals;
ElementClickable;
ElementEnabled;
Elementlnvisible;
ElementIsSelected;
ElementTextContains;
ElementTextEquals;
ElementValueEquals;
ElementVisible;
WindowClosed; and
WindowOpened.

### Claim 8 (depends on 1)

The computing device of claim 1 wherein the application is a web application and the user interface element are is a web-based user interface.

### Claim 9 (depends on 1)

The computing device of claim 1, wherein the state machine has a maximum timeout wherein the testing is terminated when the maximum timeout is reached.

### Claim 10

A method of automated testing of an application executed on a computing device, the method comprising:
executing an action on an interface element in the application identified in a test step;
setting a state associated with an element when the interface element is being loaded;
loading the interface element in the application associated with the action;
attempting the action defined for the interface element;
changing the state associated with the interface element during execution;
verify conditions of the element against expected conditions;
applying an adaptive delay between subsequent execution of the actions when the expected conditions for the interface element are not met;
iteratively re-executing the action on the interface element where the adaptive delay is applied until the action is verified or the adaptive delay expires.

### Claim 11 (depends on 10)

The method of claim 10 wherein changing the state comprises:
setting a state associated with an element defined for the action to UNKNOWN when a web element is being loaded;
setting the state associated with the element to FOUND when the web element is successfully loaded;
setting the state to VALIDATING when the result of an attempted action is being validated; and
setting the state to UNSTABLE when the validation of the action fails in the VALIDATING state.

### Claim 12 (depends on 11)

The method of claim 11, wherein when transitioning from the VALIDATING state to the UNSTABLE state upon failing the attempted action the adaptive delay is applied.

### Claim 13 (depends on 12)

The method of claim 12, wherein the adaptive delay increases the delay upon each subsequent delay.

### Claim 14 (depends on 11)

The method of claim 11, wherein when validating the attempted action in the VALIDATING state, one or more conditions are checked against expected conditions resulting from execution of the action.

### Claim 15 (depends on 14)

The method of claim 14, wherein the expected conditions are selected from a plurality of predefined conditions.

### Claim 16 (depends on 10)

The method of claim 10 wherein the application is a web application and the user interface element are web-based user interface elements defined in a browser.

### Claim 17 (depends on 10)

The method of claim 10, wherein the state machine has a maximum timeout wherein the testing is terminated when the maximum timeout is reached.

### Claim 18 (depends on 10)

The method of claim 10 wherein the adaptive delay is increased by 1 second on each subsequent attempt until a maximum timeout is reached.

### Claim 19

A non-transitory computer readable memory containing instructions for automated testing of an application executed on a computing device, the instructions which when executed by a processor performing:
executing an action on an interface element in the application identified in a test step;
setting a state associated with an element when the interface element is being loaded;
loading the interface element in the application associated with the action;
attempting the action defined for the interface element;
changing the state associated with the interface element during execution;
verify conditions of the element against expected conditions;
applying an adaptive delay between subsequent execution of the actions when the expected conditions for the interface element are not met;
iteratively re-executing the action on the interface element where the adaptive delay is applied until the action is verified or the adaptive delay expires.
