Enlarge the field with a click of the mouse

Hello community,


I need to develop an automation that opens a certain application and increases the search screen. The activity would be to click with the “mouse” in a certain “hold” position and drag the line to enlarge the field. In this image is the Windows event viewer screen, I need the “mouse” this way to be able to drag and enlarge the field.

Have a look at this post. I think thats what you need. Just with BTN_LEFT for your case.

If your coordinates are not static you need to work with variable type [Rectangle] and [Position]
but there might be an easier approach:

Try:
Get Attribute Activity on the <–> Element and get the Attribute “position”
Set Attribute Activity on the <–> Element with CInt(coordinatevariablet.Rectangle.Value.Left.ToString) + amount
amount (Int32) is your shift to the right.

This might work (not sure though)

Hi @Filipe_Vitorino,

In this case we need to:

  1. Find an element where is possible to change its size.
  2. Get its position (Offset X and Offset Y)
  3. Use click activity setting click type property to CLICK_DOWN. Also, we need to provide values to Options > Cursor Position > Offset X and Offset Y, based on values from step 2. In addition, there is a trick here… We need to subtract a value from the Offset X, then the “mouse” will be above the size adjustment bar.
  4. Use click activity setting click property to CLICK_UP. Again, proving Offset X and Y, but now you will add value do Offset X, this increases its size.

If you have any doubt, you can check the solution attached.

This solutions uses Event Viewer as example.

UiPathForum.zip (14.9 KB)

1 Like

Hi,

Thanks for answering,

Could you explain this solution a little better ?? just like you said, I don’t have exact positions to click.

Hi,

Thanks for the answer,

I used as an example the project that posted and presented an error in the element. I tried to get the x and y positions, but it didn’t work.

Hey Filipe,

Please, share this error that you mentioned.

follows the error image. In the second image, it tells what I want to do, get out of point (1 and get to point 2). If you need I can make a video and send it to you.

Thank you.erro|690x275

@Filipe_Vitorino

Got it…

About the first image… The first activity is just to open Event Viewer. Did you copied exactly the same as the project attached?

About the second one… I understood, but in this example it will adjust the other size bar. The one between the center div and the left div. But don’t worry, we can change this easily. Let’s just solve the problem mentioned above before

Yes, I copied exactly what you asked for, but I still couldn’t execute it … in the “Event Viewer” when I opened it to indicate that the selector is not valid so it presents the error.

From what I am checking I will have to take the size of the element, and find the position of the column, so the mouse can find and drag to the sides, because the value is not static.

Hey @Filipe_Vitorino,

The selector is not valid because your Windows is in Portuguese.

Try to update the selector of the first activity (Open Application) to:

"<wnd app='mmc.exe' cls='MMCMainFrame' title='Visualizador de Eventos' />"

And the selector of the second activity (Find Element) to:

"<wnd app='mmc.exe' cls='MMCMainFrame' title='Visualizador de Eventos' /><wnd cls='MMCChildFrm' title='Visualizador de Eventos (Local)' /><wnd cls='AfxFrameOrView42u' />"

Now, this will increase the size of the center div, decreasing the right div.

Please, let me know if it worked as expected.

Okay, I just ran it, it worked, it located the element, but it didn’t decrease.

Nice, we are almost there :slight_smile:

Please, put a breakpoint on the last activity and check if the mouse cursor is properly positioned.

It must be as that adjustment size icon, such as your first image

Ok, the cursor is positioned correctly, with the breakpoint you can see that it moves one to the right.

Nice dude,

Then, you can also change Offset X of the second click activity.

Currently it has the value position.Rectangle.Value.X + 20.

If you want to increase even more, try other values instead of 20

So, try again without the breakpoint and don´t move your mouse after hit run button.

Ok, :pray: but he’s taking the first bar, in this case how would I go about taking the second?barras|690x286

Cool…

Have you updated to this selector (find element activity)?

"<wnd app='mmc.exe' cls='MMCMainFrame' title='Visualizador de Eventos' /><wnd cls='MMCChildFrm' title='Visualizador de Eventos (Local)' /><wnd cls='AfxFrameOrView42u' />"

Yes, with this selector it is valid, it works perfectly, but as I said only for the first column. As I understand it, the first “click” activity is -3 the column, correct? how did you get that value? because if you have other situations the value may be different …

@Filipe_Vitorino

Try to save this selector again, and after that check if its equals to this:

"<wnd app='mmc.exe' cls='MMCMainFrame' title='Visualizador de Eventos' /><wnd cls='MMCChildFrm' title='Visualizador de Eventos (Local)' /><wnd cls='AfxFrameOrView42u' />"

I ask this, because sometimes we hit enter to save. But the change it is not saved.

Here is working properly.

About the -3, it works like this…

We need to find the position of the element that has the size bar, in this case, the size bar is to the left of our element. So, example, it return that the element is in the Offset X 500, then the size bar is a little bit before 500. Then we subtract to reach the size bar.

Yes… this value may up to change. But don’t think as a table, columns and rows think as “eixo X e Y da tela” (by the way, I am Brazilian as well)