Ask a Question

simulate Context menu

Madhi
Contributor

simulate Context menu

Trying to simulate right click by using sendkeys (shift f10).  But the script pauses on executing the shift+f10.

Is there a workaround for this.  ClickR is not consistent in my app.
7 REPLIES 7
AlexKaras
Champion Level 3

Hi Madhi,



Try .Keys('[Apps]') - for me it works better than Shift-F10...
Regards,
  /Alex [Community Champion]
____
[Community Champions] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Champions]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Champion] signature is assigned on quarterly basis and is used with permission by SmartBear Software.
https://community.smartbear.com/t5/Community-Champions/About-the-Community-Champions-Program/gpm-p/252662
================================
Madhi
Contributor

Alex:

Can you be more clear on this.  I tried sys.desktop.keys as well as obj.keys('[apps]')

on encountering the first single quote the line is considered as commment.  Please explain.
AlexanderM
Staff


Hi Madhi,





Looks like you are using VBScript, so you need to use double quotes for string constants:

obj.keys("[Apps]")





Important: the constants passed to the Keys method are case-sensitive.
-----

Alexander
Customer Care Manager
Madhi
Contributor

Thanks for all your help..

But i get the error message "Unable to focus the control" - Ours is a WPF windows application.
AlexKaras
Champion Level 3

Hi Madhi,



Can you provide more details as for when the error occurs and a code snippet that is executed?
Regards,
  /Alex [Community Champion]
____
[Community Champions] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Champions]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Champion] signature is assigned on quarterly basis and is used with permission by SmartBear Software.
https://community.smartbear.com/t5/Community-Champions/About-the-Community-Champions-Program/gpm-p/252662
================================
AlexanderM
Staff


Hi Madhi,





Yes, we need more info to proceed. Can the control be focused manually?

For the suggested approach to work, it should be possible to do the same actions manually - focus the control and press the Apps key on the keyboard.
-----

Alexander
Customer Care Manager
Madhi
Contributor

Oh..okay.. that is not happening manually.  I was tyring all possible combinations to make it work.
cancel
Showing results for 
Search instead for 
Did you mean: