Set up UFT and create your test structure
Configure your UFT machine for running web tests. Then, create a new test structure to test the AdvantageDEMO site.
Add the Functional Testing browser extension
Before testing a web app, you must enable the Functional Testing Agent or Extension relevant for the browsers you want to test.
This tutorial uses the Chrome browser to create and run your test. Add and enable the Functional Testing Agent Chrome extension before continuing.
For details, see Enable the Functional Testing Agent Chrome extension.
Once enabled, you'll see the Micro Focus Functional Testing Agent icon in your browser toolbar:
Define your internet options auto-complete settings
Define your Windows Internet options to disable autocomplete for forms, usernames and passwords.
Do the following:
Open your Windows Internet Options dialog box.
On the Content tab, in the AutoComplete area, click Settings.
Clear the checkboxes for Forms and User names and passwords on forms.
- Close the dialog boxes when you're done.
Create a new UFT solution, test, and actions
UFT actions are the building blocks of your test. This exercise describes how to create separate, modular actions to represent each of the steps in the following user flow on the AdvantageDEMO site:
- Logging in to the site
- Selecting a laptop, and adding it to the cart
- Checking out and paying for the laptop
- Logging out of the site
First, close your browser window. UFT will only recognize and record on browser windows opened after UFT has been opened.
Then, click the UFT shortcut from your desktop, or access it from the Windows menu.
After the splash screen closes, in the Add-ins Manager, confirm that the Web Add-in is selected, and clear all other Add-ins.
Tip: We generally recommend loading only the add-ins required for your test. This keeps your test lean and simple, and also enhances UFT performance.
Create a new test
Click the button, and confirm that GUI Test is selected.
Enter the following details:
Keep the default:
C:\Users\<user>\Documents\Unified Functional Testing
Ensure that the Create directory for solution checkbox is selected, and then click Create.
Tip: UFT solutions enable you to group your tests according to functionality, and open and edit multiple tests or other documents in the same UFT session.
Solutions also enable you to share resources across tests.
Your test appears in the Solution Explorer and the canvas with a default action:
Do the following:
Rename Action1 to Login.
In the canvas, right-click the Action1 box and select Action Properties.
- In the Name field, enter Login.
- In the message that opens about this action being a reusable action, click Yes.
For details, see More about reusable test actions.
- Name your new action SelectLaptop.
- Ensure that both Reusable Action and At the end of the test are selected.
Repeat the previous step to create additional actions, named Checkout and Logout.
Save your test when you're done.
Your test should look like this: