Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
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