I’m building a really simple test case and want to trigger the Javascript function “calculate()” from a simple online calculator (JavaScript Calculator Online). I can do it through the Chrome console and through the buttons but I need to be able to call the function directly.
The most common error I’m getting is “Inject Js Script: ReferenceError: calculate is not defined”.
In my JS file I’ve tested with both:
“calculate()”
" function trigger(element, input) {
calculate();
return “result”;
}"
Is it even possible to call predefined functions from websites?
And it returns:
RemoteException wrapping UiPath.Core.ElementOperationException: ReferenceError: DoSomething is not defined —> RemoteException wrapping System.Runtime.InteropServices.COMException: ReferenceError: DoSomething is not defined
I have tried placing the DoSomething() function within the < head > and < body > elements, using both Chrome and Edge but to no avail.