Try catch for send hotkey activity and click activity

As the click activity alway prompt an error message that cannot find the ui element corresponding to this selector:… So that i want to catch this error and if the error message prompt it will repeat the click activity. But what i should write or put in the catch and finally space?

Thank you and best regards.

1 Like

Hi @teo_choudu

Much better if you check first the element before issuing the click ativity!

cheers :smiley:

Happy learning :smiley:

3 Likes

How to check the element?

1 Like

Hi @teo_choudu

Please use this activity

image

To check if the element exists it will return boolean

cheers :smiley:

Happy learning :smiley:

2 Likes

If element does not exist then how to repeat the step before?

1 Like

Why do you need to repeat it ?
@teo_choudu

2 Likes

Hi @teo_choudu,

  1. Give proper delay time so that the page will load completely before click activity to execute

  2. You can use element exists activity to check that element is available or not if the element is available then use click otherwise write the log

  3. Once explore On element appear activity, it waits until the element appears on the web page