How to right click and select an option from context menu using Activity? I am not using recording mode for this process

I am quite new to UiPath. I am trying do automate the process of addition on window application Calculator. I am using community edition of UiPath Studio. I request seasoned community members to guide me in.

What I am able to do:- drag & drop click activity to main window and able to automate 5+3=8 to already opened calculator app.

What I am looking for:-
(1) How to launch calculator app.
(2) How to right click and select copy option from context menu using Activity.

Please note that I am not using recording mode for automating this process.

For (1) Use Click activity on windows icon then use Type into activity to open calculator like this

image

for (2) You can send hot key Ctrl + C to copy the text or you can use get selected text

Great Thanks prankurjoshi, for helping me.
Answer for 1st question is really wonderful. But I am still struggling with 2nd question.

Currently right click is happening and able to see 2 options(copy, paste) in context menu during run of process.

Please tell me how to select ‘copy’ option from context menu.

Thanks in advance.

1 Like

Can you show me what are you trying to copy?

Please see the attachment.

I want to do sum of two numbers, copy it and then paste the result in a notepad.

Hi @Deepak11,
Use start process to open the calculator application,

  1. click 8+5
    2.Try to use get text activity to copy the text from calculator and paste to note pad

Thanks and regards,
P.Ajithkumar

Hi prankurjoshi,

Today ‘Type into’ activity is not typing value ‘calculator’ into search bar and therefore not able to launch calculator app.
Surprisingly it worked fine yesterday but failed today.

Thanks for your help !

Hey @Deepak11 have you tried what @Ajithkumar_P has suggested? It should work flawlessly :smiley:

Hi @Deepak11,

I think is better if you use the Open Application activity to open the calculator. You can use the indicate window on screen and select a previously opened instance of the calculator app. I think this is a more reliable option than opening the menu and typing.
Let me know if it works!

Hi Niket_Ghai,

thank you for promp response. But I am not sure about what is: -
(1) type executable path here. Text must be quoted…
(2) type app arguments. Text must be quoted…

it would be great if could help me here. I am just 2-3 days old in UiPath :slight_smile:

Just right click on the calculator app and open it’s location! Copy that address in the executable path, then perform the operations you are performing
Regards
Niket Ghai

Main.xaml (14.8 KB)

Here is a workflow I made for you. If you have any queries regarding it, feel free to ask! :smiley:

Regards,
Niket Ghai

Thanks Niket_Ghai and Manresa, for taking time out from your schedule and helping me.

Niket, I have a queries: -
We copied text from calculator using ‘get text’ activity and pasting it with ‘Type into’ on to a notepad. What are options do we have for ‘Text must be quoted’ value in ‘Type into’ activity. I tried with ‘res.ToString’ but it is throwing error 'Compiler error encountered processing expression “res.ToString”. ‘System.Res.data’ is not accessible in this context because it is ‘friend’.

Thanks Niket_Ghai and Manresa, for taking time out from your schedule and helping me.

Niket, I have a queries: -
We copied text from calculator using ‘get text’ activity and pasting it with ‘Type into’ on to a notepad. What are options do we have for ‘Text must be quoted’ value in ‘Type into’ activity. Any reference for detail would be helpful

I tried with ‘res.ToString’ but it is throwing error 'Compiler error encountered processing expression “res.ToString”. ‘System.Res.data’ is not accessible in this context because it is ‘friend’.

Change the scope of the get text from do to the whole flowchart/sequence.
I guess the variable ‘res’ is not accessible. If this doesn’t solves your problem please attach your workflow :slight_smile:
Regards
Niket Ghai

Thanks Niket for your help.
Now above mentioned error got resolved but when I run the workflow, it is not pasting copied value from calculator to notepad. Please see Xaml file and exception thrown.

Regards.

Main.xaml (14.4 KB)

1 Like

Hey, You gotta give the res variable in get text.
Se, get text gets the particular indicated text and stores it in a variable.


So you have to save that string in a variable which is res in this case and then that variable is used inside type into.

In your workflow you have not given any value to res, you have just declared it, so practically you are trying to put a string in notepad which has no value!

I hope you understand. Fell free to ask :slight_smile:

Regards,
Niket Ghai

2 Likes

Thanks a Ton, Niket_Ghai. This is working as per expectations.

1 Like

Could you please mark it as solution? :slight_smile: