Click on a checkbox does not work

Hello,

I have used “Record” button to record the procedure I want to perfom on a page and it recorded my click on a checkbox as follow:

type name=name_of_checkbox value=N
click name=name_of_checkbox

although it shows that it selects the appropriate box, but it does not click it. Any idea what is wrong ?

Thanks

This happens when ui vision doesn’t detect a good xpath for the checkbox. I recommend using a browser extension to find more precise additional xpaths that can fix the problem.

I use check command (and not click command) with a good xpath detected with a xpath finder (extension of browser)

Can you post a link to the website? Then I could try.

Thanjk you for your reply. I install xPath Finder for chrome and this is what I got:

Iframe: //*[@id="uaeOnlineIframe"]
XPath: /html/body/div[1]/div/div/div/div/div/div/div/div[1]/div[1]/div/div[2]/div/div/div/div/form/div[3]/div/input

Now can you please let me know how to click the check box in UI Vision ?

Hello,

the website reuires login so I can only send you the check box HTML code

<input type="checkbox" name="s_1_1_5_0" uae-labelledby="DeclarationCheck1_Label_1" uae-label="I have read and accept the statements above." style="height: 12px; width:12px;" class="siebui-ctrl-checkbox siebui-align-left siebui-input-align-left s_1_1_5_0" maxlength="255" tabindex="0" value="N" uae-checked="false" uae-readonly="false" title="">

when clicked, the value and uae-checked is changed as follow:

<input type="checkbox" name="s_1_1_5_0" uae-labelledby="DeclarationCheck1_Label_1" uae-label="I have read and accept the statements above." style="height: 12px; width:12px;" class="siebui-ctrl-checkbox siebui-align-left siebui-input-align-left s_1_1_5_0" maxlength="255" tabindex="0" value="Y" uae-checked="true" uae-readonly="false" title="">

A perfect solution to click it is to use Xclic instead of click this way you simulate a mouse click.

It is possible that xpath is dynamic and therefore changes because I see a series of numbers that could be dynamic.

Try Xclic and you should fix the problem (Xclic needs ui vision xmodules installed on your computer)

Thank you for the suggestion. I played with click command alot and when I couldn’t find a solution I switched to xclick and it’s working perfectly, however after tens of rounds ( I play the procedure several hundred timed ), it doesn’t work or gives me out of memory error in chrome. I have no idea why is that, although I’m running this automation on a Windows 11 VM with 4 CPU cores and 16GB of RAM.

See here: How to run RPA 24x7

The UI.Vision RPA command line allows you to control the UI.Vision RPA operation. With the -savelog switch a calling script can easily check on the success of each macro run. The -closebrowser and -closeRPA switches allow you close Chrome and Firefox periodically to avoid memory leaks.

So in other words, you use a script e. g. Python, VBS or Powershell to start the macro via command line, run e.g, a macro with 200 loops, then close the browser, and then start it again and run the next 200 loops. This way you can run your automation forever without memory issues.

I used your html code to create a web page and load it and with this code check the checkbox

I used a very generic xpath to avoid the dynamic xpath problem
If there are frames on the page it may not work, without accessing the page I cannot detect any frames

In my test working, check the checkbox without any problem.

Macro code

{
  "Name": "MacroName",
  "CreationDate": "2023-2-10",
  "Commands": [
    {
      "Command": "check",
      "Target": "xpath=(//input[@type='checkbox'])[1]",
      "Value": "",
      "Description": ""
    }
  ]
}

Thank you very much for the info. I will try it for sure.
But the problem is something else. For exmple meanwhile I was reading your message, my script ran 25 times and after this time, the xclick is not working properly and is not clicking on the checkbox. I have to close UI Vision and the reopen it to make it work again. I think this is a problem with UI Vision that should be fixed.

Thank you for your help. This page uses frames and as i mentioned earlier this is the frame that the checkbox is placed on:

Iframe: //*[@id="uaeOnlineIframe"]

Another strange problem is that when I ran your code, I can see that the checkbox is checked visually, but after UI Vision clicks on accept button, it gives me an error asking me to accept the terms!
Maybe this is caused due to the website using frames

Without being able to see the page it is impossible to understand the problem

I have found out that this is a limitation with xClick usage on the free version of the software. Seems that there’s a 25 times xClick usage restriction on free version

you’re right. Thank you for your help :slight_smile: