Forum Discussion
If I understand what I'm seeing, the window you're waiting for is what you have represented by "Aliases.update_complete_window_object_name". This explains your problem because when you assign the variable, it's trying to assign the window which, as you said, doesn't exist. If that's the window that you want to wait for, I'd write the code like this
var dlg = Aliases.WaitAliasChild('update_complete_window_object_name', 120000);
if (!dlg.Exists){
Log.Error('The upload window did not appear within 2 minutes');
}
See, WaitWindow needs to be called on the parent object of the window that you're waiting for. However, in your case, the object is actually an Aliased object so I opted to use WaitAliasChild and set the max wait time to 2 minutes.
The "Aliases" object doesn't have the WaitWindow method... so, in that case, if you still want to use WaitWindow, I'd go with something like
var dlg = Sys.Process('MyApp').WaitWindow('abc','Update Complete', -1, -1)
- sameerjade9 years agoFrequent Contributor
Thank you Robert for your reply.
When I used the following code, I get an error : "JScript runtime error..the aliases object does not have a child with the name 'update_complete_window_object_name' ".
var dlg = Aliases.WaitAliasChild('update_complete_window_object_name', 120000); if (!dlg.Exists){ Log.Error('The upload window did not appear within 2 minutes'); }About this, using this I can apply WaitWindow but I still run into the same problem i.e. it's trying to assign to variable dlg, the window which does not exist. But I suppose that is expected behavior.
var dlg = Sys.Process('MyApp').WaitWindow('abc','Update Complete', -1, -1)Thanks,
Sameer
- tristaanogre9 years agoEsteemed Contributor
Not necessasrily. WaitWindow, when it returns, will return either the object being waited for or an empty "stub" object with the Exists property = false. so... something else is going on. The key is in utilizing the proper wait method.
You have this in your original post:
var dlg = Aliases.update_complete_window_object_name;
I assume that meant that the Aliases object did have an Alias by the indicated name (update_complete_window_object_name).
I think what we need to proceed is two things:
1) a screenshot showing your Aliases object and the mapped object that corresponds to the window you are looking for
2) a screenshot of the object browser showing your application and the dialog window you're looking for.
Those two things will help us figure out the best way to get you what you need.
- sameerjade9 years agoFrequent Contributor
I am now able to get this to work. I was previously setting 'MyApp' as the object that I was waiting for rather than its parent object. Like you mentioned in your previous comment, wait window works for the parent object. I made the correct and now it works when I use wait window with the parent object. Thanks!
var dlg = Sys.Process('MyApp').WaitWindow('abc','Update Complete', -1, -1)