Run tests

This is a technology preview, enabling you to experiment with AI Codeless testing.

This topic explains how to run AI-based tests using AI Codeless Testing.

Prerequisite

Before you run a test in AI Codeless Testing, you must create a test or open an existing one. For details, see Design tests.

For mobile applications, you also need to connect to UFT Mobile for running the test.

For desktop web applications, your browser must be set up to work with AI Codeless Testing. See Test Web apps for specific browsers.

Back to top

Select the environments on which you want to run the test

AI Codeless Testing identifies objects visually, the way a person would, and does not depend on the objects' properties or implementation. Therefore, you can run the same tests on different platforms and different application versions.

For desktop web applications, you can directly open them in a browser or select an environment consisting of a browser and an URL. For mobile applications, you need to select an environment consisting of a device and an application.

See Open an application to add environments for desktop web applications or mobile applications.

Back to top

Run the test from AI Codeless Testing user interface

After opening your desktop web application in a browser or selecting the environments on which you want to run the test, run the AI-based test you created on your application.

To begin a test run:

  1. Go to the ENVIRONMENTS tab.
  2. Do one of the following:

    To run a test on an open web page:

    To run a test in selected environments:
    1. Select Run on open web page. The environments you added are all disabled.
    2. Click the RUN button. The test runs on the web page you opened.

      Note: If multiple browsers are open, AI Codeless Testing may run the test on any one of them.

    1. To exclude an environment for the current run, clear its check box in the ENVIRONMENTS tab.
    2. Click the RUN button. The test runs on all of the environments you selected, one by one. A spinner indicates the environment is currently in use.
  3. Click STOP to end the run session, or PAUSE to stop it temporarily.

    Note: While a run session is paused you cannot make any change in AI Codeless Testing.

Back to top

Run the test from a command line interface

To run AI Codeless Testing tests from a command line, run the CodelessExecuter.bat command, located in the <UFT One or UFT Developer installation folder>\bin folder.

This enables you to run tests as part of an automation pipeline or from a CI/CD server, such as Jenkins.

Preparation

For mobile applications:

Define the environments in AI Codeless Testing in advance. For details, see Open an application.

For desktop web applications:

Define environments in advance, or use the command options to specify the browser and web page to test.

Note: If you specify options for opening a browser or using an open one, the environments defined in AI Codeless Testing are ignored.

Command syntax

<UFT One or UFT Developer installation folder>\bin\CodelessExecuter.bat <path to test location> [--<option> <option details>]

Command line options (all optional)

--browserType

The type of browser to launch.

Possible values: Chrome, Chromium Edge, Edge, Firefox, Internet Explorer.

Note: This option is required if you use the webPageURL option.

--webPageURL

The URL of the web page to open.

Note: This option is required if you use the browserType option.

--useOpenBrowser

Instructs AI Codeless Testing to run the test on an already open browser.

Default: False.

Note: If multiple browsers are open, AI Codeless Testing may use any one of them.

--leaveAUTOpen

Instructs AI Codeless Testing not to close the application at the end of the test run.

This enables you to run the next text without instructing AI Codeless Testing to open a browser.

Default: False. Unless useOpenBrowser=True.

--resultsPath

The location in which to store the test run results.

Default: The same location as the test.

Note: You can use either browserType+webPageURL or useOpenBrowser but not other combinations of these options.

Back to top

Analyze test results

The test results are provided differently, depending on how you ran the tests.

If you run the test in the AI Codeless Testing user interface:

After the test run ends, the left pane displays the execution result of each step (including conditional steps if there are any) for the open web page or selected environments.

Hover over the test step to show the reason for the failure.

In the right pane, if you run the test in selected environments, the ENVIRONMENTS tab marks the environments with a pass or fail marking.

Click View last report to see a visual HTML report of the steps that ran and their status. This report is similar in format to the UFT One reports.

If you run the test using a command line:

As the test runs, its progress is reported in the console. At the end of the run, the test run results are available in the test folder or in the folder you specified in the command's options.

The report is provided in the following formats:

  • An HTML report. This report is similar in format to the UFT One reports.

  • A Junit XML report.

Back to top

See also: