Skip to content

Instantly share code, notes, and snippets.

@knorrium
Created May 19, 2010 19:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save knorrium/406768 to your computer and use it in GitHub Desktop.
Save knorrium/406768 to your computer and use it in GitHub Desktop.
import com.thoughtworks.selenium.*;
import java.util.regex.Pattern;
public class Wordpress extends SeleneseTestCase {
public void setUp() throws Exception {
setUp("http://demo.opensourcecms.com/", "*chrome");
}
public void testJunit() throws Exception {
selenium.open("/wordpress/wp-login.php");
selenium.type("user_login", "admin");
selenium.type("user_pass", "demo123");
selenium.click("wp-submit");
selenium.waitForPageToLoad("30000");
verifyTrue(selenium.isTextPresent("Howdy, admin"));
selenium.click("link=Posts");
selenium.waitForPageToLoad("30000");
selenium.click("//div[@id='wpbody-content']/div[2]/h2/a");
selenium.waitForPageToLoad("30000");
selenium.type("title", "Selenium demo Post");
selenium.click("publish");
selenium.waitForPageToLoad("30000");
verifyTrue(selenium.isTextPresent("Post published"));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment