
Please download the trial version of UFT Developer to get started with this course.
An application model is comprised of a hierarchy of test objects that correspond to the structure of the actual objects in your AUT or a specific area of the AUT.
When you create a new UFT Developer application model, two files are created:
.tsrx . An XML representation of the application model and its objects.
This file is created when you create the application model item or project, and is updated regularly when you add test objects to your application model (using the Object Identification Center, in the Application Model editor, or directly in the file itself).
.tsrx.cs or .java. A file containing the code for the application model class.
Each application model is compiled into a class that can be instantiated in your test, enabling you to access the complete test object model of your application.
This file is generated from the .tsrx file. There are several ways to generate this file, as described in Generate application model code.
Using the application model enables you to maintain your test objects in a single location for use across your entire testing suite, and helps you write your code more quickly, without the need to write manual programmatic descriptions for each object.
Add the application model to the Java build path of your test.
In your UFT Developer test, add an import line for your application model.
For example:
import com.hp.lft.MyAppModel;
For Web, SAP GUI, or Mobile applications, or optionally for Windows-based applications: Define the parent application object that your instance of the application model will use.
For example:
Browser browser = BrowserFactory.launch(BrowserType.CHROME);
or
Window notepadWindow = Desktop.describe(Window.class, new WindowDescription.Builder().windowClassRegExp("Notepad").windowTitleRegExp(" Notepad").build());
Instantiate the application model class.
If you defined the parent object in your code, provide the relevant parent object as the class constructor.
For example:
MyAppModel.appModel = new MyAppModel(browser);
If your application model contains the parent object (for Windows-based objects), instantiate the application model class without a constructor.
For example:
MyAppModel appModel = new MyAppModel();
Use test objects from the application model in your tests.
For example:
appModel.Page().Button();
If the test object methods and properties available for a particular test object do not provide the functionality you need, you can access the native methods and properties of the run-time object in your application using the relevant property/method/function for your programming language.
For example, suppose you have a Web edit test object defined in your test called searchBox. You could access the native (run-time) search box object, and then use the native isDisabled property to make sure your search box has the expected state.
The Test Recorder is a tool for recording user operations and verifications on applications and generating a test script from the recorded steps.
The Test Recorder is a useful tool for accelerating test creation and can be beneficial for:
Creating the main body of a test, which you can later add to and refine manually.
Learning how to write tests gradually, assisting in your learning curve.
Quickly adding steps to an existing test.
Visual Relation Identifiers (VRIs) are a set of definitions that enable you to distinguish between similar objects in your application according to the relative location of their neighboring objects. This can be useful when there are multiple identical objects displayed in your application, such as two copies of a logo or multiple buttons with the label, 'Buy now'.
You must provide a set of regular description properties that enable UFT Developer to identify at least one object in your application, and then add VRI definitions of neighboring or related objects to make your test object unique.
You should select related objects that are expected to maintain the same relative location to your object over time, even if the user interface design changes.
This enables you to help UFT Developer identify similar objects much as a human tester would, and helps create more stable tests that can withstand predictable changes to the application's user interface.
There are a number of possible horizontal and vertical relationships you can define. For a visual demonstration of these relationships, see Horizontal and vertical visual relations below.
VRIs are supported in all UFT Developer technologies, including mobile native applications and mobile hybrid applications.
When you run UFT Developer tests created from a UFT Developer project template, an HTML report is automatically generated. The report includes summary information about the run, as well as detailed information about the captured steps.
Before you begin, make sure to disable the content security policy in your browsers.
For Java and C# tests, you can use UFT Developer > View Last Run Results to open the most recent UFT Developer HTML Report that was generated from the test that ran inside the IDE during the current IDE session.
Note: By default, the report is generated to a folder called RunResults in the project's output path. For example: \bin\Debug\RunResults\runresults.html
JavaScript tests: Open the report from this location.
Use the Search bar and Previous/Next Error buttons inside the HTML page to navigate your report.
By default, the report includes all steps that involve UFT Developer SDK test objects and result in an interaction with objects in your application.
Use Reporter steps to include custom details in the report about events that occur during your test.
By default, the report does not include screen snapshots, but you can modify the test settings to instruct UFT Developer to capture snapshots for steps with errors or for every reported step.
UFT Developer helps you develop automated tests for a wide range of technologies, using standard IDEs with modern programming languages. UFT Developer requires familiarity with the basics of programming in the language you use to develop your tests.
Requirements prior course:
Install the UFT Developer runtime engine on any machine where you want to run UFT Developer tests.
Install one or more supported IDEs and the relevant UFT Developer plugins on any machine where you want to write and edit UFT Developer tests.
In this course, you will learn how to use UFT Developer for Java using IntelliJ and JUnit as testing framework.
In the IDE of your choice, create a UFT Developer testing project, use UFT Developer to create test object descriptions and write tests that can perform operations on your applications.
Create a testing project
Create a UFT Developer testing project in the IDE of your choice, using the project templates provided with the UFT Developer plugins or use your own custom framework.
Customize your test settings
Customize the UFT Developer runtime server settings and report options.
Define test objects
Create test object descriptions that enable UFT Developer to identify the objects in your application and can withstand changes in the application you’re testing.
Write programmatic descriptions or use the visually oriented tools that UFT Developer offers to provide an interface to the tested application and its objects.
Write tests
After you create test object descriptions, write automated tests whose steps call the methods and properties of these UFT Developer test objects.
Add code to verify application behavior
Verify that the objects in your application look and behave as you expect.
When these special steps return false results, the step and test fail, but no exception is thrown and your test continues to run.
This course will cover the following:
Build Application Models
Create Test Scripts
Running Test Scripts
Calculation and custom checkpoints
Output Values and Parametrization
Data Driven Testing
Visual Relation Identifiers
Using Reporter Object
Working with Test Recorder
Summary
Upon successful completion of this course, you will be eligible to:
be more productive
better collaborate
use agile methodologies in a smarter way
support the software delivery lifecycle
take on lead roles in your projects and advance in your career