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.

Is there any easy way to set value to a textbox instead of below code

PadmashiniPadmashini Members
edited March 2013 in Sahi - Open Source
_setValue(_textbox("ctl00\$ContentPlaceHolder1\$PageContainer\$TabPanel0\$dbgORDERDETAIL\$ctl02\$SD_ORDER_DETAIL_ORDER_QTY"), "100");

Answers

  • Looks easy to me
    _set(_textbox(id), value)

    when your framework generates not so easy ids, Sahi can't help you ;)

    Or maybe it can. Look for something simple, like a surrounding div and use
    _set(_textbox(index, _in(_div(easyID))), value)
  • NaomiCNaomiC Members
    edited March 2013
    If there's a label for the textbox, you can do this: _setValue(_textbox(0, _near(_label("label text"))).

    Of course you can use '_under' instead of '_near' if textbox is under the label and there are more than one textboxes near the label. If there's no label for the textbox, just look for another element that's close to the textbox.
Sign In or Register to comment.