18 January 2026:
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
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.
Handling checkboxes
Hi,
I have a window with the following properties and checkboxes
Mandatory []
Read Only []
Hidden []
I need to check the ReadOnly checkbox.
Sahi reads these checkboxes as checkbox("gwt-uid-XX") (XX is a random number, incremented each time the window is opened like 53, 60, 67 etc) . So it does not work in the run-time.
I've tried --- browser.checkbox().near(browser.div("Read Only[1]")).check();
or --- browser.check(browser.checkbox().near(browser.div("Read Only[1]")));
and it did not work.
Kindly let me know if there is any way to do this.
thanks in advance
-Diwakar
I have a window with the following properties and checkboxes
Mandatory []
Read Only []
Hidden []
I need to check the ReadOnly checkbox.
Sahi reads these checkboxes as checkbox("gwt-uid-XX") (XX is a random number, incremented each time the window is opened like 53, 60, 67 etc) . So it does not work in the run-time.
I've tried --- browser.checkbox().near(browser.div("Read Only[1]")).check();
or --- browser.check(browser.checkbox().near(browser.div("Read Only[1]")));
and it did not work.
Kindly let me know if there is any way to do this.
thanks in advance
-Diwakar
This discussion has been closed.
Comments
browser.checkbox().in(browser.div("Read Only[1]")).check();
?
Is it possible to use the keyboard shortcuts? If so, I could set focus on the previous item and use Tab to navigate to these checkboxes?
thanks
-Diwakar
browser.div("Read Only[1]")
does it highlight the expected element?
When I highlight 'Read Only', it highlights the text 'Read Only'
when I highlight the checkbox near 'Read Only' , it highlights the checkbox.
browser.checkbox().near(browser.div("Read Only")).check();
Any reason you added [1] to it?
And no luck again, I have tried all possible ways of near(browser.div("Read Only")), I have tried with browser.row(), then I have tried browser.checkbox().in(browser.div(""))
browser.check(browser.checkbox(0).near(browser.div("Read Only")));
I did not notice that there was no identifier for checkbox.
Regards,
Narayan
thanks a lot. it works!!!!
regards
-Diwakar