Problem with recording right click

uiautomation
studio
recording

#1

Hi. I just started to learn UIpath. Cause i am more a developer, if i get stuck, i just create batch script and run it in my automation process. well halfly ok. but i would be able to use more of ui recording functionality.

Currenty i am trying to achieve something that i would expect to be something quite simple. anyhow, i am not able to implement that. Simple scenario is that i open explorer in certain path (this works nicely, ok i did it from command line cause it was easier). but when the explorer window is open, there is a file, that i would like to right click “x.txt”, and from the submenu i would like to select “7zip -> zip to x.zip”. then wait that file is zipped and send it through ftp to somewhere.

Anyhow, i just cant record the right click. with automatic recording using different ways for right click, the submenu never comes to screen, so i would be able to continue to “7zip -> zip to x.zip”. I tried to google alot, but did not find anything useful.

If you have any hints or help, i would be more than happy. Just learning, but kind of bored to get stuck on these kind on things that at least sound simple.

br, Rvp


How to right-click and select an option from context menu?
How to zip files using invoke method?
#2

Hello rvp,

you can use Click Activity and change the property of Mouse Button to BTN_RIGHT for right click
and for selecting the menu -> Send to , again use Click Activity and press F2 and right click manually and after 3 seconds click Send to. you should be able to automate the above scenario.

Thanks
Bhanu Prakash L


#3

Hi.

Thanks for advice. I almost got it work. Problem is that i don’t know how to select the middle part of the process… the 7-zip way to compress is actually identical for the “send to” you are talking about:

  1. right click name of the file you wanna compress (this works now fine)
  2. next menu window appears where i should move to mouse over ‘7zip’ or (‘send to’ in you example).
  3. next menu window appears, here i should just click ‘compress to zip’. (this works nicely)

What does not work is the step 2. The menu window appears, but in real life you move the mouse over the selection ‘7-zip’ and thats enough for the next menu window to appear. I have tried ‘click’ i have tried ‘hover over’ but for some reason the next menu never comes visible. when i run the process and i move the mouse manually over 7-zip, then the robot recognises the menu window in step 3 and starts to execute the compressing.

So i am stuck with step 2 that basically. Any tips on that?

br, Riku

p.s. I am using community edition.


#4

Is it the classical windows shell interface that you’re automating? Windows Explorer?
Can you attach the XAML?


#5

first part is shell, but the one i am having problems is just Windows Explorer. Here is the part of the XAML i am having problmes.

  1. right click

  2. 2 second delay (just tested would it help)

  3. hover over ‘7zip’

  4. left click on ‘compress to zip’

    <Flowchart.StartNode>


    <ui:WindowScope ApplicationWindow="{x:Null}" SearchScope="{x:Null}" TimeoutMS="{x:Null}" Window="{x:Null}" DisplayName=“Attach Window ‘Medi port Cabinetwc’” sap2010:WorkflowViewState.IdRef=“WindowScope_44” InformativeScreenshot=“58cda085324d1e9b98d9a9c200457922” Selector="<wnd app=‘explorer.exe’ cls=‘CabinetWClass’ title=‘medi-portal’ />">
    ui:WindowScope.Body

    <ActivityAction.Argument>

    </ActivityAction.Argument>


    <ui:Click DelayBefore="{x:Null}" DelayMS="{x:Null}" ClickType=“CLICK_SINGLE” DisplayName=“Click ‘editable text Name’” sap2010:WorkflowViewState.IdRef=“Click_51” KeyModifiers=“None” MouseButton=“BTN_RIGHT” SendWindowMessages=“False” SimulateClick=“False”>
    ui:Click.CursorPosition
    <ui:CursorPosition OffsetX=“56” OffsetY=“8” Position=“TopLeft” />
    </ui:Click.CursorPosition>
    ui:Click.Target
    <ui:Target ClippingRegion="{x:Null}" Element="{x:Null}" TimeoutMS="{x:Null}" InformativeScreenshot=“6bd282a62b284c40f6c7bbfec0f11060” Selector="<wnd cls=‘ShellTabWindowClass’ title=‘test title’ /><wnd aaname=‘Explorer Pane’ cls=‘DirectUIHWND’ /><wnd aaname=‘Shell Folder View’ cls=‘SHELLDLL_DefView’ title=‘ShellView’ /><wnd aaname=‘Items View’ cls=‘DirectUIHWND’ /><ctrl name=‘Items View’ role=‘list’ /><ctrl automationid=‘9’ /><ctrl automationid=‘System.ItemNameDisplay’ />" WaitForReady=“INTERACTIVE” />
    </ui:Click.Target>
    </ui:Click>



    </ui:WindowScope.Body>
    </ui:WindowScope>

    <ui:WindowScope ApplicationWindow="{x:Null}" SearchScope="{x:Null}" TimeoutMS="{x:Null}" Window="{x:Null}" DisplayName=“Attach Window ’ Menu’” sap2010:WorkflowViewState.IdRef=“WindowScope_45” InformativeScreenshot=“dcb5afd06cd0e04323020bc00b3edc7e” Selector="<wnd app=‘explorer.exe’ cls=’#32768’ idx=‘2’ />">
    ui:WindowScope.Body

    <ActivityAction.Argument>

    </ActivityAction.Argument>

    <ui:Hover DelayBefore="{x:Null}" DelayMS="{x:Null}" DisplayName=“Hover ‘menu item 7-Zip’” sap2010:WorkflowViewState.IdRef=“Hover_2” SendWindowMessages=“False” SimulateHover=“False”>
    ui:Hover.CursorPosition
    <ui:CursorPosition OffsetX=“59” OffsetY=“11” Position=“TopLeft” />
    </ui:Hover.CursorPosition>
    ui:Hover.Target
    <ui:Target ClippingRegion="{x:Null}" Element="{x:Null}" TimeoutMS="{x:Null}" InformativeScreenshot=“367fd737afcb24320512dcd6a1f68200” Selector="<ctrl name=‘Context’ role=‘popup menu’ /><ctrl name=‘7-Zip’ role=‘menu item’ />" WaitForReady=“INTERACTIVE” />
    </ui:Hover.Target>
    </ui:Hover>


    </ui:WindowScope.Body>
    </ui:WindowScope>
    <ui:WindowScope ApplicationWindow="{x:Null}" SearchScope="{x:Null}" TimeoutMS="{x:Null}" Window="{x:Null}" DisplayName=“Attach Window ’ Menu’” sap2010:WorkflowViewState.IdRef=“WindowScope_46” InformativeScreenshot=“35649e8753cd89002d2b24ae12dc2011” Selector="<wnd app=‘explorer.exe’ cls=’#32768’ idx=‘1’ />">
    ui:WindowScope.Body

    <ActivityAction.Argument>

    </ActivityAction.Argument>

    <ui:Click DelayBefore="{x:Null}" DelayMS="{x:Null}" ClickType=“CLICK_SINGLE” DisplayName=“Click ‘menu item’” sap2010:WorkflowViewState.IdRef=“Click_52” KeyModifiers=“None” MouseButton=“BTN_LEFT” SendWindowMessages=“False” SimulateClick=“False”>
    ui:Click.CursorPosition
    <ui:CursorPosition OffsetX=“166” OffsetY=“12” Position=“TopLeft” />
    </ui:Click.CursorPosition>
    ui:Click.Target
    <ui:Target ClippingRegion="{x:Null}" Element="{x:Null}" TimeoutMS="{x:Null}" InformativeScreenshot=“2dfc9429ab5d07431e2a2c14efeec8ad” Selector="<ctrl name=‘7-Zip’ role=‘popup menu’ /><ctrl automationid=‘31101’ />" WaitForReady=“INTERACTIVE” />
    </ui:Click.Target>
    </ui:Click>


    </ui:WindowScope.Body>
    </ui:WindowScope>


    </Flowchart.StartNode>


#6

Not like this. Aren’t you allowed to upload attachments yet?


#7

ok, ill make new one process with only this part included, so i can send you whole XAML


#8

Hello rvp,

I tested it on Windows Explorer its working fine.

you need 3 click activity in workflow,
1st to right click on file
2nd to click send to (on menu)
3rd to click compressed zip folder(on menu)

for 2nd step,
add click Activity , click on indicate on screen,
and press F2, you can see the countdown 3-1, in those 3 seconds
do right click manually and wait for the countdown to finish and you can see the menu item opened
then click on Send to / zip on the menu item
repeat the same for 3rd step.

Thanks
Bhanu Prakash L


#9

Maybe i just read more manuals, cause i can’t do this “add click Activity , click on indicate on screen,” Its just not there in my recording toolbar (i mean ‘indicate on screen’). i can select if i search it from studio, but don’t know how to fill the value manually without recording.

Thanks anyway, Riku


#11

#12

#13

hi I have the exact same problem.

couldnt achieve step 2 as mentioned by rvp. I used click indicator but still it dint help much

Need some help guys !!!


#14

hi Bhanu,

I did exact same and it works only when i move the cursor and to the new menu it opened.