testcase Section
Exercise 18 – Apply Rescan, Value Range and Module Merge
Objective
By the end of this exercise, you will be able to rescan a Module and then merge two Modules to avoid duplication.
Why is this important?
Modules are technical representations of the SUT in Tosca. They do not have to be recreated every time you wish to change
them; they can be amended. This also implies that Modules can be reused any number of times and are not specific to any
TestStep. Therefore, you should not have multiple Modules for the same controls. Module Merge helps solve this duplication
problem.
Instructions
In the Web Shop, add items to your shopping cart; navigate to the “Shopping cart” page and apply a discount
code named “AutomationDiscount2”.
1.
Leave the page open as you will be asked to scan it momentarily.
Within the Modules Section, navigate to Webshop>>Completed>>Checkout Process>>Exercise 18 -
2.
Rescan, Value Range and Module Merge.
3. Within this folder, right-click on the Module “Webshop | Shopping Cart | Rescan” to rescan it.
In addition to the controls already selected, ensure the following controls are also selected:
• Update shopping cart button
• discountcouponcode textbox; rename it to Enter discount code
4. • Apply coupon button
• Coupon applied message DIV; rename it to Coupon applied message
• giftcardcouponcode text box; rename it to Gift card coupon code
• Add giftcard button
Add a value range of possible codes to the ModuleAttribute “Enter discount code” in the Module you just
rescanned. The range should include the following values:
• AutomationDiscount2
• PercentageTotal
5.
• PercentageShipping
• FlatTotal
Make sure there are no spaces in between the values and that you separate them by semicolons.
Expand all folders in the Module Folder “Check out process”.
Note: Currently, there are two “Shopping Cart” Modules. One is “WebShop | Shopping Cart” and one is
6. “WebShop | Shopping Cart | Rescan”, which is in the Module Folder “Exercise 18 - Rescan, Value Range and
Module Merge”.
Select both Modules simultaneously by clicking CTRL+Click.
7. In the top ribbon, on the Modules tab, select Merge Modules.
Ensure that the Module “Rescan Cart” (the one you just scanned) is listed as the Target Module. If it is not,
choose the option to Switch Modules.
The Target Module is the one you will keep. Therefore, you need to select the Attributes you want to bring
8.
from the Source Module into the Target Module.
Because of their identical properties, Tosca should automatically link the Attributes which exist in both
Modules.
32
If you are using Tosca version 15.0 or higher, you may notice a warning message besides Self-Healing
steering parameter, please click on the red cross icon to remove this property and merge the modules
successfully.
Click Merge. Tosca will let you know how many Attributes have been updated and which usages have been
relinked to the new Module. It will also delete the Source Module.
9.
Click Close. Rename the Module from “WebShop | Shopping Cart | Rescan” back to “WebShop | Shopping
Cart” and save your work.
Hints
» To identify tables, use Mark on Screen to locate the correct one.
» AutomationDiscount2 will apply a discount of 20% to the total value of the order.
33