-
Book Overview & Buying
-
Table Of Contents
Advanced UFT 12 for Test Engineers Cookbook
In this recipe, we will see how to implement a generic Login class. The class captures both, the GUI structure and the processes that are common to all applications with regard to their user access module. It is agnostic to the particular object classes, their technologies, and other identification properties. The class shown here implements the command wrapper design pattern, as it encapsulates a process (Login) with the main default method (Run).
You can use the same function library cls.Google.vbs as in the previous recipe Implementing a simple search class, or create a new one (for instance, cls.Login.vbs) and associate it with your test.
In the function library, we will write the following code to define the class Login:
Class Login Private m_wndContainer 'Such as a Browser, Window, SwfWindow Private m_wndLoginForm 'Such as a Page, Dialog, SwfWindow Private m_txtUsername 'Such as a WebEdit, WinEdit, SwfEdit Private...
Change the font size
Change margin width
Change background colour