I have been working with WebDriver/Selenium 2 for some time now; I implemented it for my team at work and have since discovered ways to do load testing.
I code primarily in C#, but if this were to be done in Java you could take advantage of the headless browser driver (HtmlUnitDriver), which would allow you to potentially run 100s of tests at once. IKVM allows you to convert this to C#, but when I did this I discovered that a 5 second test took 2 minutes or more to run, and I wasn't willing to deal with that.
It's not implemented in WebDriver but I was easily able to run 100 concurrent instances of SimpleBrowser performing a simple test.
Anyway, on to the code:
- You will need to use a delegate to pass parameters to the test, in this case I've used a lambda expression.
- I've run into problems trying to run this as a unit test:
- For some reason, a unit test doesn't run the threads all at once, instead it will run them one at a time.
- You will have to spin the main thread while it waits for the other threads to finish.