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.

Regular expression

Hello,
I have some check boxes in my application which named like
'codeSelectDE', 'codeSelectAD', 'codeSelectDR' etc...
Right now I wrote a sahi code like
_check(_checkbox("codeSelectDE"));
_check(_checkbox("codeSelectAD"));
_check(_checkbox("codeSelectDR"));
like this I have 1000+ line of code... I need to make it in one line of code with regExp.. Can anyone help me plz...?

am using sahi V4.4

Answers

  • Does v4.4 have the _collect API?
    var $checkboxes = _collect("_checkbox", "/codeSelect/");
    for ($i; $i < $checkboxes.length; $i++) {
        _check($checkboxes[$i])
    }
    
Sign In or Register to comment.