You will need to export the Selenium test case from the IDE into the programming language of your choice and then tweak it.
Consider this sample Selenese test - reordered in Selenium IDE, it navigates to the some forum, clicks "New Post" button, enters the title as "Title 50" and then clicks the "Post" button:
open | /viewforum.php?f=19 | |
clickAndWait | btnNewPost | |
type | subject | Title 50 |
clickAndWait | btnPost | |
After that you export this test as Java JUnit (for example) and you get the following code:
package com.example.tests;
import com.thoughtworks.selenium.*;
import java.util.regex.Pattern;
public class PostTest extends SeleneseTestCase {
public void setUp() throws Exception {
setUp("http://www.forum.com/", "*chrome");
}
public void testCreatePost() throws Exception {
selenium.open("/viewforum.php?f=19");
selenium.click("btnNewPost");
selenium.waitForPageToLoad("30000");
selenium.type("subject", "Title 50");
selenium.click("btnPost");
selenium.waitForPageToLoad("30000");
}
}
So what you need to do is to add a loop that will create posts with titles "Title 001" to "Title 100":
public void testCreatePost() throws Exception {
for (int i=1; i<=100; i++) {
selenium.open("/viewforum.php?f=19");
selenium.click("btnNewPost");
selenium.waitForPageToLoad("30000");
selenium.type("subject", String.format("Title %03d", i));
selenium.click("btnPost");
selenium.waitForPageToLoad("30000");
}
}
You will need Selenium RC to run this tests - please refer to the Selenium documentation