-
Book Overview & Buying
-
Table Of Contents
Advanced UFT 12 for Test Engineers Cookbook
In this recipe, we will see how to write a new implementation of a method for a TO.
From the File menu, navigate to New | Function Library… or use the Alt + Shift + N shortcut. Name the new function library as FR_RegFunc.vbs.
As always, with programming, the task needs to be addressed in an orderly fashion. Therefore, there is a series of implementation steps to follow:
Analyze the requirement, which means ask questions. For example:
What are the missing functions?
To which object class is it relevant?
Design the solution.
Code the function.
Test the function.
Register the function to the required object class.
In the following example, we will write a function in FR_RegFunc.vbs that overrides the WinEdit_Set method. The new method will try to set the field, and if an error occurs, it will check if there is a modal pop-up message that has opened in the Flight Reservation application (refer to Chapter 1, Data-driven Test). If it has opened...
Change the font size
Change margin width
Change background colour