Recently I found the need to have Selenium loop through a bunch of commands for different users, each with their own usernames and passwords.
Thankfully, it's fairly painless to setup using the SelBlock plugin for Selenium IDE.
Create a datafile:
If the file is saved in the same directory as the test script, you can use a relative path.
Loop through it and log the username: