Need to pass set of parameters to a handler

Hi All,

Im new to testplant please help me, I need to pass a set of parameters to a handler so that I can run the handler for different parameters

Here is what I'm doing right now, I have two scripts AddDetails and FillDeatils and I'm sending one set right now.
I want to send four different sets to FillDeatils

Sets I want to send -
(servername"testServer",ip"10.10.10.1",username"testuser", passwd"PasswdForTestUser")
(servername"testServer",ip"IncorrectIP",username"testuser", passwd"PasswdForTestUser")
(servername"testServer",ip"10.10.10.1",username"IncorrectUsername", passwd"PasswdForTestUser")
(servername"testServer",ip"10.10.10.1",username"testuser", passwd"IncorrectPasswd")


My scripts 
-----------------------------------------------------------
Script - AddDetails 
-----------------------------------------------------------


put  (servername"testServer",ip"10.10.10.1",username"testuser", passwd"PasswdForTestUser") into creds

FillDeatils creds

(*
Some other stuff
*)

-----------------------------------------------------------
Script - FillDeatils
-----------------------------------------------------------

params creds

Click ("AddCluster//AddCluster_ServerName")
TypeText creds.servername

Click ("AddCluster//AddCluster_LoginNode")
TypeText creds.ip

Click ("AddCluster//AddCluster_Username")
TypeText creds.username

Click ("AddCluster//AddCluster_Password")
TypeText creds.passwd

(*
Some other stuff
*)

Thank you
Nandurkar

Comments

  • eggycarrieeggycarrie Member
    Hi Nandurkar,

    You mention you want to set 4 different sets of creds - do you simply want to iterate through each set of credentials, one after the other, and have FillDetails run 4 times in a row? If so, you can create a list of property lists, and then iterate through:

    put ((servername:"testServer",ip:"10.10.10.1",username:"testuser", passwd:"PasswdForTestUser"),(servername:"testServer",ip:"IncorrectIP",username:"testuser", passwd:"PasswdForTestUser"),(servername:"testServer",ip:"10.10.10.1",username:"IncorrectUsername", passwd:"PasswdForTestUser") ,(servername:"testServer",ip:"10.10.10.1",username:"testuser", passwd:"IncorrectPasswd")) into credslist

    repeat with each creds of credslist
    FillDetails creds
    end repeat

    -Carrie
  • nandurkarnandurkar Member
    Works like a charm...
    This is exactly what I wanted to achieve.

    Thanks a lot Carrie

    Regards,
    Nandurkar
Sign In or Register to comment.