18 January 2026:


This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.



Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.

checkbox not being clicked

Hi All,

I have the following issue, and I'd like to know how I can get around it.

I recorded a checkbox on a page and sahi recorded it as follows:

_click(_checkbox("id_confirm-accepted_terms_conditions"));

Yet, when I run my tests (using Chrome and FF), the box is never clicked and the process never completes. If I use the following alternate accessor, it works:

_click(_label(43));

Unfortunately the alternative is not feasible, as that label changes depending on a various number of factors, so it's never consistent and will break other tests, and I don't want to clutter the test by putting lots of 'if/else' statements in it.

The source for the checkbox is:

<input class="toggler check" id="id_confirm-accepted_terms_conditions" name="confirm-accepted_terms_conditions" type="checkbox">

Is there a way for me to figure out that label id, e.g. the '43' in '_click(_label(43));' and then use some other way to click the checkbox?

Answers

  • Is the hyphen in the id possibly causing this to happen? Do I need to escape it somehow?
  • Is the hyphen in the id possibly causing this to happen? Do I need to escape it somehow?
  • jasonbjasonb Members
    edited October 2015
    Ooops, sorry for the spam.

    I noticed that it's working fine in the controller, just thought I'd add that.
Sign In or Register to comment.