“Object not visible” errors displayed for some controls like “WinMenu” in the first time & it requires manual effort for 1st time to access these controls. then it runs correctly.
Could it be that the menu items are created lazily by the application? If your menu_name param is several levels deep try to separate it a step for each level so the sub-items are created e.g.
Window("Calculator").WinMenu("Menu").Select "View"
Window("Calculator").WinMenu("Menu").Select "View;Scientific"
If this works you can RegisterUserFunc
a function that uses Split
to do it automatically.
I had a similar problem with a simple dialog pupop box, QTP kept giving error "object not visible" when trying to do
Browser(title).Dialog("Windows Internet Explorer").WinButton("OK").Click
It frustrated me for hours so I thought I'd post it here in case it's useful to anybody. Note that the tests I'm working with were not written by me and they use an object repository heavily (boourns).
I had to go to Tools > Object Identification
Choose Environment "standard windows" then add mandatory property "visible" for both the Dialog Class and the WinButton Class
Then I deleted and and re-captured the WindButton object and all was well. Not sure if this helps the descriptive programming folks with this issue or not.