Scenario:
I am trying to inject same JavaScript to both Internet Explorer and Chrome. Script is a simple one that returns number value 1. See the script below.
function return1(){
return 1;
}
Same activity works fine with IE and results in an error when tried with chrome. See the details below.
Steps to reproduce:
- Start a new process.
- Create a variable
jsReturnValueFromIE
of typeInt32
. - Create a variable
jsReturnValueFromChrome
of typeInt32
. - Add open browser activity and choose IE as browser type.
- Add
Insert JS Script Activity
and set the script provided in the scenario section. - Set
ScriptOutPut
tojsReturnValueFromIE
. - Add open browser activity and choose Chrome as browser type.
- Add
Insert JS Script Activity
and set the script provided in the scenario section. - Set
ScriptOutPut
tojsReturnValueFromChrome
.
Current Behavior:
Insert JS Script Activity with IE returns the integer value 1 and stores in jsReturnValueFromIE
.
Insert JS Script Activity with Chrome results in an error - Message: is not a valid value for Int32
.
According to official documentation, output of Insert JS Script
, ScriptOutPut
returns a string.
ScriptOutput - String result returned from JavaScript code.
Expected Behavior:
For both IE and Chrome values should get saved in the respective variables of type Int32
.
Comments:
I have tried this with Chrome and IE only. Not sure whether this issue exist in other browsers too.
Studio/Robot/Orchestrator Version:
Studio Version: 2019.4.2
OS Version: Windows 10
Chrome Version: 74.0.3729.131 (Official Build) (64-bit)
IE Version: 11.706.17134.0
Attachments
Sample Process
InsertJSSampleProcess.zip (12.1 KB)
Error Message
Error Details
19.4.2+Branch.master.Sha.e17a3bedca2a7da0d0b716b5f8f765d1d5ef1ddc
Source: Inject Js Script 'Body Chrome'
Message: is not a valid value for Int32.
Exception Type: System.Exception
An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is:
System.Exception: is not a valid value for Int32. ----> System.IndexOutOfRangeException: Index was outside the bounds of the array.
at System.ComponentModel.BaseNumberConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)
--- End of inner ExceptionDetail 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)