Design tests

GUI Mobile and Web tests only

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

Design AI-based tests automatically, using AI Codeless Testing inspection, or manually, writing the steps in plain English.

Overview

AI Codeless Testing enables you to inspect and design tests for desktop web applications as well as applications on mobile devices that are hosted on UFT Mobile.

A general procedure for designing a test involves two parts:

  • Create environments on which you can run your test later.
  • Inspect an application in one of the environments to automatically create test steps.

For a desktop web application, you can skip environment creation and directly open your application in a browser to allow AI Codeless Testing to inspect. Supported browsers include Chrome, Edge, Internet Explorer, Firefox, and Chromium Edge.

Back to top

Prerequisites

Note: UFT One and UFT Developer must be closed in order to run AI Codeless Testing.

Before you start, review the following requirements.

  • For desktop web applications, check whether your browser is set up to work with AI Codeless Testing. For details, see Test Web apps for specific browsers.

  • For applications on mobile devices, connect AI Codeless Testing to UFT Mobile first.

    Once you connect successfully to a UFT Mobile server, the next time you open the tool, it automatically connects.

Back to top

Open an application

Note: If you already opened a desktop web application in a browser after you start AI Codeless Testing, skip this section and go to next section.

To create a test, you need to create environments and open your application in one of the environments for AI Codeless Testing to inspect.

You can add up to 3 environments. Create a test in one of the environments, then run the test on all the environments in a single run session, one after the other.

To create environments for desktop web applications To create environments for mobile applications
  1. Make sure that your browsers are set up to work with AI Codeless Testing. For details, see Prerequisites.
  2. In the ENVIRONMENTS tab, click + Add new environment.
  3. Select Web. A window for adding an environment opens.
  4. In the window, select a browser, enter URL, and click APPLY.
  5. Repeat the above steps to add up to three environments.
  6. Click Launch on the right section of an environment card.

  1. Make sure you are connected to a UFT Mobile server. For details, see Prerequisites.
  2. In the ENVIRONMENTS tab, click + Add new environment.
  3. Select Mobile. A window for adding an environment opens.
  4. In the window, select a mobile device and an application/URL for your test.

  5. Click APPLY. The environment is added to the ENVIRONMENTS tab. Repeat the above steps to add up to three environments.
  6. Click Launch on the right section of an environment card to open the mobile application in a remote access window.

After you launch an environment, for a desktop web application, the application automatically opens in the browser; while for a mobile application, the application opens in a separate remote access window. For details about the remote access window, see Device control panel.

The green check mark with text Launched on an environment card indicates that the application is opened in the browser or remote access window.

To edit or delete an environment, hover over the environment card and click or in the upper right corner.

To close the remote access window, click the X in the corner of the window.

To adjust the sizes of the left pane and right pane of AI Codeless Testing, drag the splitter in the middle.

Note: If you are disconnected from UFT Mobile, the mobile environment you added still remains in the interface but you cannot launch, edit, or run a test in it.

Back to top

Inspect your application for objects

After opening an application, AI Codeless Testing can identify the objects in the application visually, similarly to the way a person would. You can then add steps to your test that perform operations on these objects.

For the types of objects Codeless identifies and the operations supported on these methods, see the AI-based testing section of the UFT Help Center.

To inspect your application for objects:

  1. Make sure you have successfully launched an environment and navigated to the screen or page of your application whose objects you want to test. For details, see Open an application.

    Skip this step if you already opened your desktop web application without creating an environment.

  2. In the IDENTIFY tab, do one of the following:

    If you opened a desktop web application without creating an environment If you successfully launched an environment
    1. Select Web page from the INSPECT ON drop down and click CHOOSE.
    2. After AI Codeless Testing is minimized, click on the open web page.
    1. Click INSPECT ON drop down.

      The Environments option and the environment that was successfully launched are selected by default.

    2. Click INSPECT.

    AI Codeless Testing then displays the current screen of your app or web page and begins inspecting it. When the inspection is complete, AI Codeless Testing highlights the objects that it identifies.

    • Select the Visual Elements and/or Texts check boxes to show the desired objects in your app or web page.
    • Click the Maximize button to pop up a large window so that you can view the inspection result better.

    Tip: As you navigate within the browser or device, to inspect the current page or screen, click the Re-inspect application button .

  3. If AI Codeless Testing was unable to identify an object in the web page or app, click the Help us to improve link in the IDENTIFY tab.

    The Feedback Tool window opens the application's current page or screen, highlighting all of the identified objects. Provide details about the objects and click SEND FEEDBACK. For details, see the Feedback Tool documentation.

Back to top

Add AI steps

Once you have the objects in your application highlighted, you can add AI steps to your test with a single double-click.

Alternatively, you can use AI Record under the IDENTIFY tab to automatically create AI steps in a recording session. For how to use AI record, see Use AI Record in Codeless.

