This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
dongxiaoyan-tsg-autotest/02-Keyword/tsg_ui/setting/Settings.robot
lyf fee5a2fc89 1、提价修改的UI关键字和case
2、提交Dashboard的Traffic关键字和一个case
3、提交GetTimeLibrary中新加的代码
2020-08-18 18:02:07 +08:00

1444 lines
69 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

*** Settings ***
Library Selenium2Library
*** Keywords ***
click
[Arguments] ${element}
Click Element ${element}
input
[Arguments] ${element} ${text}
Input Text ${element} ${text}
ui-logout
Close Browser
ui-login
Open Browser http://192.168.40.120 Chrome
input xpath=//*[@id="app"]/div/div[2]/div/div[2]/div/input lyf
input xpath=//*[@id="app"]/div/div[2]/div/div[3]/div/input 111111
click xpath=//*[@id="app"]/div/div[2]/div/div[4]/button
Create-Hijack Files
[Arguments] ${name} ${file} ${type} ${shift}=1 ${input1}=1
Sleep 1
click id=children5 #点击一级目录Settings
Sleep 1
click id=sidebarProxy_Profiles #点击二级目录Proxy Profiles
Sleep 2
click id=profilesTabs_Profile_HijackFiles #点击Hijack Files按钮
Sleep 1
click id=hijackAdd #点击Create
Sleep 2
input id=hijack_profileName ${name} #输入name
Sleep 2
Choose File xpath=//*[@id="app"]/div/div[3]/div/div/div[3]/div[1]/div[2]/form/div[2]/div/div/div[1]/input ${file} #上传文件
Sleep 2
${dow_name} Set Variable ${shift}
${input} Set Variable ${input1}
run keyword if "${dow_name}"=="close" and "${input}"=="shuru" run keywords sleep 1
... AND input id=hijack_contentName ${name}
... ELSE IF "${dow_name}"=="open" click xpath=//*[@id="contentNameChoose"]/div[1]/span[2]
sleep 1
click id=hijackAddContentType #点击+ 打开侧滑窗口
Sleep 1
click ${type} #选择文件类型
sleep 2
click id=hijackAddOk1 #点击OK
Wait Until Element Is Visible id=one-input 20
input id=one-input ${name} #搜索输入框输入name
Sleep 1
click id=select_new_search_btn #点击搜索按钮
Sleep 1
${text1} Get Text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr/td[2]/div/span #获取点击后页面文本信息
Should Be Equal As Strings ${text1} ${name} #断言
Create-Insert Scripts
[Arguments] ${name} ${file} ${type}
Sleep 1
click id=children5 #点击一级目录Settings
Sleep 1
click id=sidebarProxy_Profiles #点击二级目录Proxy Profiles
Sleep 2
click id=profilesTabs_Profile_Insert #点击Insert Scripts按钮
Sleep 1
click id=insertAdd #点击Create
Sleep 2
input id=insert_profileName ${name} #输入name
Sleep 2
Choose File xpath=//*[@id="insertAddUpload"]/div[1]/input ${file} #上传文件
Sleep 2
click id=insert_select_format #点击下拉框按钮
Sleep 1
click ${type} #选择css
sleep 1
click id=insertAddOk1 #点击OK
Sleep 1
input id=one-input ${name} #搜索输入框输入name
Sleep 1
click id=select_new_search_btn #点击搜索按钮
Sleep 1
${text1} Get Text xpath=//*[@id="app"]/div/div[3]/div/div/div[3]/div[2]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span #获取点击后页面文本信息
Should Be Equal As Strings ${text1} ${name} #断言
Create-Traffic Mirror Profiles
[Arguments] ${name} ${type} ${shuru}
Sleep 1
click id=children5 #点击一级目录Settings
Sleep 1
click id=sidebarProxy_Profiles #点击二级目录Proxy Profiles
Sleep 2
click id=profilesTabs_Profile_TrafficMirrorProfiles #点击Traffic Mirror Profiles按钮
Sleep 1
click id=trafficMirrorAdd #点击Create
Sleep 2
input id=trafficmirror_profileName ${name} #输入name
Sleep 2
click id=addrTypeChoose #点击下拉框
Sleep 2
click ${type} #选择vlan或者mac
Sleep 1
input id=trafficmirror_addrArray0 ${shuru}
sleep 2
click xpath=//*[@id="app"]/div/div[3]/div/div/div[3]/div[2]/button[1] #点击OK
Sleep 2
input id=one-input ${name} #搜索输入框输入name
Sleep 1
click id=select_new_search_btn #点击搜索按钮
Sleep 1
${text1} Get Text xpath=//*[@id="app"]/div/div[3]/div/div/div[3]/div[2]/div/div[3]/table/tbody/tr/td[2]/div/div/span #获取点击后页面文本信息
Should Be Equal As Strings ${text1} ${name} #断言
Edit-Insert Scripts
[Arguments] ${id-name} ${name} ${name1} ${file} ${type}
[Documentation] 引用关键字,填入必填参数
... 必填参数:
... ${id-name}:为选择要查询的类型是ID或者Name的元素
... ${name}:为查询输入框输入内容
... ${name1}:为修改页面的name输入框里输入的内容
... ${file}:为修改页面要上传文件的路径
... ${type}:选择文件类型的元素
sleep 1
click id=sidebarProxy_Profiles #点击二级目录Proxy Profiles
sleep 2
click id=profilesTabs_Profile_Insert #点击Insert files按钮
sleep 1
click id=one-input #搜索点击输入框
sleep 1
click ${id-name} #选择ID或者name
sleep 1
input id=sreach_input ${name} #输入搜索内容
sleep 1
click id=select_new_search_btn #点击搜索按钮
sleep 1
click xpath=//*[@id="app"]/div/div[3]/div/div/div[3]/div[2]/div/div[3]/table/tbody/tr[1] #点击搜素到的列表
sleep 1
click id=insertEdit #点击Edit
sleep 1
Clear Element Text id=insert_profileName #清空输入框
sleep 1
input id=insert_profileName ${name1} #输入框输入
sleep 1
Choose File xpath=//*[@id="insertAddUpload"]/div[1]/input ${file} #上传文件
sleep 1
click id=insert_select_format #点击下拉框
sleep 1
click ${type} #选择文件类型
sleep 1
click id=insertAddOk1 #点击ok提交
Create-Response Pages
[Arguments] ${name} ${file}
[Documentation] 引用次关键字,填入必填参数
... 必填参数:
... ${name}:新建页面name输入框里的内容
... ${file}:上传文件所在本地的路径
#打开浏览器
#ui-login lyf 111111
Sleep 1
click id=children5 #点击一级目录Settings
Sleep 1
click id=sidebarProxy_Profiles #点击二级目录Proxy Profiles
Sleep 2
click id=respinseAdd #Response Pages点击Create
Sleep 2
input id=responsepages_profileName ${name} #输入name
Sleep 2
Choose File xpath=//*[@id="policy_Manipulation_create6"]/div[2]/form/div[2]/div/div/div/input ${file} #上传文件
Sleep 2
click id=responseAddOk1 #点击OK缇交
Sleep 1
input id=one-input ${name} #搜索框输入
Sleep 1
click id=select_new_search_btn #点击搜索按钮
Sleep 1
${text1} Get Text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr/td[2]/div/div/span #获取点击后页面文本信息
Should Be Equal As Strings ${text1} ${name} #断言
Edit-Response Pages
[Arguments] ${id-name} ${name} ${name1} ${file}
[Documentation] 引用关键字,填入必填参数
... 必填参数:
... ${id-name}:为选择要查询的类型是ID或者Name的元素
... ${name}:为查询输入框输入内容
... ${name1}:为修改页面的name输入框里输入的内容
... ${file}:为修改页面要上传文件的路径
sleep 1
click id=sidebarProxy_Profiles #点击二级目录Proxy Profiles
Sleep 2
click id=one-input #搜索点击输入框
Sleep 1
click ${id-name} #选择ID或者name
Sleep 1
input id=sreach_input ${name}
Sleep 1
click xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1] #点击搜素到的列表
sleep 1
click id=resinseEdit #点击Edit
sleep 1
Clear Element Text id=responsepages_profileName #清空name输入框
sleep 1
input id=responsepages_profileName ${name1}
sleep 1
Choose File xpath=//*[@id="policy_Manipulation_create6"]/div[2]/form/div[5]/div/div/div/input ${file}
sleep 1
click id=responseAddOk1
Sleep 1
input id=one-input ${name1} #搜索框输入
Sleep 1
click id=select_new_search_btn #点击搜索按钮
Sleep 1
${text1} Get Text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr/td[2]/div/div/span #获取点击后页面文本信息
Should Be Equal As Strings ${text1} ${name1} #断言
Edit-Hijack Files
[Arguments] ${id-name} ${name} ${name1} ${file} ${type} ${shift}=1
... ${input1}=1
[Documentation] 引用关键字,填入必填参数
... 必填参数:
... ${id-name}:为选择要查询的类型是ID或者Name的元素
... ${name}:为查询输入框输入内容
... ${name1}:为修改页面的name输入框里输入的内容
... ${file}:为修改页面要上传文件的路径
... ${type}:为文件类型的元素
sleep 1
click id=sidebarProxy_Profiles #点击二级目录Proxy Profiles
Sleep 2
click id=profilesTabs_Profile_HijackFiles #点击Hijack files按钮
sleep 1
click id=one-input #搜索点击输入框
sleep 1
click ${id-name} #选择ID或者name
sleep 1
input id=sreach_input ${name} #输入搜索内容
sleep 1
click id=select_new_search_btn #点击搜索按钮
sleep 1
click xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1] #点击搜素到的列表
sleep 1
click id=hijackEdit #点击Edit
sleep 1
Clear Element Text id=hijack_profileName #清空输入框
sleep 1
input id=hijack_profileName ${name1} #输入框输入
sleep 1
Choose File xpath=//*[@id="app"]/div/div[3]/div/div/div[3]/div[1]/div[2]/form/div[5]/div/div/div[1]/input ${file} #上传文件
sleep 1
${dow_name} Set Variable ${shift}
${input} Set Variable ${input1}
run keyword if "${dow_name}"=="close" and "${input}"=="shuru" run keywords sleep 1
... AND input id=hijack_contentName ${name}
... ELSE IF "${dow_name}"=="open" click xpath=//*[@id="contentNameChoose"]/div[1]/span[2]
sleep 1
click id=hijackAddContentType #点击+号打开侧滑框
sleep 3
click ${type} #选择类型
sleep 1
click id=rigth-menu-button-close #关闭侧滑框
sleep 1
click id=hijackAddOk1 #点击ok提交
Wait Until Element Is Visible id=one-input 20
input id=one-input ${name1} #搜索输入框输入name
Sleep 1
click id=select_new_search_btn #点击搜索按钮
Sleep 1
${text1} Get Text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr/td[2]/div/span #获取点击后页面文本信息
Should Be Equal As Strings ${text1} ${name1} #断言
Edit-Traffic Mirror Profiles
[Arguments] ${id-name} ${name} ${name1} ${type} ${shuju}
[Documentation] 引用关键字,填入必填参数
... 必填参数:
... ${id-name}:为选择要查询的类型是ID或者Name的元素
... ${name}:为查询输入框输入内容
... ${name1}:为修改页面的name输入框里输入的内容
... ${type}:为选择点击vlan或mac的元素
... ${shuju}:为输入框输入内容
sleep 1
click id=sidebarProxy_Profiles #点击二级目录Proxy Profiles
Sleep 2
click id=profilesTabs_Profile_TrafficMirrorProfiles #点击Traffic Mirror Profiles按钮
sleep 1
click id=one-input #搜索点击输入框
sleep 1
click ${id-name} #选择ID或者name
sleep 1
input id=sreach_input ${name} #输入搜索内容
sleep 1
click id=select_new_search_btn #点击搜索按钮
sleep 1
click xpath=//*[@id="app"]/div/div[3]/div/div/div[3]/div[2]/div/div[3]/table/tbody/tr[1] #点击搜素到的列表
sleep 1
click id=trafficMirrorEdit #点击Edit
sleep 1
Clear Element Text id=trafficmirror_profileName #清空输入框
sleep 1
input id=trafficmirror_profileName ${name1} #输入框输入
sleep 1
click id=addrTypeChoose #点击下拉框
sleep 1
click ${type} #选择vlan或者mac
sleep 1
Clear Element Text id=trafficmirror_addrArray0 #清空输入框
sleep 1
input id=trafficmirror_addrArray0 ${shuju} #输入内容
sleep 1
click xpath=//*[@id="app"]/div/div[3]/div/div/div[2]/div[2]/button[1] #点击ok
Sleep 2
input id=one-input ${name1} #搜索输入框输入name
Sleep 1
click id=select_new_search_btn #点击搜索按钮
Sleep 1
${text1} Get Text xpath=//*[@id="app"]/div/div[3]/div/div/div[3]/div[2]/div/div[3]/table/tbody/tr/td[2]/div/div/span #获取点击后页面文本信息
Should Be Equal As Strings ${text1} ${name1} #断言
import-Trusted Certificate Authorities
[Arguments] ${name} ${file}
[Documentation] 引用次关键字,填入必填参数
... 必填参数:
... ${name}:新建页面name输入框里的内容
... ${file}:上传文件所在本地的路径
#打开浏览器
#ui-login lyf 111111
Sleep 1
click id=children5 #点击一级目录Settings
Sleep 1
click id=sidebarProxy_CertificateManagement #点击二级目录Trusted Certificate Authorities
Sleep 2
click id=Authorities_create #点击Import
Sleep 2
input id=authoritiesAdd_name ${name} #输入name
Sleep 2
Choose File xpath=//*[@id="upload_dome"]/div/input ${file} #上传文件
Sleep 2
click id=authoritiesAdd_sub #点击OK缇交
Sleep 1
input id=one-input ${name} #搜索框输入
Sleep 1
click id=select_new_search_btn #点击搜索按钮
Sleep 1
${text1} Get Text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr/td[2]/div/div/div/p/span #获取点击后页面文本信息
Should Be Equal As Strings ${text1} ${name} #断言
Create-Decryption Keyrings
[Arguments] ${name} ${file} ${file1} ${1or2} ${type} ${type1}
... ${shift}=close
[Documentation] 引用次关键字,填入必填参数
... 必填参数:
... ${name}:新建页面name输入框里的内容
... ${file}:上传文件所在本地的路径
... ${file1}:上传文件所在本地的路径
... ${1or2}:填入1 或者其他
... ${type}:上传证书类型的元素
... ${type1}:上传证书加密解密算法的元素
#打开浏览器
#ui-login lyf 111111
Sleep 1
click id=children5 #点击一级目录Settings
Sleep 1
click id=sidebarProxy_CertificateManagement #点击二级目录Trusted Certificate Authorities
Sleep 2
click xpath=//*[@id="proxyTabs"]/div/ul/li[2] #点击Decryption Keyrings
sleep 1
click id=Keyrings_create #点击Create
Sleep 2
input id=keyringsadd_name ${name} #输入name
Sleep 2
Choose File xpath=//*[@id="app"]/div/div[3]/div/div/div[3]/div/div[2]/form/div[2]/div/div/div/input ${file} #上传文件
Sleep 2
Choose File xpath=//*[@id="app"]/div/div[3]/div/div/div[3]/div/div[2]/form/div[4]/div/div/div/input ${file1} #上传文件
${select} Set Variable ${1or2}
Run Keyword If '${select}'=='1' click id=keyringsadd_customized
Run Keyword If '${select}'=='1' input id=reissueExpiryDate 10
sleep 1
click xpath=//*[@id="app"]/div/div[3]/div/div/div[3]/div/div[2]/form/div[7]/div/div/div[1] #点击下拉框
sleep 1
click ${type} #选择证书类型
sleep 1
click xpath=//*[@id="app"]/div/div[3]/div/div/div[3]/div/div[2]/form/div[8]/div/div/div[1] #点击下拉框
sleep 1
click ${type1} #选择加密解密类型
sleep 1
${root} Set Variable ${shift}
run keyword if "${root}"=="open" run keywords sleep 1
... AND click xpath=//*[@id="app"]/div/div[3]/div/div/div[3]/div/div[2]/form/div[10]/div/div
... ELSE IF "${root}"=="close" log "go on"
click id=keyringsadd_sub #点击OK缇交
Sleep 2
input id=one-input ${name} #搜索框输入
Sleep 1
click id=select_new_search_btn #点击搜索按钮
Sleep 1
${text1} Get Text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr/td[2]/div/div/div/p/span #获取点击后页面文本信息
Should Be Equal As Strings ${text1} ${name} #断言
Create-SSL Decryption Exclusion
[Arguments] ${name} ${value} ${name1}
[Documentation] 引用次关键字,填入必填参数
... 必填参数:
... ${name}:新建页面name输入框里的内容
... ${value}:输入内容
... ${naem1}:搜索框填入内容
Sleep 1
click id=children5 #点击一级目录Settings
Sleep 1
click id=sidebarProxy_CertificateManagement #点击二级目录Trusted Certificate Authorities
Sleep 2
click xpath=//*[@id="proxyTabs"]/div/ul/li[3] #点击SSL Decryption Exclusion按钮
sleep 1
click id=ssl_create #点击Create
Sleep 2
input id=sslAdd_name ${name} #输入name
Sleep 2
input id=sslAdd_itemDesc ${value} #输入内容
Sleep 2
click id=ssl_ok #点击OK缇交
Sleep 1
input id=one-input ${name1} #搜索框输入
Sleep 1
click id=select_new_search_btn #点击搜索按钮
Sleep 1
${text1} Get Text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr/td[2]/div/div/div/p/span #获取点击后页面文本信息
Should Be Equal As Strings ${text1} ${name} #断言
Search-Cached Intermediate Certificates
[Arguments] ${type} ${id-sni} ${enabled}
[Documentation] 引用关键字,填入必填参数
... ${type}:为搜索类型的元素id或sni
... ${enabled}为enabled开启或关闭按钮的元素
Sleep 1
click id=one-input #点击搜索框
Sleep 1
click ${type}
Sleep 1
input id=sreach_input ${id-sni}
click id=select_new_search_btn #点击搜索按钮
Sleep 1
click xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr/td[7]/div/div/div/p/a/i #点击下载
Sleep 10
click ${enabled} #点击enabled按钮
sleep 1
Edit-Trusted Certificate Authorities
[Arguments] ${id-name} ${value} ${name} ${file}
[Documentation] 引用关键字,填入必填参数
... 必填参数:
... ${id-name}:为选择要查询的类型是ID或者Name的元素
... ${value}:为查询输入框输入内容
... ${name}:为修改页面的name输入框里输入的内容
... ${file}:为修改页面要上传文件的路径
sleep 1
click id=sidebarProxy_CertificateManagement #点击二级目录Trusted Certificate Authorities
Sleep 2
click id=one-input #点击搜索框
sleep 1
click ${id-name} #选择搜索类型
sleep 1
input id=sreach_input ${value} #输入内容
sleep 1
click id=select_new_search_btn #点击搜索按钮
sleep 1
click xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr #点击搜索列表
sleep 1
click id=Authorities_edit #点击Edit按钮
sleep 1
Clear Element Text id=authoritiesAdd_name #清空name输入框
sleep 1
input id=authoritiesAdd_name ${name} #输入name
sleep 1
Choose File xpath=//*[@id="upload_dome"]/div/input ${file} #上传文件
sleep 1
click id=authoritiesAdd_sub #点击ok
Edit-Decryption Keyrings
[Arguments] ${id-name} ${value} ${name} ${file} ${file1} ${1or2}
... ${type} ${type1}
[Documentation] 引用次关键字,填入必填参数
... 必填参数:
... ${id-name}:为选择要查询的类型是ID或者Name的元素
... ${value}:为查询输入框输入内容
... ${name}:新建页面name输入框里的内容
... ${file}:上传文件所在本地的路径
... ${file1}:上传文件所在本地的路径
... ${1or2}:填入1 或者其他
... ${type}:上传证书类型的元素
... ${type1}:上传证书加密解密算法的元素
sleep 1
click id=sidebarProxy_CertificateManagement #点击二级目录Trusted Certificate Authorities
Sleep 2
click xpath=//*[@id="proxyTabs"]/div/ul/li[2] #点击Decryption Keyrings
sleep 1
click id=one-input #点击搜索框
sleep 1
click ${id-name} #选择搜索类型
sleep 1
input id=sreach_input ${value} #输入内容
sleep 1
click id=select_new_search_btn #点击搜索按钮
sleep 1
click xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr #点击搜索列表
sleep 1
click id=Keyrings_edit #点击Edit按钮
sleep 1
Clear Element Text id=keyringsadd_name #清空name输入框
sleep 1
input id=keyringsadd_name ${name} #输入name
sleep 1
Choose File xpath=//*[@id="app"]/div/div[3]/div/div/div[3]/div/div[2]/form/div[5]/div/div/div/input ${file} #上传文件
Sleep 2
Choose File xpath=//*[@id="app"]/div/div[3]/div/div/div[3]/div/div[2]/form/div[7]/div/div/div/input ${file1} #上传文件
${select} Set Variable ${1or2}
Run Keyword If '${select}'=='1' click id=keyringsadd_customized
Run Keyword If '${select}'=='1' input id=reissueExpiryDate 10
sleep 1
click xpath=//*[@id="app"]/div/div[3]/div/div/div[3]/div/div[2]/form/div[10]/div/div/div[1] #点击下拉框
sleep 1
click ${type} #选择证书类型
sleep 1
click xpath=//*[@id="app"]/div/div[3]/div/div/div[3]/div/div[2]/form/div[11]/div/div/div[1] #点击下拉框
sleep 1
click ${type1} #选择加密解密类型
sleep 1
click id=keyringsadd_sub #点击OK缇交
Sleep 2
input id=one-input ${name} #搜索框输入
Sleep 1
click id=select_new_search_btn #点击搜索按钮
Sleep 1
${text1} Get Text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr/td[2]/div/div/div/p/span #获取点击后页面文本信息
Should Be Equal As Strings ${text1} ${name} #断言
Edit-SSL Decryption Exclusion
[Arguments] ${id-name} ${value} ${name} ${value1} ${name1}
[Documentation] 引用关键字,填入必填参数
... ${id-name}:id或者name的元素
... ${value}:输入搜索的内容
... ${name}:输入name
... ${calue1}:输入内容
sleep 1
click id=sidebarProxy_CertificateManagement #点击二级目录Trusted Certificate Authorities
Sleep 2
click xpath=//*[@id="proxyTabs"]/div/ul/li[3] #点击SSL Decryption Exclusion按钮
sleep 1
click id=one-input #点击搜索框
sleep 1
click ${id-name} #选择搜索类型
sleep 1
input id=sreach_input ${value} #输入内容
sleep 1
click id=select_new_search_btn #点击搜索按钮
sleep 1
click xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr #点击搜索列表
Sleep 1
click id=ssl_edit #点击Edit
Sleep 1
Clear Element Text id=sslAdd_name #清空name输入框
sleep 1
input id=sslAdd_name ${name} #输入name
sleep 1
input id=sslAdd_itemDesc ${value1} #输入内容
Sleep 2
click id=ssl_ok #点击OK缇交
Sleep 2
input id=one-input ${name1} #搜索框输入
Sleep 1
click id=select_new_search_btn #点击搜索按钮
Sleep 1
${text1} Get Text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr/td[2]/div/div/div/p/span #获取点击后页面文本信息
Should Be Equal As Strings ${text1} ${name} #断言
Settings_swarch_name
[Arguments] ${name}
sleep 2
click element id=one-input
sleep 2
click element id=input_list_li2
sleep 2
input text id=sreach_input ${name}
sleep 2
click element id=select_new_search_btn
sleep 2
click element xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table
Create-Policy_Verify
[Arguments] ${name} ${list2}=null ${fail1}=null ${list4}=null ${list6}=null ${min1}=null
... ${max1}=null
Sleep 1
click id=children5 #点击一级目录Settings
Sleep 1
click id=sidebarProxy_Profiles #点击二级目录Proxy Profiles
sleep 2
click id=profilesTabs_Profile_DecryptionProfile #点击Decryption Profile
Sleep 1
click id=insertAdd #点击Create
Sleep 1
input id=insert_profileName ${name}
Sleep 1
@{list} Create List Common Name Issuer Self-signed Expiry Date Mutual Authentication
... On Protocol Errors Certificate Pinning Mirror Client Versions Allow HTTP/2
: FOR ${i} IN @{list}
\ click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div/div/label[contains(text(), "${i}")]/following-sibling::div/div/span
\ sleep 1
@{list1} Set Variable ${list2}
${fail} Set Variable ${fail1}
: FOR ${j} IN @{list1}
\ run keyword if "@{list1}"=="[]" Exit for loop
\ ... ELSE Run Keywords click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div/div/label[contains(text(), "${j}")]/following-sibling::div/div/span
\ ... AND sleep 1
run keyword if "${fail}"=="Fail-close" Run Keywords sleep 1
... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[3]/div[5]/div/div/label[1]/span
... ELSE IF "${fail}"=="Pass-through" Run Keywords sleep 1
... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[3]/div[5]/div/div/label[2]/span
... ELSE log 1111
@{list3} Set Variable ${list4}
: FOR ${k} IN @{list3}
\ run keyword if "@{list3}"=="[]" Exit for loop
\ ... ELSE Run Keywords click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div/div/label[contains(text(), "${k}")]/following-sibling::div/div/span
\ ... AND sleep 1
@{list5} Set Variable ${list6}
${min} Set Variable ${min1}
${max} Set Variable ${max1}
: FOR ${z} IN @{list5}
\ run keyword if "@{list5}"=="[]" Min_max_version ${min} ${max}
\ ... ELSE IF "${z}"=="Allow HTTP/2" Run Keywords sleep 1
\ ... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div/div/label[contains(text(), "${z}")]/following-sibling::div/div/span
\ ... ELSE IF "${z}"=="Mirror Client Versions" Run Keywords sleep 1
\ ... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div/div/label[contains(text(), "${z}")]/following-sibling::div/div/span
\ ... ELSE IF "${z}"!="Mirror Client Versions" and "${min}"=="TLSv1.0" Run Keywords sleep 1
\ ... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[7]/div[2]/div/div/div/span/span/i
\ ... AND sleep 1
\ ... AND click id=pro_min1
\ ... ELSE IF "${z}"!="Mirror Client Versions" and "${min}"=="TLSv1.1" Run Keywords sleep 1
\ ... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[7]/div[2]/div/div/div/span/span/i
\ ... AND sleep 1
\ ... AND click id=pro_min2
\ ... ELSE IF "${z}"!="Mirror Client Versions" and "${min}"=="TLSv1.2" Run Keywords sleep 1
\ ... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[7]/div[2]/div/div/div/span/span/i
\ ... AND sleep 1
\ ... AND click id=pro_min3
\ ... ELSE IF "${z}"!="Mirror Client Versions" and "${min}"=="TLSv1.3" Run Keywords sleep 1
\ ... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[7]/div[2]/div/div/div/span/span/i
\ ... AND sleep 1
\ ... AND click id=pro_min4
\ ... ELSE IF "${z}"!="Mirror Client Versions" and "${min}"=="SSLv3.0" Run Keywords sleep 1
\ ... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[7]/div[2]/div/div/div/span/span/i
\ ... AND sleep 1
\ ... AND click id=pro_max0
\ ... ELSE IF "${z}"!="Mirror Client Versions" and "${max}"=="TLSv1.0" Run Keywords sleep 1
\ ... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[7]/div[3]/div/div/div/span/span/i
\ ... AND sleep 1
\ ... AND click id=pro_max1
\ ... ELSE IF "${z}"!="Mirror Client Versions" and "${max}"=="TLSv1.1" Run Keywords sleep 1
\ ... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[7]/div[3]/div/div/div/span/span/i
\ ... AND sleep 1
\ ... AND click id=pro_max2
\ ... ELSE IF "${z}"!="Mirror Client Versions" and "${max}"=="TLSv1.2" Run Keywords sleep 1
\ ... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[7]/div[3]/div/div/div/span/span/i
\ ... AND sleep 1
\ ... AND click id=pro_max3
\ ... ELSE IF "${z}"!="Mirror Client Versions" and "${max}"=="TLSv1.3" Run Keywords sleep 1
\ ... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[7]/div[3]/div/div/div/span/span/i
\ ... AND sleep 1
\ ... AND click id=pro_max4
\ ... ELSE IF "${z}"!="Mirror Client Versions" and "${max}"=="SSLv3.0" Run Keywords sleep 1
\ ... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[7]/div[3]/div/div/div/span/span/i
\ ... AND sleep 1
\ ... AND click id=pro_max0
sleep 1
run keyword if "@{list5}"=="[]" Min_max_version ${min} ${max}
${class}= Get Element Attribute xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[3]/div[1]/div/div class
log ${class}
click id=insertAddOk1
Min_max_version
[Arguments] ${min} ${max}
run keyword if "${min}"=="TLSv1.0" Run Keywords sleep 1
... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[7]/div[2]/div/div/div/span/span/i
... AND sleep 1
... AND click id=pro_min1
... ELSE IF "${min}"=="TLSv1.1" Run Keywords sleep 1
... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[7]/div[2]/div/div/div/span/span/i
... AND sleep 1
... AND click id=pro_min2
... ELSE IF "${min}"=="TLSv1.2" Run Keywords sleep 1
... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[7]/div[2]/div/div/div/span/span/i
... AND sleep 1
... AND click id=pro_min3
... ELSE IF "${min}"=="TLSv1.3" Run Keywords sleep 1
... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[7]/div[2]/div/div/div/span/span/i
... AND sleep 1
... AND click id=pro_min4
... ELSE IF "${min}"=="SSLv3.0" Run Keywords sleep 1
... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[7]/div[2]/div/div/div/span/span/i
... AND sleep 1
... AND click id=pro_max0
... ELSE log 错误
run keyword if "${max}"=="TLSv1.0" Run Keywords sleep 1
... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[7]/div[3]/div/div/div/span/span/i
... AND sleep 1
... AND click id=pro_max1
... ELSE IF "${max}"=="TLSv1.1" Run Keywords sleep 1
... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[7]/div[3]/div/div/div/span/span/i
... AND sleep 1
... AND click id=pro_max2
... ELSE IF "${max}"=="TLSv1.2" Run Keywords sleep 1
... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[7]/div[3]/div/div/div/span/span/i
... AND sleep 1
... AND click id=pro_max3
... ELSE IF "${max}"=="TLSv1.3" Run Keywords sleep 1
... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[7]/div[3]/div/div/div/span/span/i
... AND sleep 1
... AND click id=pro_max4
... ELSE IF "${max}"=="SSLv3.0" Run Keywords sleep 1
... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[7]/div[3]/div/div/div/span/span/i
... AND sleep 1
... AND click id=pro_max0
... ELSE log 错误
Create-Decryption_Profile
[Arguments] ${name} ${dict1}=null ${fail1}=null ${min1}=null ${max1}=null
Sleep 1
click id=children5 #点击一级目录Settings
Sleep 1
click id=sidebarProxy_Profiles #点击二级目录Proxy Profiles
sleep 2
click id=profilesTabs_Profile_DecryptionProfile #点击Decryption Profile
Sleep 1
click id=insertAdd #点击Create
Sleep 1
input id=insert_profileName ${name}
Sleep 1
Button_Switch ${dict1} //*[@id="policy_Manipulation_create8"]/div[2]/form/div/div/label[contains(text(), " ")]/following-sibling::div/div el-switch is-checked el-switch
${fail} Set Variable ${fail1}
run keyword if "${fail}"=="Fail-close" Run Keywords sleep 1
... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[3]/div[5]/div/div/label[1]/span
... ELSE IF "${fail}"=="Pass-through" Run Keywords sleep 1
... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[3]/div[5]/div/div/label[2]/span
... ELSE log 1111
${min} Set Variable ${min1}
${max} Set Variable ${max1}
run keyword if "${min}"=="TLSv1.0" Run Keywords sleep 1
... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[7]/div[2]/div/div/div/span/span/i
... AND sleep 1
... AND click id=pro_min1
... ELSE IF "${min}"=="TLSv1.1" Run Keywords sleep 1
... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[7]/div[2]/div/div/div/span/span/i
... AND sleep 1
... AND click id=pro_min2
... ELSE IF "${min}"=="TLSv1.2" Run Keywords sleep 1
... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[7]/div[2]/div/div/div/span/span/i
... AND sleep 1
... AND click id=pro_min3
... ELSE IF "${min}"=="TLSv1.3" Run Keywords sleep 1
... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[7]/div[2]/div/div/div/span/span/i
... AND sleep 1
... AND click id=pro_min4
... ELSE IF "${min}"=="SSLv3.0" Run Keywords sleep 1
... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[7]/div[2]/div/div/div/span/span/i
... AND sleep 1
... AND click id=pro_min0
... ELSE log 错误
run keyword if "${max}"=="TLSv1.0" Run Keywords sleep 1
... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[7]/div[3]/div/div/div/span/span/i
... AND sleep 1
... AND click id=pro_max1
... ELSE IF "${max}"=="TLSv1.1" Run Keywords sleep 1
... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[7]/div[3]/div/div/div/span/span/i
... AND sleep 1
... AND click id=pro_max2
... ELSE IF "${max}"=="TLSv1.2" Run Keywords sleep 1
... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[7]/div[3]/div/div/div/span/span/i
... AND sleep 1
... AND click id=pro_max3
... ELSE IF "${max}"=="TLSv1.3" Run Keywords sleep 1
... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[7]/div[3]/div/div/div/span/span/i
... AND sleep 1
... AND click id=pro_max4
... ELSE IF "${max}"=="SSLv3.0" Run Keywords sleep 1
... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[7]/div[3]/div/div/div/span/span/i
... AND sleep 1
... AND click id=pro_max0
... ELSE log 错误
sleep 2
click id=decryption-ok
sleep 2
click id=one-input #点击搜索框
sleep 2
click id=input_list_li2 #选择搜索类型-name
sleep 1
input id=sreach_input ${name} #输入内容
sleep 1
click id=select_new_search_btn #点击搜索按钮
sleep 2
${name1} get text xpath=//*[@id="app"]/div/div[3]/div/div/div[3]/div[2]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Should Be Equal As Strings ${name1} ${name}
Button_Switch
[Arguments] ${dict1} ${xpath1} ${xpath2} ${open} ${close}
${dict} Set Variable ${dict1}
: FOR ${list} ${key} IN ENUMERATE @{dict}
\ ${class}= Get Element Attribute xpath=${xpath1}${key}${xpath2} class
\ run keyword if "${class}"=="${open}" and "${dict}[${key}]"=="1" log 默认开启,不进行操作
\ run keyword if "${class}"=="${open}" and "${dict}[${key}]"=="0" Run Keywords log 默认开启,但需求需要关闭,进行点击关闭按钮
\ ... AND sleep 1
\ ... AND click xpath=${xpath1}${key}${xpath2}/span
\ run keyword if "${class}"=="${close}" and "${dict}[${key}]"=="1" Run Keywords log 默认关闭,但需求需要开启,进行点击开启按钮
\ ... AND sleep 1
\ ... AND click xpath=${xpath1}${key}${xpath2}/span
\ run keyword if "${class}"=="${close}" and "${dict}[${key}]"=="0" log 默认关闭,不进行操作
Edit_Decryption Profile
[Arguments] ${id-name} ${value} ${name} ${dict1}=null ${fail1}=null ${min1}=null
... ${max1}=null
click id=sidebarProxy_Profiles #点击二级目录Proxy Profiles
sleep 2
click id=profilesTabs_Profile_DecryptionProfile #点击Decryption Profile
Sleep 1
click id=one-input #点击搜索框
sleep 1
click ${id-name} #选择搜索类型
sleep 1
input id=sreach_input ${value} #输入内容
sleep 1
click id=select_new_search_btn #点击搜索按钮
sleep 1
click xpath=//*[@id="app"]/div/div[3]/div/div/div[3]/div[2]/div/div[3]/table/tbody/tr #点击搜索列表
Sleep 1
click id=insertEdit #点击Edit
Sleep 2
Clear Element Text id=insert_profileName #清空name输入框
sleep 1
input id=insert_profileName ${name} #输入name
sleep 1
Button_Switch ${dict1} //*[@id="policy_Manipulation_create8"]/div[2]/form/div/div/label[contains(text(), " ")]/following-sibling::div/div el-switch is-checked el-switch
${fail} Set Variable ${fail1}
run keyword if "${fail}"=="Fail-close" Run Keywords sleep 1
... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[6]/div[5]/div/div/label[1]/span
... ELSE IF "${fail}"=="Pass-through" Run Keywords sleep 1
... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[6]/div[5]/div/div/label[2]/span
... ELSE log 1111
${min} Set Variable ${min1}
${max} Set Variable ${max1}
run keyword if "${min}"=="TLSv1.0" Run Keywords sleep 1
... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[10]/div[2]/div/div/div/span/span/i
... AND sleep 1
... AND click id=pro_min1
... ELSE IF "${min}"=="TLSv1.1" Run Keywords sleep 1
... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[10]/div[2]/div/div/div/span/span/i
... AND sleep 1
... AND click id=pro_min2
... ELSE IF "${min}"=="TLSv1.2" Run Keywords sleep 1
... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[10]/div[2]/div/div/div/span/span/i
... AND sleep 1
... AND click id=pro_min3
... ELSE IF "${min}"=="TLSv1.3" Run Keywords sleep 1
... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[10]/div[2]/div/div/div/span/span/i
... AND sleep 1
... AND click id=pro_min4
... ELSE IF "${min}"=="SSLv3.0" Run Keywords sleep 1
... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[10]/div[2]/div/div/div/span/span/i
... AND sleep 1
... AND click id=pro_min0
... ELSE log 错误
run keyword if "${max}"=="TLSv1.0" Run Keywords sleep 1
... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[10]/div[3]/div/div/div[1]/span/span/i
... AND sleep 1
... AND click id=pro_max1
... ELSE IF "${max}"=="TLSv1.1" Run Keywords sleep 1
... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[10]/div[3]/div/div/div/span/span/i
... AND sleep 1
... AND click id=pro_max2
... ELSE IF "${max}"=="TLSv1.2" Run Keywords sleep 1
... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[10]/div[3]/div/div/div/span/span/i
... AND sleep 1
... AND click id=pro_max3
... ELSE IF "${max}"=="TLSv1.3" Run Keywords sleep 1
... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[10]/div[3]/div/div/div/span/span/i
... AND sleep 1
... AND click id=pro_max4
... ELSE IF "${max}"=="SSLv3.0" Run Keywords sleep 1
... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[10]/div[3]/div/div/div/span/span/i
... AND sleep 1
... AND click id=pro_max0
... ELSE log 错误
click id=decryption-ok
sleep 2
click id=one-input #点击搜索框
sleep 1
click id=input_list_li2 #选择搜索类型-name
sleep 1
input id=sreach_input ${name} #输入内容
sleep 1
click id=select_new_search_btn #点击搜索按钮
${name1} get text xpath=//*[@id="app"]/div/div[3]/div/div/div[3]/div[2]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Should Be Equal As Strings ${name1} ${name}
sleep 1
click xpath=//*[@id="app"]/div/div[3]/div/div/div[3]/div[2]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/span
Delete
Delete
sleep 2
click id=insertDel
sleep 3
click xpath=/html/body/div/div/div[3]/button[2]
sleep 2
Policy_Verify
[Arguments] ${Select-Test1} ${APP-ID1} ${Address-type1}=null ${Client-IP1}=null ${Client-Port1}=null ${Server-IP1}=null
... ${Server-Port1}=null ${Protocol1}=null ${Subscriber-ID1}=null ${dict1}=null
Sleep 1
click id=children5 #点击一级目录Settings
Sleep 1
click id=sidebarTrouble_shooting #点击二级目录Trouble Shooting
Sleep 2
click id=Proxy_Profiles_Profile_ResponsePages #点击Policy Verify按钮
Sleep 1
${Select-Test} Set Variable ${Select-Test1}
Run Keyword If "${Select-Test}"=="Security Policy Match" Run Keywords click id=SelectPolicy
... AND sleep 1
... AND click id=SelectPolicytsg_security0
... ELSE IF "${Select-Test}"=="Proxy Policy Match" Run Keywords click id=SelectPolicy
... AND sleep 1
... AND click id=SelectPolicypxy_manipulation1
... ELSE log 错误
${Address-type} Set Variable ${Address-type1}
Run Keyword If "${Address-type}"=="v4" Run Keywords click id=ip_addrType
... AND sleep 1
... AND click id=ip_addrType1
... ELSE IF "${Address-type}"=="v6" Run Keywords click id=ip_addrType
... AND sleep 1
... AND click id=ip_addrType2
... ELSE log 错误
${Client-IP} Set Variable ${Client-IP1}
Run Keyword If "${Client-IP}"=="null" log 默认参数,不输入
... ELSE input id=clientIp ${Client-IP}
sleep 2
${Client-Port} Set Variable ${Client-Port1}
Run Keyword If "${Client-Port}"=="null" log 默认参数,不输入
... ELSE input id=clientPort ${Client-Port}
sleep 2
${Server-IP} Set Variable ${Server-IP1}
Run Keyword If "${Server-IP}"=="null" log 默认参数,不输入
... ELSE input id=serverIp ${Server-IP}
sleep 2
${Server-Port} Set Variable ${Server-Port1}
Run Keyword If "${Server-Port}"=="null" log 默认参数,不输入
... ELSE input id=ip_serverPort ${Server-Port}
sleep 2
${Protocol} Set Variable ${Protocol1}
Run Keyword If "${Protocol}"=="Any" Run Keywords click id=ip_protocol
... AND sleep 1
... AND click id=ip_protocol0Any
... ELSE IF "${Protocol}"=="TCP" Run Keywords click id=ip_protocol
... AND sleep 1
... AND click id=ip_protocol6TCP
... ELSE IF "${Protocol}"=="UDP" Run Keywords click id=ip_protocol
... AND sleep 1
... AND click id=ip_protocol17UDP
sleep 2
${Subscriber-ID} Set Variable ${Subscriber-ID1}
Run Keyword If "${Subscriber-ID}"=="null" log 默认参数,不输入
... ELSE input id=SubscriberID ${Subscriber-ID}
sleep 2
${APP-ID} Set Variable ${APP-ID1}
Run Keyword If "${Select-Test}"=="Security Policy Match" and "${APP-ID}"=="Protocol-HTTP" Run Keywords click id=protocol
... AND sleep 2
... AND log $$$$$$1111111
... AND click id=Protocol-HTTPhttp
... AND sleep 2
... ELSE IF "${Select-Test}"=="Security Policy Match" and "${APP-ID}"=="Protocol-SSL" Run Keywords click id=protocol
... AND sleep 2
... AND click id=Protocol-SSLssl
... ELSE IF "${Select-Test}"=="Security Policy Match" and "${APP-ID}"=="Protocol-DNS" Run Keywords click id=protocol
... AND sleep 2
... AND click id=Protocol-DNSdns
... ELSE IF "${Select-Test}"=="Security Policy Match" and "${APP-ID}"=="Protocol-MAIL" Run Keywords click id=protocol
... AND sleep 2
... AND click id=Protocol-MAILmail
... ELSE IF "${Select-Test}"=="Security Policy Match" and "${APP-ID}"=="Protocol-FTP" Run Keywords click id=protocol
... AND sleep 2
... AND click id=Protocol-FTPftp
... ELSE IF "${Select-Test}"=="Proxy Policy Match" and "${APP-ID}"=="Protocol-HTTP" Run Keywords click id=protocol
... AND sleep 2
... AND click id=Protocol-HTTPhttp
... ELSE IF "${Select-Test}"=="Proxy Policy Match" and "${APP-ID}"=="Protocol-DoH" Run Keywords click id=protocol
... AND sleep 2
... AND click id=Protocol-DoHDoH
... ELSE log 传入参数错误
${dict} Set Variable ${dict1}
: FOR ${list} ${key} IN ENUMERATE @{dict}
\ run keyword if "${key}"=="URL" and "${APP-ID}"=="Protocol-HTTP" Run Keywords click id=selectAppidBTN
\ ... AND sleep 1
\ ... AND click id=attributeName
\ ... AND sleep 2
\ ... AND click id=attributeNameurlURL
\ ... AND sleep 1
\ ... AND input id=attributeValue_string ${dict}[${key}]
\ ... AND sleep 1
\ run keyword if "${key}"=="Host" and "${APP-ID}"=="Protocol-HTTP" Run Keywords click id=selectAppidBTN
\ ... AND sleep 1
\ ... AND click id=attributeName
\ ... AND sleep 2
\ ... AND click id=attributeNamehostHost
\ ... AND sleep 1
\ ... AND input id=attributeValue_string ${dict}[${key}]
\ ... AND sleep 1
\ run keyword if "${key}"=="REQ Body" Run Keywords click id=selectAppidBTN
\ ... AND sleep 1
\ ... AND click id=attributeName
\ ... AND sleep 1
\ ... AND click id=attributeNamereq_bodyREQ Body
\ ... AND sleep 1
\ ... AND input id=attributeValue_string ${dict}[${key}]
\ ... AND sleep 1
\ run keyword if "${key}"=="RES Body" Run Keywords click id=selectAppidBTN
\ ... AND sleep 1
\ ... AND click id=attributeName
\ ... AND sleep 1
\ ... AND click id=attributeNameres_bodyRES Body
\ ... AND sleep 1
\ ... AND input id=attributeValue_string ${dict}[${key}]
\ ... AND sleep 1
\ run keyword if "${key}"=="REQ HDR" Run Keywords click id=selectAppidBTN
\ ... AND sleep 1
\ ... AND click id=attributeName
\ ... AND sleep 1
\ ... AND click id=attributeNamereq_hdrREQ HDR
\ ... AND sleep 1
\ ... AND Req_Res_Body ${dict}[${key}]
\ ... AND sleep 1
\ run keyword if "${key}"=="RES HDR" Run Keywords click id=selectAppidBTN
\ ... AND sleep 1
\ ... AND click id=attributeName
\ ... AND sleep 1
\ ... AND click id=attributeNameres_hdrRES HDR
\ ... AND sleep 1
\ ... AND Req_Res_Body ${dict}[${key}]
\ ... AND sleep 1
\ run keyword if "${key}"=="SNI" Run Keywords click id=selectAppidBTN
\ ... AND sleep 1
\ ... AND click id=attributeName
\ ... AND sleep 1
\ ... AND click id=attributeNamesniSNI
\ ... AND sleep 1
\ ... AND input id=attributeValue_string ${dict}[${key}]
\ ... AND sleep 1
\ run keyword if "${key}"=="SAN" Run Keywords click id=selectAppidBTN
\ ... AND sleep 1
\ ... AND click id=attributeName
\ ... AND sleep 1
\ ... AND click id=attributeNamesanSAN
\ ... AND sleep 1
\ ... AND input id=attributeValue_string ${dict}[${key}]
\ ... AND sleep 1
\ run keyword if "${key}"=="CN" Run Keywords click id=selectAppidBTN
\ ... AND sleep 1
\ ... AND click id=attributeName
\ ... AND sleep 1
\ ... AND click id=attributeNamecnCN
\ ... AND sleep 1
\ ... AND input id=attributeValue_string ${dict}[${key}]
\ ... AND sleep 1
\ run keyword if "${key}"=="QNAME" and "${APP-ID}"=="Protocol-DNS" Run Keywords click id=selectAppidBTN
\ ... AND sleep 1
\ ... AND click id=attributeName
\ ... AND sleep 1
\ ... AND click id=attributeNameqnameQNAME
\ ... AND sleep 1
\ ... AND input id=attributeValue_string ${dict}[${key}]
\ ... AND sleep 1
\ run keyword if "${key}"=="From" Run Keywords click id=selectAppidBTN
\ ... AND sleep 1
\ ... AND click id=attributeName
\ ... AND sleep 1
\ ... AND click id=attributeNamefromFrom
\ ... AND sleep 1
\ ... AND input id=attributeValue_string ${dict}[${key}]
\ ... AND sleep 1
\ run keyword if "${key}"=="To" Run Keywords click id=selectAppidBTN
\ ... AND sleep 1
\ ... AND click id=attributeName
\ ... AND sleep 1
\ ... AND click id=attributeNametoTo
\ ... AND sleep 1
\ ... AND input id=attributeValue_string ${dict}[${key}]
\ ... AND sleep 1
\ run keyword if "${key}"=="Account" and "${APP-ID}"=="Protocol-MAIL" Run Keywords click id=selectAppidBTN
\ ... AND sleep 1
\ ... AND click id=attributeName
\ ... AND sleep 1
\ ... AND click id=attributeNameaccountAccount
\ ... AND sleep 1
\ ... AND input id=attributeValue_string ${dict}[${key}]
\ ... AND sleep 1
\ run keyword if "${key}"=="Subject" Run Keywords click id=selectAppidBTN
\ ... AND sleep 1
\ ... AND click id=attributeName
\ ... AND sleep 1
\ ... AND click id=attributeNamesubjectSubject
\ ... AND sleep 1
\ ... AND input id=attributeValue_string ${dict}[${key}]
\ ... AND sleep 1
\ run keyword if "${key}"=="Content" and "${APP-ID}"=="Protocol-MAIL" Run Keywords click id=selectAppidBTN
\ ... AND sleep 1
\ ... AND click id=attributeName
\ ... AND sleep 1
\ ... AND click id=attributeNamecontentContent
\ ... AND sleep 1
\ ... AND input id=attributeValue_string ${dict}[${key}]
\ ... AND sleep 1
\ run keyword if "${key}"=="ATT Name" Run Keywords click id=selectAppidBTN
\ ... AND sleep 1
\ ... AND click id=attributeName
\ ... AND sleep 1
\ ... AND click id=attributeNameatt_nameATT Name
\ ... AND sleep 1
\ ... AND input id=attributeValue_string ${dict}[${key}]
\ ... AND sleep 1
\ run keyword if "${key}"=="ATT CONT" Run Keywords click id=selectAppidBTN
\ ... AND sleep 1
\ ... AND click id=attributeName
\ ... AND sleep 1
\ ... AND click id=attributeNameatt_contentATT CONT
\ ... AND sleep 1
\ ... AND input id=attributeValue_string ${dict}[${key}]
\ ... AND sleep 1
\ run keyword if "${key}"=="URL" and "${APP-ID}"=="Protocol-FTP" Run Keywords click id=selectAppidBTN
\ ... AND sleep 1
\ ... AND click id=attributeName
\ ... AND sleep 1
\ ... AND click id=attributeNameurlURL
\ ... AND sleep 1
\ ... AND input id=attributeValue_string ${dict}[${key}]
\ ... AND sleep 1
\ run keyword if "${key}"=="Content" and "${APP-ID}"=="Protocol-FTP" Run Keywords click id=selectAppidBTN
\ ... AND sleep 1
\ ... AND click id=attributeName
\ ... AND sleep 1
\ ... AND click id=attributeNamecontentContent
\ ... AND sleep 1
\ ... AND input id=attributeValue_string ${dict}[${key}]
\ ... AND sleep 1
\ run keyword if "${key}"=="Account" and "${APP-ID}"=="Protocol-FTP" Run Keywords click id=selectAppidBTN
\ ... AND sleep 1
\ ... AND click id=attributeName
\ ... AND sleep 1
\ ... AND click id=attributeNameaccountAccount
\ ... AND sleep 1
\ ... AND input id=attributeValue_string ${dict}[${key}]
\ ... AND sleep 1
\ run keyword if "${key}"=="QNAME" and "${APP-ID}"=="Protocol-DoH" Run Keywords click id=selectAppidBTN
\ ... AND sleep 1
\ ... AND click id=attributeName
\ ... AND sleep 1
\ ... AND click id=attributeNameqnameQNAME
\ ... AND sleep 1
\ ... AND input id=attributeValue_string ${dict}[${key}]
\ ... AND sleep 1
\ run keyword if "${key}"=="Host" and "${APP-ID}"=="Protocol-DoH" Run Keywords click id=selectAppidBTN
\ ... AND sleep 1
\ ... AND click id=attributeName
\ ... AND sleep 1
\ ... AND click id=attributeNamehostHost
\ ... AND sleep 1
\ ... AND input id=attributeValue_string ${dict}[${key}]
\ ... AND sleep 1
sleep 2
click id=verify-ok
sleep 2
${State} get text xpath=//*[@id="app"]/div/div[3]/div/div/div[3]/div[1]/div[2]/div/div[2]/div[2]/ul/li[2]/span[3]
sleep 2
Should Be Equal As Strings ${State} Execute #断言
Req_Res_Body
[Arguments] ${dict1}
${dict} Set Variable ${dict1}
: FOR ${list} ${key} IN ENUMERATE @{dict}
\ run keyword if "${key}"=="User Agent" Run Keywords click id=attributeValue_district
\ ... AND sleep 1
\ ... AND click id=attributeValue_districtUser-AgentUser Agent
\ ... AND sleep 1
\ ... AND input id=attributeValue_string ${dict}[${key}]
\ run keyword if "${key}"=="Cookie" Run Keywords click id=attributeValue_district
\ ... AND sleep 1
\ ... AND click id=attributeValue_districtCookieCookie
\ ... AND sleep 1
\ ... AND input id=attributeValue_string ${dict}[${key}]
\ run keyword if "${key}"=="Set-Cookie" Run Keywords click id=attributeValue_district
\ ... AND sleep 1
\ ... AND click id=attributeValue_districtSet-CookieSet-Cookie
\ ... AND sleep 1
\ ... AND input id=attributeValue_string ${dict}[${key}]
\ run keyword if "${key}"=="Content-Type" Run Keywords click id=attributeValue_district
\ ... AND sleep 1
\ ... AND click id=attributeValue_districtContent-TypeContent-Type
\ ... AND sleep 1
\ ... AND input id=attributeValue_string ${dict}[${key}]
Create_Ip_Libraries
[Arguments] ${type} ${Continent/Country} ${GeoNameID} ${City} ${ip} ${j}=1 ${Country}=null ${Longitude}=null ${Latitude}=null
Sleep 1
click id=children5 #点击一级目录Settings
Sleep 1
click id=sidebarIP_Libraries #点击二级目录IP_Libraries
Sleep 2
click id=tagAdd #点击Create按钮
sleep 2
run keyword if "${type}"=="Country" Run Keywords click id=security_action_country
... AND sleep 1
... AND click id=ip_geography_continent
... AND sleep 1
... AND Switch_Geographic_Locations ${Continent/Country}
... AND input id=ip_geography_Country1 ${Country}
run keyword if "${type}"=="City" Run Keywords click id=security_action_city
... AND sleep 1
... AND click id=ip_geography_Country
... AND sleep 1
... AND Switch_Geographic_Locations ${Continent/Country}
sleep 1
input id=ip_geography_name ${GeoNameID}
sleep 1
input id=ip_geography_City ${City}
sleep 1
click id=ip_geography_IPRange
sleep 1
input id=ip_input0 ${ip}[0]
sleep 1
run keyword if "${j}"!="1" Ip_Range_Create ${j} ${ip}
run keyword if "${Longitude}"!="null" Run Keywords input id=ip_geography_longitude ${Longitude}
... AND sleep 1
run keyword if "${Latitude}"!="null" Run Keywords input id=ip_geography_latitude ${Latitude}
... AND sleep 1
click id=IP_library_add
sleep 2
#验证新建是否成功
Switch_GeoName ${GeoNameID}
${GeoNameText} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr/td[1]/div/div/div
sleep 2
Should Be Equal As Strings ${GeoNameText} ${GeoNameID} #断言
Edit_Ip_Libraries
[Arguments] ${GeoNameID} ${City}=null ${ip}=null ${j}=1 ${Country}=null ${Longitude}=null ${Latitude}=null ${type}=null ${type1}=null
click id=tagEdit #点击Edit按钮
sleep 2
run keyword if "${City}"!="null" input id=ip_geography_City ${City}
sleep 1
run keyword if "${type}"=="edit" Run Keywords click xpath=//*[@id="app"]/div/div[3]/div/div/div[2]/div[1]/div[2]/form/div[3]/div/div[2]/div[2]/ul/li/div[2]/i[1]
... AND sleep 1
... AND clear element text xpath=//*[@id="app"]/div/div[3]/div/div/div[2]/div[1]/div[2]/form/div[3]/div/div[2]/div[2]/ul/li/div[1]/form/div/div/div
... AND sleep 1
... AND input id=ip_input0 ${ip}[0]
... AND sleep 1
run keyword if "${type}"=="create" Ip_Range_Edit_Create ${j} ${ip}
sleep 1
run keyword if "${type}"=="delete" and "${type1}"=="create" Run Keywords click xpath=//*[@id="app"]/div/div[3]/div/div/div[2]/div[1]/div[2]/form/div[3]/div/div[2]/div[2]/ul/li/div[2]/i[2]
... AND sleep 1
... AND Ip_Range_Edit_Create ${j} ${ip}
run keyword if "${type}"=="null" log 不做更改
run keyword if "${Longitude}"!="null" Run Keywords input id=ip_geography_longitude ${Longitude}
... AND sleep 1
run keyword if "${Latitude}"!="null" Run Keywords input id=ip_geography_latitude ${Latitude}
... AND sleep 1
click id=IP_library_add
sleep 2
#验证修改是否成功
Switch_GeoName ${GeoNameID}
${GeoNameText} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr/td[1]/div/div/div
sleep 2
Should Be Equal As Strings ${GeoNameText} ${GeoNameID} #断言
Switch_Geographic_Locations
[Arguments] ${Continent/Country}
sleep 1
input id=objectName_seach ${Continent/Country}
sleep 1
press keys id=objectName_seach ENTER
sleep 2
click xpath=//*[@id="right_locationList"]/div[2]/div[1]/div[2]/div/div
sleep 1
click id=interceptionadd_allcancelobject
sleep 1
Ip_Range_Create
[Arguments] ${j} ${ip}
sleep 1
: FOR ${i} IN RANGE 1 ${j}
\ sleep 1
\ click id=addIPList
\ sleep 1
\ input id=ip_input${i} ${ip}[${i}]
\ sleep 1
Ip_Range_Edit_Create
[Arguments] ${j} ${ip}
sleep 1
: FOR ${i} IN RANGE ${j}
\ sleep 1
\ click id=addIPList
\ sleep 1
\ input id=ip_input${i} ${ip}[${i}]
\ sleep 1
sleep 1
Switch_GeoName
[Arguments] ${GeoName}
sleep 2
click id=clear_input_btm
sleep 1
input id=one-input ${GeoName}
sleep 1
click id=select_new_search_btn
sleep 1
click xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr/td[1]/div/div/div
sleep 1
Delete_IP_Libraries
[Arguments] ${GeoName}
Switch_GeoName ${GeoName}
sleep 2
click id=tagDel
sleep 2
click xpath=/html/body/div/div/div[3]/button[2]
sleep 2
Switch_GeoName1
[Arguments] ${GeoName}
sleep 2
click id=clear_input_btm
sleep 1
click id=one-input
sleep 1
click id=input_list_li1
sleep 1
input id=sreach_input ${GeoName}
sleep 1
click id=select_new_search_btn
sleep 1
click xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr/td[1]/div/div/div
sleep 1
${GeoNameText} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr/td[1]/div/div/div
sleep 2
Should Be Equal As Strings ${GeoNameText} ${GeoName} #断言
Switch_Country
[Arguments] ${Country}
sleep 2
click id=clear_input_btm
sleep 1
click id=one-input
sleep 1
click id=input_list_li2
sleep 1
input id=sreach_input ${Country}
sleep 1
click id=select_new_search_btn
sleep 1
click xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr/td[1]/div/div/div
sleep 1
${CountryText} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[3]/div/div/div
sleep 2
Should Match ${CountryText} ${Country} #断言
Switch_City
[Arguments] ${City}
sleep 2
click id=clear_input_btm
sleep 1
click id=one-input
sleep 1
click id=input_list_li3
sleep 1
input id=sreach_input ${City}
sleep 1
click id=select_new_search_btn
sleep 1
click xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr/td[1]/div/div/div
sleep 1
${CCityText} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[4]/div/div/div
sleep 2
Should Match ${CityText} ${City} #断言
Pages
[Arguments]
Sleep 1
click id=children5 #点击一级目录Settings
Sleep 1
click id=sidebarIP_Libraries #点击二级目录IP_Libraries
Sleep 2
Ui-Pages
[Arguments] ${pages}
click element xpath=//*[@id="app"]/div/div[3]/div/div/div[3]/div[4]/div/ul/li[1]
sleep 2
click element xpath=//*[@id="app"]/div/div[3]/div/div/div[3]/div[4]/div/button[2]/i
sleep 2
Clear Element Text xpath=//*[@id="app"]/div/div[3]/div/div/div[3]/div[4]/div/span[2]/div/input
sleep 2
input text xpath=//*[@id="app"]/div/div[3]/div/div/div[3]/div[4]/div/span[2]/div/input ${pages}
sleep 2
press keys xpath=//*[@id="app"]/div/div[3]/div/div/div[3]/div[4]/div/span[2]/div/input ENTER
sleep 2
ALL
[Arguments]
click element xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr/td[5]/div/div/div/div/div[2]/div[7]
sleep 2
click element xpath=//*[@id="policy_IP_library1"]/div/p/i
sleep 2
DeleteKeyrings_del
sleep 2
click id=Keyrings_del
sleep 2
click xpath=/html/body/div/div/div[3]/button[2]
sleep 2
DeletehijackDel
sleep 2
click id=hijackDel
sleep 2
click xpath=/html/body/div/div/div[3]/button[2]
sleep 2
DeleteresinseDel
sleep 2
click id=resinseDel
sleep 2
click xpath=/html/body/div/div/div[3]/button[2]
sleep 2
Deletessl_del
sleep 2
click id=ssl_del
sleep 2
click xpath=/html/body/div/div/div[3]/button[2]
sleep 2
DeletetrafficMirrorDel
sleep 2
click id=trafficMirrorDel
sleep 2
click xpath=/html/body/div/div/div[3]/button[2]
sleep 2
DeleteAuthorities_del
sleep 2
click id=Authorities_del
sleep 2
click xpath=/html/body/div/div/div[3]/button[2]
sleep 2