How to pass HTML Selector to Click Activity

Hello All,

How to use the selector which I have got from the chrome Browser by Inspect Element option for the Choose File button.

In Uipath Its not able to capture that element. Click Image is working but when I am out the virtual Machine the Error is : Desktop Disconnected or Activity Time Out Reached.

Is it possible to use the attributes I have got from the Inspect element option in the Click Activity Selector?

Would like to Modify the Click Activity Selector According to Inspect Element

Much appreciated for your kind help in advance.

Regards
Vishnu

Fine
did COMPUTER VISION activity helped us on this

Cheers @winningvish

1 Like

Thank you @Palaniyappan.

Hope CV will work but is there any solution that I can modify the selector getting from the Click Activity, so the robot can Click on Choose File Button.

By using the Inspect Element we are able to get the Selector. But how to use that selector in UiPath is a bit confusing.

Regards
Vishnu

hmm…thats a good idea indeed
but usually selector will take only xml nodes but html wont work i hope
thats why suggested computer vision activity

Cheers @winningvish

Ok @Palaniyappan, will look into Computer Vision Now.

Thanks for your advise.

1 Like

no problem
glad to
@winningvish

1 Like

Hi @Palaniyappan,

Any idea how to inject this code to Chrome Browser?

document.getElementById(“flDataFile”).click()

I have used Inject Js within the Attache Browser but throwing an error document is not declared.

Regards
Vishnu

If possible can i have a view on the error with a screenshot if possible
Cheers @winningvish

Sure @Palaniyappan

java

document is not declared is the error.

Regards
Vishnu

Can you try using this solution: Inject JS.zip (11.8 KB)

In the example.js, please change the id in getElementById and try once

is that variable declared buddy
Cheers @winningvish

Its not declared and I guess we need to declare but data type what I have to give is the another question in my mind?

Regards
Vishnu

Sure Jatin,

Thank you for your reply looking into it right now.

Could you try using Uipath Explorer ( UIExplorer ) and see if you can build a better selector with this?

Actually we don’t need to declare document as a variable, it refers to the Document object, which is like Document Object Model in HTML and JS is being used to get the element from that and can be used to modify it. Hope that helps!

Hi Robert,

I am unable to find the element using UiPath Explorer as well.

Regards
Vishnu

Noted Jatin.

function Click()
{
document.getElementById(“flDataFile”)
}

I have tried the above code : No Errors, but did not click on the element

Please add .click() at the end of document.getElementById(“flDataFile”)

so document.getElementById(“flDataFile”).click()

Now getting this error,

Click

Just wondering if you used lowercase or Pascal case in Click.

The correct one is “.click()” all in small characters