How to click multiple buttons

Hello everyone,

I’ve been trying to automate a webpage that contains multiple clickable buttons. I want the robot to click on each button one by one. However, using individual Click activities for each button seems inconvenient, as there are so many buttons.

Is there a more efficient way to achieve this?
Please refer to the attached screenshot for reference.

Thank you in advance for your help!

Hi,

How about using ForEachUIElement activity?

Regards,

@Sachin_Joshi,

For Each UI element activity is the solution if your buttons going to be dynamic.

If the buttons are fixed, you can take the selectors of each button into an array, iterate the array using for each and inside for each use click activity with current text or selector as selector of Click activity

Hi Yoichi-san,

Thank you for responding to my query.

I followed the steps in your screenshot, but in my case, the robot only hovers over the buttons without actually clicking them. When it does click after hovering over 5-6 buttons it stops and throws an error.

For reference, my webpage looks like this:

Thank you again for your assistance!

Hi,

What input mode do you use? If HardwareEvent, can you try other mode such as ChromiumuAPI or Simulate, because your system seems browser base?

Regards,

Yaa it is browser based.
I have tried ChromiumuAPI and Simulate too but works the same way as the last one did.

Hi,

Can you share your first approach (using multiple Click activities) works well or not?

Regards,

This was my initial approach:

I used multiple Click activities for each button.
However, the main task I want to achieve is for the robot to click on the buttons on the left side and then read the data that appears on the right side and continue doing that for all the buttons.
Is there any better way to do it?

Hi,

It may be too fast to click in the above ForEachUiElement case.

How about adding a few seconds Delay activity as the following?

Please set HardwareEvent at InputMode, for now.

Regards,

I tried your advice, and it did delay the process by 3 seconds as expected. However, the issue remains that the robot just hovers over the buttons without actually clicking them. Occasionally, it clicks a button after hovering over 3-4 buttons, but then it stops working entirely.
Please check the video for reference.

Hi,

Thank you for sharing video. The cause is that click activity click center of cell.
As workaround, can you try to set Offset as the following?

Or It may also work if you can set target just surrounded the word (not cell) as the following image.

Edit: add the above image

Regards,

So i tried selecting just the text not the whole box and it worked, but just after few clicks it stops and gave me this error.

@Sachin_Joshi

looks like the page is reloading after the clicks

try to use wait for load complete

also try to see the selector for the curretn element …that might help to see if it is failign only at one button always which might help in knowing the issue

cheers

Hi,

Can you share whether 期間出力データ exists on the screen when the error occurs?

Regards,

Hey Anil
Thank you for responding.

Yaa the webpage reloads after every click so i added a 10 seconds delay so that the webpage gets enough time to load before it goes for the next click however it didn’t workout.
Also I checked the selector it is the same for everyone but it always fails at the same button.

I didn’t get your question very well but if you mean that 「期間出力データ」is on the screen when the error occurs then yaa it is there and the robot is always failing at the same button.

I guess if you click the link, it moves another page which has same menu? if so, this way is not good. To isolate cause, can you try to use middle click instead of left, and set Simulate or ChromiumAPI as Input mode?

In this case, it may be necessary to set selector which can work any page OR go back to the first page then click next menu.

Regards,

@Sachin_Joshi

  1. If you indicate that particular button which is failing and try to click is it working?
  2. Also if page is reloading then for each ui elements might get invalid based on new values loading or a change in backend attribute like class or so
  3. In case attributes are changing then bettern to use idx attribute or some dynamic selector in loop for clicks

Cheers