Access Alias Path Information from Stub Objects in TestComplete
Context
When a TestComplete alias object isn’t yet present in the UI, TestComplete returns a stub object. These stub objects currently expose only .Exists. Unfortunately, this makes it hard to dynamically determine the full alias path (.MappedName or .FullName) until the object exists. The information does exist somewhere as the stub object is defined in code by calling the Alias.
Problem
QA Engineers writing reusable functions often need to accept an alias object as a parameter, discover its parent/child path, and call WaitAliasChild step-by-step. This creates a circle.
- To call WaitAliasChild, you need the parent alias name and the child name.
- To discover those, you need .MappedName or .FullName.
- But those properties aren’t available until the object exists—exactly when you no longer need to wait.
Which forces brittle workarounds like:
- Passing hard-coded alias strings (error-prone, breaks IntelliSense and alias tree binding).
- Parsing alias paths out of exception messages (fragile).
- Re-architecting tests to rely solely on string paths, which loses the benefits of the Aliases library and auto-completion.
Requested Enhancement
Provide a supported way to obtain the full alias path of a stub object before it exists. For example:
// Current stub:
{ Exists: false }
// Suggested:
{ Exists: false, MappedName: "Aliases.Application.SearchField", FullName: "Sys.ApplicationName.MainWindow.SearchField" }
or a dedicated API:
aliasObj.GetAliasPath();
// returns
"Aliases.Application.SearchField"
aliasObj.GetFullName();
// returns
"Sys.ApplicationName.MainWindow.SearchField"
Benefits
Enables dynamic, reusable functions that accept alias objects as parameters.
Eliminates the need for fragile string-based or error-parsing hacks.
Keeps code strongly tied to the Aliases tree for maintainability and IntelliSense.
Example Use Case
function test(aliasObj) {
var parentPath = aliasObj.GetAliasPathParent();
var childName = aliasObj.GetAliasChildName();
var child = parentPath.WaitAliasChild(childName, 10000);
}
test(Aliases.Application.Screen1.SearchField);
test(Aliases.Application.Screen2.SubScreenA.SearchField);
Reasoning for this solution
The stub object is defines by calling the Alias, therefore it is somewhere available in the code. An example of how this works can be seen in the aqObject.CheckProperty native TestComplet function. In the Test Log the Alias is actually listed in the details tab of the error, even is the object does not exist. This proves that the Alias is accessible even though the object cannot be assessed.
See stubAlias.png attached.
Summary
Expose alias metadata (MappedName/FullName) on stub objects or provide a safe method to query it.