Hello,
As an alternative to NameMapping, you may use scripting search methods:
Find,
FindChild,
FindAll,
FindAllChildren,
Page.NativeWebObject.Find, and others.
>>Maybe a check that looks at the ("UILazyComponent$BasicLazyComponent", "", 5) and check if the id is 1, 2, 3, 4, 5 ... etc and if it finds the exact id to use that?
The index of 5 means that there are at least 6 similar objects (descendants of the UILazyComponent$BasicLazyComponent class; having no caption or accessible name). Thus, the main difficulty is to determine which of these objects is the one you need to test. I assume that some of the object members will allow determining the needed object. For instance, the target control is visible on screen (VisibleOnScreen=True), while the others are hidden (VisibleOnScreen=False). Without examining your application, I can't say exactly which of the fields or properties this would be.
Having spotted the distinctive criteria, you can perform a search for the object:
function Test()
{
var PropArray, ValuesArray, theControl;
// Creates arrays of property names and values
PropArray = new Array("JavaClassName", "AWTComponentName", "VisibleOnScreen");
ValuesArray = new Array("UILazyComponent$BasicLazyComponent", "", true);
// Searches for the control
theControl = Sys.Process("TheTestedAppName").Find(PropArray, ValuesArray, 5);
// Processes the search results
if (theControl .Exists)
Log.Message(theControl .FullName);
else
Log.Error("The object was not found.");
}