googleid_111811
12 years agoNew Contributor
Name mapping is missing, everytime the code is executed
I am testing and exe by writing scripts, which is a windows based application. I need to remap all the objects everytime I run the program.
My script is as below :
function main ()
{
TestedApps.StaadFoundation.Run();
var staadFoundation;
var afx;
staadFoundation = Aliases.StaadFoundation;
afx = Aliases.StaadFoundation.Item_27.Afx;
afx.ClickItem("Home|File|&Open");
var fileName = "E:\\Documents\\StaadFoundation\\Models";
var fileNameArray = GetFilesInFolder(fileName);
for(var iFile=0;iFile<fileNameArray.length;iFile++)
{
var StaadFoundationfileName = fileNameArray[iFile];
Log.Message("File Name : " + StaadFoundationfileName);
staadFoundation.dlgOpenProject.OpenFile("E:\\Documents\\StaadFoundation\\Models\\"+StaadFoundationfileName) ;
afx.ClickItem("Home|Design / Analysis|Design / Analysis");
}
"Aliases.StaadFoundation.Item_27.Afx" --> the item name is changing everytime .
An error occurred while calling the "ClickItem" method or property of the "Afx" object.
The object or one of its parent objects does not exist.
Tested Object
Alias: | Aliases.StaadFoundation.Item_27.Afx |
Mapping item: | NameMapping.Sys.StaadFoundation.Item_27.Afx |
Missing Object
Alias: | Aliases.StaadFoundation.Item_27 |
Mapping item: | NameMapping.Sys.StaadFoundation.Item_27 |
Please help me to resolve the name mapping isuue ASAP, as I am just a novis user of Test Complete. I could not solve the matter by using any help given antwhere.