Inject Js Script-A - javascript:void(0)-Faulted


Hello i have this report and when i click Excel it download excel format from this report using the selector’s is not reliable in this case so i am trying to run the Java S for this report when i type this commend in Console $find(‘ReportViewerControl’).exportReport(‘EXCELOPENXML’);
it run without any problems i am trying to run this in UiPath so i am using inject activity
but i recive this error Inject Js Script ‘A javascript:void(0)’: ReferenceError: $find is not defined

anyone can help in this please

Hi,

For now, can you try to set Page at Execution world property?

Regards,

Hi thanks for replay i can’t find this property

Hi,

Probably, you use old UiAtuomation activities package. Can you try to upgrade it, if possible?

Regards,

you were right i upgraded it and have the property but still can’t run the Java script the error gone too


update… i updated the code on wrong place i corrected it and now i got this error

HI,

Can you share current settings/code in ScriptCode?

Regards,

this is the code
"function (element, input) {

$find(‘ReportViewerControl’).exportReport(‘EXCELOPENXML’);

}"

Hi,

As the above error message shows invalid token, there might be some illegal character. So, can you try copy the following text and paste it into the property?

"function (element, input) {
$find('ReportViewerControl').exportReport('EXCELOPENXML');
}"

Regards,

yea no error now but still no output and the excel file did not download

Hi,

How did you get output of the method?
It may be necessary return as the following.

"function (element, input) {
return $find('ReportViewerControl').exportReport('EXCELOPENXML');
}"

there is property for output

when i run your code with return output variable have true value now