Calling Nested Methods

Sometimes you cannot retrieve 4Test-compatible information about a Java control with a single call to a 4Test method; instead, you need to call several nested methods, each returning an intermediate object to be passed to the next method. If any of these methods returns intermediate results that are not 4Test-compatible, you will not be able to perform these nested calls from 4Test.

You can use the following methods to call nested methods:
Method Agent What it does
InvokeJava Classic Agent This method allows you to invoke a Java class from 4Test for manipulating a nested Java object.
invokeMethods

Classic Agent

Open Agent

Allows you to perform nested calls inside Java, even if intermediate results are not 4Test-compatible.You can call invokeMethods for any Java object as long as you add the invokeMethods prototype inside the object's class declaration.

Example: How to add an invokeMethods prototype to your script

This example shows how to add an invokeMethods prototype inside the declaration for a JavaAwtListBox in javaex.inc.
winclass JavaAwtListBox : ListBox
  tag "[JavaAwtListBox]"
  
  setting MultiTags = {TAG_CAPTION}
  
  obj AnyType invokeMethods(list of Strings stra, List of List of Anytype anyaa)