On Element Appear - React Application

Hi,

I have problems with “On Element Appear” Activity in Application written in React.
Sometimes it works as expected, another time (in same case!) with error.
It is so unpredictable.

Any suggestions on how to handle it?

Thx and kind regards,
Vanja

1 Like

I don’t know if your use Modern Experience, but maybe it’s worth taking a shot at using a Change App State activity, with a Wait for set to Element on Appear.

image

By doing that, when you indicate the target, you can easily configure a selector, a fuzzy selector and an image selector.
This dramatically increases the chances of your on appear event being identified correctly.

1 Like

Hi

On element appear mainly relies on these three properties

  • WaitVisible - When this check box is selected, the activity waits for the specified UI element to be visible.
  • WaitActive - When this check box is selected, the activity also waits for the specified UI element to be active.
  • RepeatForever - Enables you to perpetually repeat this activity. Only boolean values (True, False) are supported

If these were handled properly then most of the issues with this activity can be handled

Like set the property as

WaitVisible - Enable
WaitActive - Enable
RepeatForever - False

Along with these also set the property

WaitForReady - Complete
Timeout - 60000

Even after setting this it can’t be ensured that element appears and is captured by this activity
Sometimes that element might take more than 60000 milliseconds to become active and visible

So surround that entire on element appear with a TRY CATCH activity and if any error occurs in try block then it will be caught in CATCH block where you can have the other set of activities if that element doesn’t appear

Hope this would help you resolve this

Cheers @VanjaV

1 Like