Inject JS Error

Hi,
Thanks in advance,
I am facing an error in Inject JS activity,
Its an web based automation process where i have to click on the search results which contains a button with JavaScript code, I have to build a bot to click on the button using JS code.
I have put __doPostBack() in the ScriptCode property of Inject JS activity and have used IE browser for the same. The error i am facing is as below,
Error : “Inject Js Script 'A ': Object expected”

Does anyone have any suggestions regarding it?

Regards,
Riddhi

Do you have any getElementById object in the code @RiddhiBhandari?

Please check whether the object you are picking using this is correctly retrieved :slight_smile:
The error possibly occurs for not detecting the object or passing an Undefined object to that

Thanks for the reply:) @HareeshMR
I cant find any getElementById object in the website related to the attribute i want to fetch.
Instead, I got the attribute (< a href >) from the source code of webpage.
This is the result of the get attribute activity using “outerHtml” as attribute,
< a style=“color: rgb(0, 0, 153);” href=“javascript:__doPostBack(‘ctl00$ctl00$ContentPlaceHolder1$body$dgProperties1$ctl03$ctl00’,’’)” >View< /a >

After this, I have split it and got the value as
__doPostBack(‘ctl00$ctl00$ContentPlaceHolder1$body$dgProperties1$ctl03$ctl00’,’’)

I have passed this value as ScriptCode to Inject JS activity and I am getting the above mentioned error,
Error : “Inject Js Script 'A ': Object expected”

Regards,
Riddhi

hello, i want to know how to use “Inject JS Script” activity, how to write the code and the grammer with UIPATH. can you provide me a sample about how to write code inside UIPATH?
Thanks a lot!!

@pitaty
For Starting following info is helpfully

On Beginning keep the variable / argument names as used in the docu.

For further help just create a new topic for your scenario

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.