How to right-click and select an option from context menu? I did it on Java

Hi, I met a problem when tried to record a Java based desktop application: right click on an entity and select an item from the drop down list.
I have searched most of the topics from the forum, however, none of them work for me. Eventually, I have found the following approach and I would like to share with you.

  1. Add a Click activity to your panel and indicate it on the screen. This step shows from where you want to carry out the next step – right click.
  2. From the Properties of the above Click activity => MouseButton, change BTN_LEFT to BTN_RIGHT. If you run the recording now, it will show the drop down list.
  3. Add “Send Hotkey” as the next step of the above “Click” activity. Do not use “Indicate on Screen” link of the “hotkey”, as you can’t see the drop down list now. Instead, in the “Key” select “Down”, which will move the highlighted item in the drop down list to the item you are looking for.

For example, in the attached image, I want to move down to “Normalize”, so I “down” once. If I want to move to “Copy”, then I should “down” for three time (add three hotkey as “Down”).
4. Finally, add another hotkey “enter”.

This approach works for me and I feel it is quite robust. I am using Java and don’t have any problem.

1 Like