To add AI test steps:

  1. Make sure you are in the IDENTIFY tab and that you have inspected your application.

    The IDENTIFY tab shows the page or screen currently displayed in the browser or remote access window.

  2. Double-click on any of the highlighted objects.

    AI Codeless Testing adds the object to the test. For value and text fields, AI Codeless Testing first prompts you to confirm a value or to edit the text.

Since these steps were created with AI inspection, they are marked with an AI indicator.

To edit or fine-tune these steps, see Manually create or edit test steps.

Note: Avoid adding steps with objects that were incorrectly identified. For example, if a button is identified as a text box, or a check mark is identified as a button, such objects may be identified inconsistently and fail in subsequent test runs.

Back to top

Add property-based steps

You can also add property-based steps to your test using the built-in Spy. Use this option if the AI engine was unable to identify an object. Note that if you add property-based steps, you cannot run the test on a different environment.

To add property-based test steps:

  1. Make sure the browser or remote window is open. Click the IDENTIFY tab. This tab shows the current display of the browser or device in the remote access window.
  2. Click IDENTIFY BY PROPERTIES button. The focus moves to the browser or remote access window. Click on an object that AI engine was unable to identify.

    AI Codeless Testing opens a dialog box with the identified object name and properties.

    Note: The Spy in AI Codeless Testing supports only Web and Mobile technology.

  3. Accept the default values or edit them as required.
  4. Click APPLY. A step is added to the AI Codeless Testing step list.

    Since these steps were created with property-based detection, they are marked with a PB (Property Based) icon.

  5. If necessary, modify the step. Click the EDIT STEP tab:

    1. Check the Object Hierarchy. To modify the captured value, select an entry from the drop down or click the Highlight Object button to locate the selected object in the application.
    2. Make the necessary edits, such as logical name, action, and if applicable, value.
    3. For additional step-editing options, see Manually create or edit test steps.

  6. Repeat the above steps to spy on additional objects.

Back to top

Manually create or edit test steps

You can also create test steps manually by adding an object and an action, using the AI Codeless Testing artificial intelligence.

Note: You can redo or undo any changes made to a step in the left step editor by using the default shortcut key.

To manually add a test step:

  1. Make sure the browser or remote window is open.

  2. To add a new step, click the Add Step button at the bottom of the step list.

  3. In the EDIT STEP tab:

    1. Type a class in the Object Class drop down. Type the first letters to view a list of the available classes. Click the Highlight Object button to locate the selected object in the application.

    2. If applicable, type a name for the object.

    3. Select or accept the default action for the selected object. AI Codeless Testing adds your selections to the current step.

    4. For text steps, you can set the object class property to Partial Text. This capability finds your text anywhere and clicks it, even if it is part of a larger text block.

      If you select this option, a PT indicator is added to the test step.

    5. If relevant, click in the step and expand the Position section. Specify a position and index for the object.

      If you select this option, a P indicator is added to the test step.

  4. You can also type directly into the step box, using the syntax rules described in Test step syntax.

    • As you type, if AI Codeless Testing detects an error or incomplete syntax, it displays a red symbol in the step, underlines incorrect text, and shows an error message in the EDIT STEP tab.

    • As you type, if you enter an object class that cannot be recognized by AI, hover over the object and click the Identify pop-up to enter the spy mode.

    If you type your step directly, you may want to configure additional step details in the EDIT STEP tab, such as Position, Partial text, and Verify step options such as timeout and Stop run upon failure.

  5. To omit the step temporarily from your test, select the Disable this step check box. You can re-enable it any time. For details, see Manage your test script.

Back to top

Add conditional test steps

Conditions such as If and If/Else highly increase the control over test runs, making your test more resilient and robust. You can include a condition easily in your test script using AI Codeless Testing.

To add conditional test steps:

  1. Use one of the following ways to add a condition:

    • Type If in an empty step and press Enter to form an If condition block. To form an If/Else condition block, you also need to type Else in another empty step.
    • Click If or If-Else button to automatically form a condition block.
  2. Edit steps in an If or If/Else condition block. See Step 3 and Step 4 in Manually create or edit test steps.

Back to top

Add verification steps to your test

You can add a verification step that checks whether an object exists or does not exist in the application. This may be helpful, for example, to make sure an object is present before performing an operation on it.

If the condition specified in the Verify step is not met, the step fails. For example, if the step is Verify the button exists, the step fails if the button does not exist.

A Verify object exists step on a property-based object may succeed even if the object is not visible in the application.

You can create a verification step using any of the methods described above for adding a step.

To create a verification step using the EDIT STEP tab:

  1. Select an object for your step.

  2. Select the Verify action.

  3. Select the Exists or Does not exist option, to specify which condition the step checks. (Default: Exists)

  4. Define a Timeout in seconds for how long to wait for the step's condition to be met. (Default: 20)

  5. If you want the test run on the current environment to stop if the verification step fails, select Stop test run upon failure.

    Otherwise, the step failure is reported but the run continues. (Default: Run does not stop)

If you type a verification step directly into the step box, use the syntax rules described in Test step syntax. Then use the EDIT STEP tab to set the Timeout and Stop test run upon failure options.

If you select the Stop test run upon failure option, a Stop indicator is added to the test step.

Back to top

Manage your test script

This section explains how to edit, move, duplicate, and otherwise manage the steps in your test.

To manage regular steps:

To... Do...
Edit a test step

Edit a test step using the syntax rules described in Test step syntax.

As you type, AI Codeless Testing indicates whether your syntax or object is valid. If it detects incomplete syntax, it displays a red symbol and underlines incorrect text.

Reorder a test step

Hover over the vertical drag bar in the left margin, and drag the step to the desired location in the step list.

Remove a test step

Hover over a step, right-click it, and select DELETE.

The last remaining step cannot be deleted, but you can manually remove its content.

Disable a test step temporarily

Do one of the following:

  • Hover over a step, right-click it, and select DISABLE.
  • Select a step and then select Disable this step in the EDIT STEP tab.

To enable a disabled step, hover over the step, right-click it, and select ENABLE or clear the Disable this step option.

Duplicate a test step

Do one of the following:

  • Hover over a step, right-click it, and select DUPLICATE. A same step is added in the row below the step.
  • Press CTRL, and drag the step to the location you want. A same step is added to the row you want.
Copy and paste a test step or step text
  • To copy and paste a test step, select the step and press CTRL+C and V to paste it to an empty step in AI Codeless Testing. The new step will have the same metadata.

    If you paste it to an existing step, the step is created in the next row.

    You can also paste it from AI Codeless Testing to any other editors as plain text.

  • To copy and paste a text in a test step, select the text, and press CTRL+C and V to paste it to another step in AI Codeless Testing.
  • You can copy and paste a plain text step or multiple plain text steps from other sources to AI Codeless Testing.

Note: Once you successfully copied a step in AI Codeless Testing, the step is automatically copied to the clipboard as plain text.

Disable, duplicate, or remove multiple test steps

Press CTRL, select these steps, right-click them, and select DISABLE ALL, DUPLICATE ALL, or DELETE ALL.

Note:  

  • You can right-click these disabled steps and select ENABLE ALL to enable them again.
  • You cannot delete all steps. An empty step still remains in the left step editor.

To manage conditions:

To... Do...
Remove a condition block

Do one of the following:

  • Delete the word If or Else to destruct an If, Else, or If/Else block and delete all conditional steps.
  • Select all steps included in an If, Else, or If/Else block, then right-click and select DELETE ALL.
  • To remove the Else parts from an If/Else block, hover over the Else step, right-click it, and select DELETE.

    You cannot hover over the If step, right-click it, and select DELETE to delete the whole condition.

Disable a condition block temporarily

Do one of the following:

  • Hover over the If or Else step, right-click it, and select DISABLE.

    If you right-click on the If step and select DISABLE, the whole If or If/Else block (including Else parts) is disabled.

    If you right-click on the Else step and select DISABLE, only the Else parts are disabled.

    To enable the disabled block, hover over the block, right-click it, and select ENABLE.

  • Select the If or Else step and then select Disable condition or Disable else block in the EDIT STEP tab.

    To enable the disabled block, deselect Disable condition or Disable else block. Alternatively, you can hover over the block, right-click it, and select ENABLE.

  • Select all steps included in an If, Else, or If/Else block, then right-click and select DISABLE ALL.

    To enable the disabled block, hover over the block, right-click it, and select ENABLE ALL.

Duplicate a condition block

Do one of the following:

  • Hover over the If step, right-click it, and then select DUPLICATE. The whole If or If/Else block (including Else parts) is duplicated.
  • Select all steps included in an If, Else, or If/Else block, then right-click and select DUPLICATE ALL.

Note:  

  • The duplicate function is not supported for Else parts.
  • You cannot duplicate an If or If/Else block by pressing CTRL and dragging it to your desired position.
Exit a condition block

Select the last step of the condition block and do one of the following:

  • Press Enter twice to exit it.
  • Press Enter and Backspace to exit it.
Manage test steps inside a condition block

See the table above to manage test steps inside a condition block.

If you right-click the If step and select DELETE, the If step is deleted and the rest part in the If or If/Else block becomes normal test steps without indentation.

Note: An Else step becomes invalid if it exists independently.

Manage test steps inside different condition blocks

See the table above to manage test steps inside different condition blocks.

If you duplicate multiple steps inside different condition blocks, all selected steps are copied to rows outside of the blocks in original execution order.

Back to top

Next steps: