-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathelement.ini
More file actions
60 lines (52 loc) · 1.77 KB
/
element.ini
File metadata and controls
60 lines (52 loc) · 1.77 KB
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
; 约定
; 1. 所有section都是一个测试流程所需的元素
; 2. 所有元素命名方式:
; 元素名.method 表示该元素的定位方式
; 元素名.value 表示该元素的定位的值
; 3. 定位方式的写法
; "id":id定位
; "xpath":xpath定位
; "link_text" link的文字
; "partial_link_text":包含link的文字
; "name":元素name
; "tag_name":元素标签名
; "class_name": 类名
; "css_selector": css选择器
; 4. 元素名命名方式
; 含义_控件名
; 元素的含义例如用户名,密码等含义使用驼峰命名
; 例如
; 输入框:
; 含义_input:
; 用户名输入框-> user_input
; 密码输入框 -> pwd_input
; 关键词搜索输入框 -> kw_search_input
; 复选框:
; 含义_checkbox:
; 自动登录复选框 -> autoLogin_checkbox
; 5.元素的行为
; 按钮行为只能是点击
; 输入框只能是输入
[login]
# 登录链接
login_link.method = link_text
login_link.value = 登录
# 用户名输入框
user_input.method = id
user_input.value = user_name
# 密码输入框
pwd_input.method = id
pwd_input.value = user_password
# 登录按钮
login_button.method = xpath
login_button.value = //button[contains(@onclick,'/DBShop/user/register')]/preceding-sibling::button
# 选择框
sex_select.method = select
sex_select.value = //button[contains(@onclick,'/DBShop/user/register')]/preceding-sibling::button
sex_select.select = (text,男)
ket_js.method = js
ket_js.value= //button[contains(@onclick,'/DBShop/user/register')]/preceding-sibling::button
ket_js.javaScript =
page.method = js
page.value= //button[contains(@onclick,'/DBShop/user/register')]/preceding-sibling::button
page.iframe = chanage