Click all buttons of the same type/name at once

Hi, I’ve been experimenting for a couple of hours with the Firefox plugin of this tool and I’m quite overwhelmed about the opportunities…
My first exercise is to click the “thank you” button in a usenet board.
I mangaged to do this in a serial manner with a loop but it takes some time as I have to
wait 3-4s until the “tank you” button gets disabled so the next button is caught by the loop.
To speed things up, I want to click all buttons simultaneusly.

I found this post but it seems the OP wasn’t successful with that approach either.

The current blocking point is that xpath is finding only one occurence. :thinking:

Here is my script so far:

{
  "Name": "THX",
  "CreationDate": "2021-4-14",
  "Commands": [
    {
      "Command": "bringBrowserToForeground",
      "Target": "",
      "Value": ""
    },
    {
      "Command": "store",
      "Target": "1",
      "Value": "i"
    },
    {
      "Command": "while_v2",
      "Target": "${i}<=10",
      "Value": ""
    },
    {
      "Command": "click",
      "Target": "//table//*[text()[contains(.,\"Thank\")]][${i}]",
      "Value": ""
    },
    {
      "Command": "executeScript_Sandbox",
      "Target": "return Number (${i})+1;",
      "Value": "i"
    },
    {
      "Command": "end",
      "Target": "",
      "Value": ""
    }
  ]
}

This is the usenet board I’m refering to:
https://house-of-usenet.com/showthread.php?tid=334416
Registration is free and can be done with one-time-mail-acc.
I can also provide site code if necessary.

I apreciate any assistance!

edit: I prepared a source-copy of the linked site but new users are not allowed to upload files…

“Target”: “//table//*[text()[contains(.,"Thank")]][${i}]”,

I see you are already looping over the XPath. So you do find all occurrences, or?

No, it seems I don’t find them.

  • [error][Line 4]: timeout reached when looking for element ‘//table//*[text()[contains(.,“Thank”)]][2]’

When restarting the macro it will find the next but error again in the second loop.

Here is the code of the site that I’m testing with.

Do you have a test login for me? Then I can play around with it later.

I have, but I can’t PM you. Probably a restriction of my new account. Can you please contact me via PM so I can reply or do you want me to post them here? :face_with_monocle:

ulrich, please send me a PM so I can send you the login data!

Just want to report back, that I didn’t receive a PM yet - just in case you sent one.

@Wilcox

What is the problem ?

The buttons will be clicked one for time, there is not any option to multiple click in same time.

Hi newuserkantu,
I understand, that the buttons can’t be clicked all at once, but it should be possible to click them without waiting 2 seconds per button.

Yes you can increase speed

You must use this command

https://ui.vision/rpa/docs#!replayspeed

Not the macro speed is the limiting factor.
It seems the search finds the first occurrence over and over until the wait time has passed.
Then the next occurrence is found.
I don’t know how to explain better :sweat_smile:
If you send me a PM I can provide account data so you can inspect the website-code on your own.

Sorry, I did not have much time the last days. But maybe you can post a video of the current macro running? This will help me understand the issue faster, thanks!

OK, this may not be the best vid I took, hopefully you can see something.
I shrinked the video for the upload to realize that I’m not allowed to upload
files as I’m not an aged user of this forum. :woozy_face:

As you can see, there are 9 posts on that page (#11 - #20).
The script starts and triggers the buttons in a while loop (while i<10).
Because the button is not immediately removed as it is pressed, the script catches each button twice.
That’s why 10 loops manage to press only 5 buttons.

Compared to my original post, the site has undergone slight changes and
the wait time after a button press has obviously been reduced.

PM me so I can provide the account credentials for testing!

Thank you!

This is the script version used in the video.

{
“Name”: “HouTHX2”,
“CreationDate”: “2021-4-26”,
“Commands”: [
{
“Command”: “store”,
“Target”: “FAST”,
“Value”: “!replayspeed”
},
{
“Command”: “bringBrowserToForeground”,
“Target”: “”,
“Value”: “”
},
{
“Command”: “store”,
“Target”: “1”,
“Value”: “i”
},
{
“Command”: “while_v2”,
“Target”: “${i}<=10”,
“Value”: “”
},
{
“Command”: “click”,
“Target”: “//table//[text()[contains(.,"Danke!")]]",
“Value”: “”
},
{
“Command”: “comment”,
“Target”: “pause // 2000”,
“Value”: “”
},
{
“Command”: “assertText”,
“Target”: "//table//
[text()[contains(.,"Danke!")]]”,
“Value”: “Danke!”
},
{
“Command”: “executeScript_Sandbox”,
“Target”: “return Number (${i})+1;”,
“Value”: “i”
},
{
“Command”: “end”,
“Target”: “”,
“Value”: “”
}
]
}

What is the problem ?

I do not see any problem ui vision click button without any problem.

I click every button with ui vision in all sites without any problem.

Yes, UI vision clicks the buttons, that’s not the point!

The point is that there is a wait time until the macro is able to grab the next button.
The idea was to avoid the wait time by grabbing all buttons in an array and then looping through the array content.
But I don’t manage to grab the buttons.