Object lookup is acting strange
Hi all,
I have a question regarding object lookups;
I am using this in my tests since I have to check if certain windows are showing or not at the right time.
To reduce my code duplication I did this using object lookups as following;
var windowPaths = {
"vat rates": AddonHost.VATRatesWindow,"adjust dimensions": function () {
return logiComWrapper.confirmationWindow.message.Caption.includes(
"ventilation"
)
? logiComWrapper.confirmationWindow
: Log.Error("The window caption is not correct");
},
"project management import": function () {
return AddonHost.projectImportWindow.selectBtn.Caption.includes("Project")
? AddonHost.projectImportWindow
: Log.Error("The window caption is not correct");
},
"position management import": function () {
return AddonHost.projectImportWindow.selectBtn.Caption.includes(
"Position"
)
? AddonHost.projectImportWindow
: Log.Error("The window caption is not correct");
},
"project estimation data": function () {
while (reynaPro.progressWindow.ProgressDialog.Exists) {}
return logiComWrapper.estimationOptionsWindow;
},
"free cost": AddonHost.addWindow
}
windowPaths[windowName.toLowerCase()]
This is only part of the object lookup, it is much bigger and it seems that whenever I use this it is still running through the complete lookup and searching for all these items whilst many of them are not existing at that point in the program. This make my test fail even though everything is going right.
Somebody that has an idea why this is happening?
Looks like it is only at certain values that he gets stuck and others he just ignores...
I would think the program only tries to read the 'right' part when the 'left' part is the one you are calling?
Thanks in advance,
kind regards.