Forum Discussion

winston's avatar
winston
Occasional Contributor
8 years ago

Property of mapped object available in one project, not others

I have a routine in a script file used by all my various test projects and one line is giving me trouble: 

 

If Aliases.[parentObjects].WaitAliasChild("dlg", 2000).Visible Then ...

 

This line tests if a pop up dialog is visible on the screen so the tests and can handle that situation if it appears.  In some test projects, it works fine and returns either True or False and the script moves on. In other projects I get an error at this line: "The test object was not found when executing the Visible command".  The two projects in question do have different name mapping files, so I think that may be the issue.  When I look at the object in the name mapping editor for either name mapping file, however, it appears to have the "Visible" property. What can I do to try and make this work?

 

Thanks

2 Replies

  • baxatob's avatar
    baxatob
    Community Hero
    Before object becomes visible, it should exists. Try to increase a default waiting time in playback properties of your project. Also you can use .Exists property as a condition of your "if" statement.
  • I think you probably mean to use .Exists instead of .Visible. Try that instead. If it does return True on .Exists, you could then check if the object is Visible. But WaitAliasChild only returns the object if the object exists, so when the popup doesn't happen, there is nothing for you to check the Visible property on.