Add steps by recording
This exercise describes how to add steps to your test by recording. Recording enables you to perform the test as a user would, enabling OpenText Functional Testing to create test steps for you as you go.
Record steps for the FlightFinder action
This procedure describes how to record OpenText Functional Testing test steps for finding a flight in the MyFlight app.
To record steps for finding a flight:
-
Start with the MyFlightApplication solution and MyFlight test open to the FlightFinder action.
-
Open the MyFlight app, and log in. Enter john and hp as the username and password.
For more details, see Explore the sample MyFlight application.
Tip: Arrange your windows so that you can view the MyFlight app and the tutorial at the same time.
-
In OpenText Functional Testing, select Record > Record and Run Settings.
Then, select Record and run test on any open Windows-based application.
-
In OpenText Functional Testing, click the Record toolbar button
.
The main OpenText Functional Testing window is hidden, and the Recording toolbar appears, displayed together with the MyFlight app.
-
In the MyFlight app, search for a flight from Los Angeles to Sydney.
Select a future date, Business class, and 2 tickets.
Note:
-
To successfully record the datePicker object, click the date input box first. Do not directly click the calendar icon.
-
We recommend selecting a date far in the future. You'll be making copies of this test for subsequent exercises, and will run into errors if your date is in the past at that point.
-
-
Click FIND FLIGHTS to display the SELECT FLIGHT page.
-
On the recording toolbar, click
to stop recording.
-
Save your test, and continue with Add steps from the Toolbox pane.
Tip: If you plan on running this test on a different day, update your datePicker step in the Editor to avoid having to change the date each time.
For details, see Update your step to run on a different day.
View your steps in the Keyword View
In the Keyword View, the FlightFinder action should look like this:
View your steps in the Editor
In the Editor, your recorded steps in the FlightFinder action should look like this:
WpfWindow("OpenText MyFlight Sample").WpfComboBox("fromCity").Select "Los Angeles"
WpfWindow("OpenText MyFlight Sample").WpfComboBox("toCity").Select "Sydney"
WpfWindow("OpenText MyFlight Sample").WpfCalendar("datePicker").SetDate "29-May-2018"
WpfWindow("OpenText MyFlight Sample").WpfComboBox("Class").Select "Business"
WpfWindow("OpenText MyFlight Sample").WpfComboBox("numOfTickets").Select "2"
WpfWindow("OpenText MyFlight Sample").WpfButton("FIND FLIGHTS").Click
Update your step to run on a different day
If you plan on running this test on a different day, edit the datePicker step value to avoid having to change the date each time.
In this example, update the following line:
WpfWindow("OpenText MyFlight Sample").WpfCalendar("datePicker").SetDate "29-May-2018"
to:
WpfWindow("OpenText MyFlight Sample").WpfCalendar("datePicker").SetDate now + 10
Next steps: