You can access individual objects of Oracle Forms/EBS applications, their internal properties and methods and use them in your automated tests.
About accessing native methods
TestComplete identifies individual GUI objects in Oracle Forms/EBS applications. You can automate testing operations on these objects (for example, simulating user actions, or checking an object’s state) by using special properties and methods that TestComplete provides for all onscreen objects and specially for Oracle Forms objects.
If these properties and methods are not enough for your testing needs, you can use native methods of Oracle Forms objects. These are the same methods that are available in the tested application’s source code as well as custom methods implemented by the application developers.
This way, you can simulate almost any operation in a tested Oracle Forms/EBS application, even those operations that cannot be performed via the GUI.
TestComplete recognizes these objects as Java objects and marks them in the Object Browser with the glyph. To view the native methods available to an object, switch the Object Browser or Object Spy to the Advanced view mode. You will be able to access private, protected and public methods and fields of Oracle Forms objects. The Object Browser shows native methods under the Java category.
Calling native object methods
When testing Oracle Forms/EBS, you can call their object methods from your tests.
To call an object’s method from script code, you use the dot operator "
." (in VBScript, JScript, Python and DelphiScript projects) or square bracket notation
[" "] (in C++Script and C#Script projects) to specify the method name after the object name.
For example, in script code you can call the native
select_2 method of a popup list as follows:
Call Aliases.jp2launcher.frame.popList.select_2("item 1")
If a native method (or field) has the same name as the test object method (or field) provided by TestComplete, the native method (field) can be accessed via the
NativeJavaObjectproperty. For example, you can access the native
validatemethod in Oracle Forms as follows:
TestComplete supports access to array objects. To address array items, it adds the
Lengthproperties to the appropriate scripting object.
Lengthspecifies the array size and
Itemsprovides access to elements by their indexes (zero-based), for instance,
TestComplete represents multi-dimensional arrays as arrays in which every item is also an array. For instance, if
javaArrObjis an array that has three dimensions, you can access its elements in the following way:
If an object has overloaded methods (methods with the same name but with different parameters and they return value types), TestComplete adds indexes to method names to distinguish them. For example,
GetMousePosition_2(). To determine to which overloaded method a method name with an index corresponds, examine the method’s parameter list in the Object Spy, Object Browser or Code Completion.
The leading underscore ( _ ) in property and method names is replaced with the character z. For example, a property named
_flagis accessed as
zflag, a method named
__reset()is accessed as
z_reset(), and so on.