在我使用“在元素出现时”活动时,UiPath会报出异常Object reference not set to an instance of an object

在开发的过程中,我需要使用到“在元素出现时”这个活动,但是只要增加了这个活动,Uipath就会报错

我使用的版本是2023.6.1,System.Activities包的版本从2022.10.4到最新的23.6.0-preview都试过了,都会报出这个错误,请问这个问题怎么解决?

错误信息如下:

23.6.1-beta.13324+Branch.release-v23.6.1.Sha.52787b786620e97cba5555379da6e6bb423b3e6b

Object reference not set to an instance of an object.

错误: System.Exception: Object reference not set to an instance of an object.
at System.Activities.Presentation.Validation.ValidationService.MarkParents(ValidationError validationError, IEnumerable1 errorParents, ModelItem source) at System.Activities.Presentation.Validation.ValidationService.MarkError(ValidationError validationError, List1 errorSourcePath, ModelItem source)
at System.Activities.Presentation.Validation.ValidationService.MarkErrors(ICollection1 errors, ValidationReason reason, Activity rootActivity) at System.Activities.Presentation.Validation.ValidationService.OnValidationWorkCompleted(Tuple3 input)
at System.Activities.Presentation.Validation.BackgroundValidationSynchronizer`1.<>c__DisplayClass26_0.b__0()
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler), HResult -2147467261

@Wei_Jiaqi

Its a bug. The activity shows the error “Object reference not set to an instance of object” as soon as you drag that activity into designer panel.

So, instead of this you can use check app state activity

Hope it helps!!

Hi @Wei_Jiaqi
Yes, It is a bug in the latest version.
So, instead of this you can use check app state activity

Hi @Wei_Jiaqi

It is a bug from the UiPath when we try use the On element appear activity it shows the Object reference not set to an instance of an object error.

Instead of On element appear activity use the Element exist activity.
image

If you want to use modern activities use the check app state activity.

Hope it helps!!

Hi @Wei_Jiaqi

Update your packages and use element exists activity in attach browser then it works.
Use modern activities like check app state instead of classic activities.

@Wei_Jiaqi

Use “check check app state” instead of “when the element appears” and set the “delays”

Hi @Wei_Jiaqi

Welcome to Community!!

Instead of using On Element Appear activity use Check App State activity or Element Exists activity

Regards,

1 Like

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