Question

Is there any way to do descriptive programming in testcomplete? In my current project I use NameMapping, But I want to switch to descriptive programming so that I can move object definitions from NameMapping to an external file.

Was it helpful?

Solution

Since TestComplete does not provide such built-in functionality, you need to implement it yourself. Create a script function (you can create a script extension for this) that will return an object by your custom name. This function will read the content of the external file with object definitions, search for the needed object within the object tree and return the found object.

OTHER TIPS

To Achieve this,

  1. Store the 'fullname' of the objects to an external file and use that as object identification. In this case name mapping is not necessary for object identification objString="Sys.Process("explorer").Window("Shell_TrayWnd", "", 1).Window("Start", "Start", 1)"; obj=eval(objString); the above objString can be retrieved from an external file as u need.
  2. store the aliases name in the external file, But for that you have to keep the namemapping in sync objString="Aliases.App.dlgConfirmSaveAs.Confirm_Save_As"; obj=eval(objString);

In both of the above cases, if you are using excel to store the object definitions, retrieve as string values and convert it to object using eval function.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top