This is really weird as it throws an error ‘angular is not defined’ when for example i’m injecting console.log(angular) or just trying to use some angular functions like angular.element .
But when I put it directly in the console, the angular variable is well recognized and it throws no error at all.
Otherwise other basic scripts work well with Ui Path Inject JS like “alert(“something”)”.
What I’m sending in Ui Path :
The error :
Main has thrown an exception
Message: ReferenceError: angular is not defined
Source: Inject js script
Exception Type: ElementOperationException
UiPath.Core.ElementOperationException: ReferenceError: angular is not defined —> System.Runtime.InteropServices.COMException: ReferenceError: angular is not defined
at UiPath.UiNodeClass.InjectAndRunJS(String bstrCode, String bstrInputText)
at UiPath.Core.UiElement.InjectAndRunJS(String code, String input)
— End of inner exception stack trace —
at UiPath.Core.Activities.ScopeActivity.OnFaulted(NativeActivityFaultContext faultContext, Exception propagatedException, ActivityInstance propagatedFrom)
at System.Activities.Runtime.FaultCallbackWrapper.Invoke(NativeActivityFaultContext faultContext, Exception propagatedException, ActivityInstance propagatedFrom)
at System.Activities.Runtime.FaultCallbackWrapper.FaultWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
When I type into the console directly :
Does anybody has an idea oh where it can come from ?
Thanks in advance.