0e4d02cb
toby5221
增加装柜任务形成现存尾货
|
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
|
package com.essa.pageObject.StorageManage;
import com.essa.framework.BasePage;
import com.essa.framework.Model;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import java.util.Date;
/**
* 装柜任务处理
*/
public class LoadContainerHandlePage extends BasePage {
public LoadContainerHandlePage(WebDriver driver){
super(driver);
}
/**
* 元素定位
*/
// 实装柜日期
@FindBy (xpath = "//input[@id='loadCompleteDate']")
WebElement actLoadTime;
// 可装柜箱数
@FindBy (xpath = "//tr[@class='ng-scope']//td[6]")
WebElement mayLoadQuantity;
// 实装箱数
@FindBy (xpath = "//input[@id='actLoadBoxQuantity']")
WebElement actLoadQuantity;
// 点击选择文件
@FindBy (xpath ="//div[@id='rt_rt_1cqvbp0jn14kfb41keb187l1u8oh']//label" )
WebElement actPicture;
// 提交
@FindBy (xpath = "//*[text()='提交']")
WebElement submit;
/**
* 页面方法
*/
public LoadContainerHandlePage loadTaskHandle(){
|
d7f15c1c
zengjin
提交并且覆盖之前的
|
49
|
forceWait(1000);
|
0e4d02cb
toby5221
增加装柜任务形成现存尾货
|
50
51
52
53
54
55
56
57
|
jsExecutorRemoveAttribute(actLoadTime,"readonly");
String date = getDateTimeByFormat(new Date(), "MM/dd/yyyy");
sendKeys(actLoadTime,date);
// 获取‘可装柜数量’字符串中的数量
String qua = partiaStr(mayLoadQuantity,0,1);
// 对切片结果进行int转换
int i = Integer.valueOf(qua).intValue();
// 形成现存尾货‘2’
|
8ea5be89
toby5221
修改定义
|
58
|
int tail = i-2;
|
0e4d02cb
toby5221
增加装柜任务形成现存尾货
|
59
|
// 对计算结果转换成string,并赋值给“实装柜数量”
|
8ea5be89
toby5221
修改定义
|
60
|
String quantity = String.valueOf(tail);
|
0e4d02cb
toby5221
增加装柜任务形成现存尾货
|
61
|
sendKeys(actLoadQuantity,quantity);
|
d7f15c1c
zengjin
提交并且覆盖之前的
|
62
63
|
click(submit);
dynamicLoad();
|
0e4d02cb
toby5221
增加装柜任务形成现存尾货
|
64
65
66
|
return new LoadContainerHandlePage(driver);
}
}
|