Forum Discussion

aldebaran's avatar
aldebaran
Occasional Contributor
14 years ago

Simulate Clicking on a certain item in MenuBar

Hello,



I try to write a Test, which simulates a click on a certain Item of a menu bar.

As long as I create the test by appending actions to test by OnScreenActions, the test will be successful.

But the Click on the menuItem is now simulated by giving the Click-position by x- and y- position of the Click.

I wold like to simulate the Click on a certain Item of the Menu, equal on which position this item is.

So I wrote a Script to manage it:



Function ClickMenuBar(MnuObj)



  MnuObj.Click("Save")

 

End Function



My keywordtest gives the MnuObj as parameter to the script. It is original the menu, that is named to be clicked, when I create the click by appending this action to test by OnScreenActions.



But by simulte the click on menubar by my Script, an exception is thrown: Object required: 'MnuObj'



Has someone an idea, what is wrong with myscript?


1 Reply

  • Hi Carsten,



    Please provide us with the following information:

    1. The programming language of your application.

    2. The name, vendor, and version of the menu control used in the application.

    3. Does the ClickMenuBar script routine work when you call it from a script instead of calling it from a keyword test?



    Also, to help us investigate the problem, please zip your entire project suite folder along with the log of the failed test execution and send us the archive. Make sure that messages in your log correspond to the latest version of your tests.