求大神给看看什么问题,谢谢了,快点,急用。

荣蓝科创 2013-03-12 08:41:17
package com.baidu.test;

import com.thoughtworks.selenium.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.*;
import java.util.regex.Pattern;

public class Login extends SeleneseTestCase{
private Selenium selenium;

@Before
public void setUp() throws Exception {
selenium = new DefaultSelenium("localhost", 4444, "*firefox", "http://passport.XXX.com/user/login/");
selenium.start();
}

@Test
public void testLogin() throws Exception {
int i;
String[] user = new String[4];
user[0] = "taofang1";
user[1] = "taofang";
user[2] = "";
user[3] = "";

String[] pw = new String[4];
pw[0] = "111111";
pw[1] = "11";
pw[2] = "";
pw[3] = "111";

selenium.open("/");
verifyTrue(selenium.isTextPresent("个人用户登录"));
verifyTrue(selenium.isTextPresent("用户名"));
verifyTrue(selenium.isTextPresent("密码"));


for(i=0;i<4;i++){
selenium.type("nickName", user[i]);
selenium.type("password", pw[i]);
System.out.println(user[i] + pw[i]);
selenium.click("id=btnSubmit");
selenium.waitForPageToLoad("30000");
}
}

@After
public void tearDown() throws Exception {
selenium.stop();
}
}
...全文
110 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
泰坦小毛驴 2013-03-12
  • 打赏
  • 举报
回复
说说你的目的,或者问题效果 ,不然怎么帮。。。
pei_zhenxi 2013-03-12
  • 打赏
  • 举报
回复
要干嘛???

58,452

社区成员

发帖
与我相关
我的任务
社区描述
Java Eclipse
社区管理员
  • Eclipse
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