登录测试

package test;
import org.junit.Before;
import org.junit.Test;

import com.thoughtworks.selenium.*;

public class juniuttestcase extends SeleneseTestBase {
    @Before
    public void setUp() throws Exception {
	setUp("http://weibo.com/", "*firefox");
        selenium.setSpeed("1000");
        selenium.windowMaximize();
        selenium.setTimeout("60000");
    }
    @Test
      public void testRegister() throws Exception {
    	  selenium.open("/"); 
    	  selenium.type("username","username");
    	  selenium.type("password", "password");
    	  selenium.click("//*[@id='login_form_savestate']");
    	  selenium.click("//*[@class='info_list login_btn']//a");
    	  selenium.waitForPageToLoad("60000");
    	  assertTrue(selenium.isTextPresent("username"));//assertionError:null
    }
}

你可能感兴趣的:(登录测试)