Inject JS issue

uiautomation

#1

I am getting error while using inject js as:
Inject js : Exception from HRESULT: 0x80020101.
How to solve this?


#2

Can you check if your script working correctly?


#3

That Error generally occurs when you have a syntax error in the Javascript,

Please try with this attached sample workflow and let me know :slight_smile:

InjectSampleJs.zip (2.7 KB)

Regards…!!
Aksh


#4

You may playaround with your script here

jsFiddle Demo


#5

I am getting this error:
Inject js : Cannot find the UI element corresponding to this selector:
"webctrl id=‘mainContent’ tag=‘main’ "


#6

Nothing this is selector error. just clear the invoke js Activity “Selector” property and try it ant let me know :slight_smile:

Regards…!!
Aksh


#7

I have cleared selector but again i got same error Inject js : Exception from HRESULT: 0x80020101


#8

Will you share the screensot of that error?


#9

attachment not allowed


#10

thanks @aksh1yadav , its working now.


#11

Hi,

I have an issue with Inject JS myself.
I dragged the activity inside an Open Browser and added “alert(‘test’)” in the ScriptCode field. The error thrown is “TypeError: Object expected”.
I tried indicating a random element in the page and also leaving the Selector field empty - none worked.

Can anyone advise how to inject javascript code directly without using a js file?


#12

Hey @theo500

Try This: Jssample.xaml (5.8 KB)

Regards…!!
Aksh


Inject JS activity pro
#13

Hi @aksh1yadav ,

It seems to be working in Chrome but not IE. Will investigate the security settings.

Thanks a lot!


#14

Hi,
I have tried with your example…It is working fine with chrome browser but not with IE. Is there any setting that need to be changed in IE…?

Regards,
Saamir


#15

CHrome browser some selectors will very so :slight_smile:


#16

Hi guys, did you handle the issue related to JS in IE? Testing “hello world” example works for me in chrome, but not in IE, is this issue related to some Security staff? Any idea? Thanks, Frantisek.


#17

Hey,i have some difficulties with this sample,The alert can’t be work .

.
Here is xaml file:
Jssample.xaml (6.0 KB)
(ps,i made some change of web’s info.)
Regards