Simulating right click and selection from context menu

Doug Easterbrook doug at artsman.com
Thu Dec 29 10:53:30 EST 2016


hi Greg:

if you are doing automated testing of a function behind a popup menu, then the best bet is to stick the method in the window … and and have the menu call it.


then for automated testing, you don’t bother with the popup menu….       you just need to call the method directly.

just my thoughts.

Doug Easterbrook
Arts Management Systems Ltd.
mailto:doug at artsman.com
http://www.artsman.com
Phone (403) 650-1978

> On Dec 29, 2016, at 7:55 AM, Grzegorz (Greg) Pasternak <grzegorz at niagara.com> wrote:
> 
> Doug;
> 
> Yes, I meant Studio not java script client.  
> 
> The intention is to use this code in automated testing (sending messages to app to trigger certain actions and consequently get results).
> 
> This code:
> =======================================================
> Queue set current field {[pRow.cFldName]}
> Queue click (Shift,Command/Ctrl) {[pRow.cFldName] (pRow.cLineNo)}
> ;  
> Set reference vRef to $cinst.$objs.[pRow.cFldName]
> Popup menu [vRef.$contextmenu]
> =======================================================
> 
> will popup the context menu automatically (which is what I am after).
> 
> However, the above code is using explicit command "Popup menu"
> I was thinking that queuing "right click" would be possible and would automatically popup context menu.
> 
> I think I will settle for "Popup menu" to put the issue to rest.
> 
> Thanks for your help.
> 
> Greg
> 
> 
> On Dec 29, 2016, at 9:41 AM, Doug Easterbrook <doug at artsman.com> wrote:
> 
>> hi Greg:
>> 
>> I’m assuming you are talking studio, not the javascript client.
>> 
>> there is a $contextMenu property on all fields and on the complex grid control itself that you can attache a menu to — then it works as a context menu with programming on your part.
>> 
>> or in one of the ‘ev' methods like evclick — use popupmenu from list or popup menu   (popup menu can get you to open any of the menus that you’ve got in your application
>> 
>> or, if you want, use owrites popup menu to make hierarchical menus if you need them
>> 
>> 
>> 
>> on the other hand, in reading your note…..   it could seem like you don’t want the menu, just to execute an action within the menu.
>> 
>> if you just want to excute code that is in the menu, I’d take it out of the menu and call it directly.     within the menu, you can also call the code.
>> 
>> eg.
>> in our menus, we typically have something like      do   windowref.$doBtnYYYYY
>> 
>> and $doBtnYYYYY is in the window so that the function can be called from popup menu, toolbar menu, button on the screen or via a simple method call if we want.
>> 
>> 
>> not sure if thats what you are after.
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> Doug Easterbrook
>> Arts Management Systems Ltd.
>> mailto:doug at artsman.com
>> http://www.artsman.com
>> Phone (403) 650-1978
>> 
>>> On Dec 29, 2016, at 7:23 AM, Grzegorz (Greg) Pasternak <grzegorz at niagara.com> wrote:
>>> 
>>> I need to simulate user action to pop up context menu from the list in grid control following by selection of the menu item.
>>> 
>>> I have tried following to open context menu:
>>> 
>>> Queue set current field {[pRow.cFldName]}
>>> Queue click (Shift,Command/Ctrl) {[pRow.cFldName] (pRow.cLineNo)}
>>> 
>>> where pRow is parameter passed to this method.
>>> 
>>> No luck so far.
>>> 
>>> What else can I try?
>>> 
>>> Greg
>>> _____________________________________________________________
>>> Manage your list subscriptions at http://lists.omnis-dev.com
>> 
>> _____________________________________________________________
>> Manage your list subscriptions at http://lists.omnis-dev.com
> 
> 
> _____________________________________________________________
> Manage your list subscriptions at http://lists.omnis-dev.com




More information about the omnisdev-en mailing list