Inject JS to "click" a table button results in error


I’m trying to Inject JS code to click the following button “Vis/ret”:


I first tried with document.getElementById(“name-of-the-button”).click() and document.queryselector - both of which the button does not respond to.

Is is possible to use the above code as shown in the screenshot: “javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(“ctl00$CPHMain$InvoiceLineRepeater$ctl00$ViewInvoiceLine”, “”, true, “”, “”, false, true))”

I tried, but it gives me error message: “ReferenceError: WebForm_DoPostBackWithOptions is not defined”

Any suggestions?

Why do you use JS code? Install the Java extension in UiPath to automate your tasks if your browser or application is Java-based.


Kaviyarasu N

Hey, sorry for the dumb question, but how exactly would that help? as i understand it Java and JavaScript are two different things?

Im trying to automate data entry on a website. Instead of using click/type into, it was much faster injecting JS.

Anyone else that might have an idea here? :slight_smile: