Forum Discussion
Dmitry_Nikolaev
Staff
16 years agoHi,
See the code below, it explains how this should be done:
If you need to pass several user/password pairs, I recommend that you consider data-driven testing.
I'm new to c# and I used to use winrunner before HP days and one thing I used in functions were the parameters to push in so that when the function ran it would set the text value as to what I passed into the function call.
essentially I need to find out first how that part of the function is created
See the code below, it explains how this should be done:
function main()
{
var User1 = "testuser";
var Pass1 = "testpass";
Login(User1, Pass1);
}
function Login(user, password)
{
//...
form = page["table"]["cellSmall"]["table"]["formLogin"];
textbox = form["cellSmall"]["textboxUserName"];
textbox["Click"](16, 11);
textbox["Text"] = user;
form["cell"]["passwordboxPassword"]["Text"] = password;
If you need to pass several user/password pairs, I recommend that you consider data-driven testing.