Blame view

src/main/java/pageObiect/CabinetTask/HandlingLoadingOrders.java 2.27 KB
71af73f2   78@qq.com   lana update
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
  package pageObiect.CabinetTask;
  
  import com.essa.framework.BasePage;
  import org.openqa.selenium.By;
  import org.openqa.selenium.WebDriver;
  import org.openqa.selenium.WebElement;
  import org.openqa.selenium.support.FindBy;
  
  import java.text.SimpleDateFormat;
  import java.util.ArrayList;
  import java.util.Date;
  import java.util.List;
  
  import static jdk.nashorn.internal.objects.Global.print;
  
  import com.essa.framework.BasePage;
  import com.essa.framework.LogType;
  import com.essa.framework.Logger;
  
  
  /**
   * Created by Administrator on 2018/10/30 0030.
   */
  public class HandlingLoadingOrders extends BasePage {
      public HandlingLoadingOrders(WebDriver driver) {
          super(driver);
      }
  
      WebDriver webDriver;
      /*
  	 * 元素定位
  	 */
  
      //实际装柜日期
      @FindBy(xpath = "//input[@id='loadCompleteDate']")
      WebElement loadCompleteDate;
  
      //获取装柜商品列表
      //@FindBy(xpath ="//td[@ng-repeat='item in taskInfo.skuList']")
      //WebElement tdList;
      @FindBy(xpath = "//tbody[2]/tr[1]/td[6]")
      WebElement firstTr;//定位第一行
  
  //    //获取元素列表循环读取值
  //    public ArrayList<String> getTrtd() {
  //        String trs=testtrList.getText();
  //
  //        WebElement temp;
  //        for (int kk=0;kk<0;kk++){
  //            temp= driver.findElement(By.xpath("//tbody[2]/tr["+kk+"]/td[6]"));
  //            temp.getText();
  //
  //        }
  
  //       ArrayList arryList = new ArrayList();
  //        //arryList.set(0,trs);
  //        System.out.print(trs+"123456789---------");
  //        return arryList;
  //    }
  
      //输入实装箱数
      @FindBy(xpath = "//input[@id='actLoadBoxQuantity']")
      WebElement realNumber;
  
      //提交
      @FindBy(xpath = "//*[text()='提交']")
      WebElement submit;
  
      /**
       * 设置装柜处理参数
       */
      public HandlingLoadingOrders setHandlingCabinet() {
          dynamicLoad(By.xpath("//div[@style='display: none;' and @id='mask']"));
          //设置实际装柜日期
          jsExecutorRemoveAttribute(loadCompleteDate, "readonly");
          loadCompleteDate.click();
          forceWait(500);
          SimpleDateFormat zs=new SimpleDateFormat("MM/dd/yyyy");
          String s =zs.format(new Date());
          sendKeys(loadCompleteDate,s);
          click(submit);
          return new HandlingLoadingOrders(driver);
      }
  
  
  }