Execute multiple Image Exist activities at the same time

I am running a workflow where I extract data from and Excel document, search Google with the extracted data, scrape the desired information from Google, and then post it to a new Excel document.

Based on the extracted data, there are about 5 different Google layouts, and I have been running 5 different “Image Exists” to determine which layout is returned and how I will scrape the data.

My question: Is there a way to run all 5 of the “Image Exists” activities at the same time? Now, I have the TimeoutMS set to 750 ms each, and only one of the images exists, so it takes an additional 3 seconds per Google search to find the other images that don’t exist. Could this all be done in one activity and take a total of 750 ms?

Thank you in advance.

1 Like

Hi,
I suppose you could wait until an element or image is loaded that is there all the time, then set all the Image Exists TimeoutMS to 0.

Unsure if there is a way to make it faster with image recognition than that other than just using ContinueOnError to True with small TimeoutMS on each of the Image Exists activities.

You could, however, try using Element Exists instead and adjust the selector so it finds each of the images using the wildcard “*”. That way you only need 1 activity.

Thanks.

Where do you have these images?

If they are constant every time and doesn’t change, you could save them on your local disk and perform For Each Image exists and break when True condition is met.

1 Like

Hi @cblessen25,

In your current scenario, I would suggest you to use the Pick and PickBranch activities.

I’m not sure if it would be faster than using Image exists one after another, but you could give a try by setting and testing the TimeoutMS property of those Image exists activities inside PickBranch

4 Likes

Good call. Since all of the branches are scheduled on entering Pick, whenever it finds the first image other ones will get canceled. And you already have a separation of actions to take for each branch.

Do note though that the Action will execute for the Trigger that finishes first - so if you’re using same timeouts for all, you’ll have a race condition.
It might be safer to add one branch with Trigger = Delay(otherTimeouts - 5s), that will serve as the “timeout” branch for the Pick itself.

5 Likes

I didn’t even know this activity existed. Good to know.

2 Likes

Add all the elements find in pick branches and keep one additional branch of delay. This delay will be the max delay or can say wait for one of your element to appear. If element found then all other activities will be cancelled and of not found then delay will be completed.

1 Like

I think that pick branch is the most suitable solution for that case but on the other hand Sometimes using Pick branch with image exists activities causes something like the deadlock. I don’t know why but that’s what I encountered while using them.