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.

How we can iterate a sign-up form process..

bappichokbappichok Members
edited November -1 in Sahi - Open Source
Hi,
As I am new to sahi, I am facing some problems using it. Can you tell me how we can iterate a normal sign-up page, which using more than 3 different user

Comments

  • Hi bappichok,

    Try with the following script,
    var $username=["name1","name2","name3"];
    var $password=["password1","password2","password3"];
    for(var $i=0;$i<$username.length;$i++){
     for(var $j=0;$j<$password.length;$j++){
          if($i==$j){
              _setValue(_textbox("textboxId"),$username[$i]);
              _setValue(_password("passwordId"),$password[$j]); 
              _click(_submit("siginId"));
              ......
              ...........
              _navigateTo("url for signIn page");
     }
     }
    }
    

    This might help you.

    Regards,
    Theeran.
  • Still not able to solve the problem.

    Will you be able to give me some basic tips on how to iterate. for eg

    It will have following field:
    1.Firstname
    2.lastname
    3.password
    4.confirm password
    5.email id
  • Hi

    first thing you do is to record the script once. Then you encapsulate your code in a function with firstname etc as arguments. Replace your recorded fields with the variables $firstname etc and then define you dataset like
    var $data=[
    ["user1", "pass1" .....],
    ["user2", "pass2" .....],
    ]
    
    then have a look at
    http://sahi.co.in/w/data-driven-testing
    and you may be able to iterate with _dataDrive(login, $data)

    Regards
    Wormi
Sign In or Register to comment.