??????????
???????????? ???????[ 2012/12/28 10:14:24 ] ????????
?????????“???”????????????
????A.“?????????”??“?????????”??“????????”??“??”??????
?????????????л???
????B.???“???”???????A?????в??裬????“???URL”??“?????”??“????”??????????
????????????????B??????????“?????????????????????????????漰?????п???????????????????”??????????????????????????÷????????????????????????????
???????????????????????????????????????????????????????????С????????£?
????/*****************************************????????*****************************************/
????/**
????* ?????
????* @author leizang.cs
????*
????*/
????public interface ActionCommand {
????/**
????* ??????
????* @param url ???url
????* @param nick ?????
????* @param passWord ????
????*/
????public void login(String url?? String nick?? String passWord);
????/**
????* ???
????*/
????public void loginOut();
????/**
????* ??ж???
????* @param subOption ???????
????*/
????public void doSub(SubOption subOption);
????/**
????* ?????????У???????
????* @param dbCheckOption У?????
????* @param needCheckedTables ???У?????
????*/
????public void checkSubDB(SubDbCheckOption dbCheckOption?? TableEnum...needCheckedTables);
????/**
????* ????????????
????* @param sql ?????е?sql
????*/
????public void dbExecute(String... sqls);
????}
????/*****************************************????????*****************************************/
??????????????????????????????????????????
????<!--[if !supportLists]-->2?? <!--[endif]-->?????????????——??????????
????????????????????????????????????????????????????????????????????????????????е?????????????????????????????????й????????????????????????????ο???
????/*****************************************????????*****************************************/
????public class ActionCommandImpl implements ActionCommand{
????private WebDriver driver;
????private JdbcTemplate jdbc;
????@Override
????public void dbExecute(String... sqls){
????for(String sql: sqls){
????jdbc= CommonUtil.getJdbcFromSql(sql);
????jdbc.execute(sql);
????}
????}
????@Override
????public void login(String url?? String nick?? String passWord){
????try{
????driver= new HtmlUnitDriver();
????driver.get(url);
????WebElement userName= driver.findElement(By.id("TPL_username_1"));
????userName.sendKeys(nick);
????WebElement passWd= driver.findElement(By.name("TPL_password"));
????passWd.sendKeys(passWord);
????WebElement submit= driver.findElement(By.className("J_Submit"));
????submit.click();
????}finally{
????writePage();
????}
????}
????@Override
????public void loginOut(){
????driver.quit();
????}
????/**
????* @dscription ???????
????* @param subOption ????????
????* @throws ITestException
????*/
????@Override
????public void doSub(SubOption subOption)throws ITestException{
????if(subOption== null){
????Assert.fail("???????????????!");
????}
????String subUrl= subOption.getSubUrl();
????CycleEnum cycle= subOption.getCycle();
????log("??????????");
????look(subOption);
????if(subUrl== null || subUrl.isEmpty()){
????Assert.fail("????Url???????!");
????}
????if(cycle== null){
????Assert.fail("??????????????!");
????}
????try{
????driver.get(subUrl);
????log(" ??????:"+ subUrl);
????WebElement period= null;
????switch(cycle){
????case ONE_MONTH:
????period=driver.findElement(By.id("p-month"));
????period.setSelected();
????break;
????case ONE_SEASON:
????period=driver.findElement(By.id("p-season"));
????period.setSelected();
????break;
????case HALF_YEAR:
????period=driver.findElement(By.id("p-half"));
????period.setSelected();
????break;
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11