I want to check checkbox automatically in a webpage. Each webpage is having different number of checkboxes. I have tried to inject Javascript to webpage. But Javascript is not working with UIpath. But Manually when i enter the same code in the webpage ,using viewcode of webpage and run javascript it works good. All checkboxes get checked. when ever i use option ‘inject js’ in UIpath it fails. Below is my code.
Any Suggesstion would be great help for me.
var allInputs =document.querySelectorAll(‘input[type=checkbox]’);
Hi,
You can use Check activity and Keep the option as check and the selector you can make sure it is dynamic so that it work for all the check box
Regards
Shanmukh
Thank you for your kind reply. but when i did that i got this error
RemoteException wrapping UiPath.Core.ElementOperationException: Attribute not supported by the current UiNode. —> RemoteException wrapping System.Runtime.InteropServices.COMException: Attribute not supported by the current UiNode.
@ANTONY_JOSEPH… Which version of Uipath you are using ?
Studio 2019.10.4 - 2/6/2020
Enterprise Trial License
Windows Installer
Microsoft Windows Server 2019 Datacenter 64-bit
.NET Framework Version 4.7.2 or later
Studio 2019.10.4 - 2/6/2020
Enterprise Trial License
Windows Installer
Microsoft Windows Server 2019 Datacenter 64-bit
.NET Framework Version 4.7.2 or later
@ANTONY_JOSEPH Then it is related to selector issue only, it might be not pointing to correct node
Please check for one checkbox first and if does not work then can you add the screenshot
or
use get attributes to know if the checkbox is selected or not and then use click activity
okay
Hi,
You can use FindElement Activity to get all Decendants and then dynamically iterate through them that are checkboxes and click on them.
Pls have a look at the xaml attachedMain.xaml (8.8 KB)
Thank you very much i was looking for this stuff. But i have few problems left as im new in uipath. Im attaching screenshoots of things that i have tired. I still have problem with checkbox selection. can you figure it out. it will be great help for me.
Thank you
Not sure what the problem is with the selction, can you explain in more detail?
According to your screenshots it seems that you did not set a valid selector into the variable ‘selector’.
A selector is more than just an id.
I would use the following approach:
In a sandbox workflow I would learn how to check an individual checkbox in given web page - either using Click activity or Check activity.
In a sandbox workflow I would learn how to select all checkboxes in a loop - e.g. using Highlight activity.
Finally I would combine the above.
Thank you very much for your help. I have tried as per your suggestion , but some minor issues are there. checkbox not getting selected. I’m attaching my file. Kindly go through and give some suggestion where i have to change[
Thank you
Flowchart11.xaml (3.9 KB)
Antony,
the xaml you sent is empty.
Antony,
your xaml looks pretty much like mine - so the question is:
what is the issue you are facing atm?
Does it fail with not finding the control?
Does it pass but not click on the element?
Clicking on check box is not performing.
if you haven’t resolved this. I had a similar case and you may try these steps to resolve it. (I assume that you only wanna check all check boxes without any other specific id.)
- In the Find Children add Input Filter
<webctrl tag='INPUT' />
-
For Each child just put Check with Target Element by
child
.
pls let me know if this works for your case.