aldebaran
14 years agoOccasional Contributor
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?
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?