How to handle clicking one or more buttons which is dynamic everytime in website?

In a website, sometimes we have 1 button and sometimes 2 buttons in a page. Based on that we have to click those buttons and perform action and if more buttons go to next button and perform action.
can anyone help please?

Check Trigger scope

Add triggers for all the buttons you are expecting and then in the Actions part of the activity add a Switch which will contain the activities you want to perform for each button appearing.

Hey @vnsatyasunil

Based on the current description, I can say it’s feasible.

But cannot comment on approach. It will be much more helpful, if you can share some screenshots and explain please ?

Thanks
#nK

I tried this.i have 2 buttons.In triggers i used click activity for clicking button and in actions i added steps after clicking that button1.But not working .Can u please help?

for eg,for one user login we have 1 button and for other user we have 2 buttons.so if we have 2 buttons,for button 1 we have to perform some steps and come back and click button 2 and perform some steps.How it can be handled?

Hello @vnsatyasunil

Can that be possible to share a screenshot of the 2 scenarios to understand your use case better.

I think instead of using multiple element exists activity, you can create a loop and make the finding dynamic by passing a variable to some attribute like idx.

Thanks

not possible to share.if one button its fine but 2buttons means it needs to perform steps after button1

Hi @vnsatyasunil ,

It looks like we would need to iterate over the Buttons and then perform the Steps. You would need to first get the Number of Buttons/Button Elements. Then Loop over the elements that was found.

But we would like to know will there be only two buttons (max) or more than that are also a possibility.

If more buttons are available, are we performing the same steps after clicking on each button or does the steps differ ? If the Steps differ How exactly does it differ as you would need to have the detailed Steps for each Button click as a Complete Separate Sequence.

Do let us know more or Perform a First Check with Find Children and get the Button Elements and Iterate over it and Check if you are able to perform the required logic using that base method.