I would like to create a test for my web app using Ruby and watir webdriver. In my test I need to open 5 browser windows and enter credentials to login to my web app. So far everything works good except one thing - I'm doing a simple loop of 5 iterations and enter same username and pwd in each iteration but my goal is to enter different usernames and pwd's each time. So, what is the best way to do that? Loop through value-key pair?
Here is my example code:
$i = 0
$num = 5
while $i < $num do
b = Watir::Browser.new
b.goto 'https://localhost/mywebapp'
b.text_field(id:'username').set 'test1'
b.text_field(id:'password').set 'test1pwd'
b.button(id: 'submitBtn').click