Add steps from the Keyword View
This exercise describes how to add steps to the SelectLaptop action, by building your steps in the Keyword View.
Add steps to add the HP Chromebook 14 G1 laptop to your cart
This procedure describes how to add a step to browse to the Advantage Online Shopping LAPTOPS page.
Add steps to add the Chromebook to your cart:
-
In UFT One, open the SelectLaptop action from the Solution Explorer or the canvas.
-
If the Editor is displayed, click the Toggle between the Keyword View and Editor button to switch to the Keyword View.
-
Click ADD NEW STEP > Object from repository ...
-
In the Select Test Object dialog, scroll down and select the LaptopsCategory link test object.
The step is added to the action, with the default Click method selected in the Operation column.
-
Click ADD NEW STEP again to add another step. Now, your test objects are automatically shown in the dropdown list.
From the dropdown, select the HP Chromebook 14 G1(ENERGY image test object. This is the test object that represents the HP CHROMEBOOK 14 G1 laptop.
The new step is added to the action, again with the default Click method.
-
Click ADD NEW STEP again to add the last step in your action. From the dropdown, select the save_to_cart button test object.
The new step is added to your test, again with the default Click method.
- Save your test.
Keyword View sample
When you're done adding steps to this action, your Keyword View should look like this:
Editor sample
Switch to the Editor again () to view the code for each step you added. Your code should look like this:
Browser("Advantage Shopping").Page("Advantage Shopping").Link("LaptopsCategory").Click Browser("Advantage Shopping").Page("Advantage Shopping").WebElement("HP Chromebook 14 G1(ENERGY").Click Browser("Advantage Shopping").Page("Advantage Shopping").WebButton("save_to_cart").Click
Next steps: