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.

_type is not working in sahi.

sujatasujata Members
edited November -1 in Sahi - Open Source
_type(_textbox("USERNAME"), "admin");,I have used this,but this is not working.I want to type using sahi.

Comments

  • Hi sujata,

    Inorder to type the "admin" in _textbox("USERNAME"),you can try the following script,
    var $username="admin";
    for(var $i=0;$i<$username.length;$i++){
    _keyPress(_textbox("USERNAME"),$username[$i]);
    }
    

    This may help you.

    Regards,
    Theeran.
  • This is not working
  • In application,we are using Zkoss.To get a value from a text box we use " userName.getValue());",where UserName is the textbox id.When I play the sahi script ,the script enters the data into the textbox.However on click off the submit button "userName.getValue());" is unable to retrieve the value entered into the textbox.
    Thanks in Advance
    Sujata
  • sivasiva Members
    Hi Sujata,

    hope this will help you

    _setValue(_textbox("USERNAME"), "admin");
  • Hi sujata,

    To get the value of the _textbox("USERNAME"),use

    _getValue(_textbox(textboxIndex));

    you can use textboxIndex,because the textboxId is dynamically generated.

    I tried with the following URL,this works fine for me.

    http://www.zkoss.org/zkdemo/input/form_sample.

    Hope this may help you.

    Regards,
    Theeran.
Sign In or Register to comment.