How to Click a Button If the Button Name Changed

Hi Everyone,

I want to click a button if the button name changed. In this case, I have a form and one button inside. When the form is load, it started a process of exporting files. While the process is running, the button name is Cancel and when the process is done, the button name changed to Close. How can I click the button when the button name changed to Close? It always hit cancel every time the form is loading and stop the process. Kindly please provide me the solution for this case. Thanks in Advance.

Untitled

@Wylfritz_Tyson You might have to use On Element Appear Activity , and then use Click Activity on Close Button.

Also can you send the Screenshots of the Selectors of CANCEL button and CLOSE button in UiExplorer ?
Make sure the Selectors are valid.

@Wylfritz_Tyson

Can you send us the selectors of Close and Cancel

Hope this helps

Thanks

Hi @Wylfritz_Tyson,

You need to find a property in the UiExplorer to differentiate between Cancel and Close for the Click Activity.

Usually, the aaname property in the selector will do. Select the aaname in the selector and have it as “Close”.

You also need to On Element Appear with the same selector as above to wait before click until it exports the excel records.

Thanks and Regards,
Ranjith Udayakumar

1 Like

This is the selector of button close:
image

But I can’t indicate button Cancel because the process is so fast and turn to the Close button.

@Wylfritz_Tyson Ok. Then you can Try this :

Use Attach Window on the Export Results Window : Make Sure the Selector of the Atttach Window is Dynamic if there are varying names.
Use On Element Appear Activity inside the Attach Window.
Then use Click Activity on Close Button inside the On Element Appear Activity.
The Selectors for the On Element Appear and the Click is the same.
But Also add the name property into the Selector.

Check if these Steps Work

Hi @Wylfritz_Tyson,

As i mentioned earlier in the thread add the aaname =‘Close’ and then check.

Thanks and Regards,
Ranjith Udayakumar

HI ,
you can also try the following

  1. use get element attribute
  2. take the name and pass it to selector

Hi @ranjith_udayakumar,

Thanks for the assistance, I try to differentiate between cancel and close by re-indicate the close button. I indicate the button-text instead of the button or button block. So, I have a clear selectors of the close button.

Regards,

1 Like

Thank you @supermanPunch,

It works. And then I changed RepeatForever value to False on Properties in case there is an error pops up.

Regards,

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.