In this recipe, you will also see an example of how to use the Extern
reserved object to define references to methods in external DLLs such as those of the Win32 API. These methods can then be loaded and executed during runtime. We have already seen an example of this in the Reading values from an INI file recipe in Chapter 1, Data-driven Tests. Here, we will learn how to implement a function that draws a rectangle on the screen with the color of your choice. This is useful to mark areas on the screen that are of interest (especially when the test fails) and hence, makes the report analysis task more efficient.
From the File menu, navigate to New | Test, or use the Ctrl + N shortcut.
To complete this recipe, we need the global Extern
object, which, with proper use, provides UFT with access to the methods of an external Dynamic Link Library (DLL). We will define a variable and assign it a reference to the global...