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/proxyPolicy/ProxyPolicy.robot
2021-02-20 15:05:32 +08:00

558 lines
32 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
Resource ../objects/NewObject.robot
*** Keywords ***
CreateButton
[Documentation] 点击安全策略中的Create按钮
Wait Until Element Is Enabled id=app_create
sleep ${sleep}
click element id=app_create
Create-name
[Arguments] ${name}
[Documentation] 输入name
sleep ${sleep}
input text id=manipulation_elInput_policyName ${name}
Create-action
[Arguments] ${action}
[Documentation] 调用次关键字前需要添加必填参数:
... ${action}:填入allow或deny或monitor或intercept
... 判断要创建什么动作的策略
sleep ${sleep}
run keyword if "${action}"=="allow" run keywords sleep ${sleep}
... AND click element id=proxyManipulationallow
... ELSE IF "${action}"=="deny" run keywords sleep ${sleep}
... AND click element id=proxyManipulationdeny
... ELSE IF "${action}"=="monitor" run keywords sleep ${sleep}
... AND click element id=proxyManipulationmonitor
... ELSE IF "${action}"=="redirect" run keywords sleep ${sleep}
... AND click element id=proxyManipulationredirect
... ELSE IF "${action}"=="replace" run keywords sleep ${sleep}
... AND click element id=proxyManipulationreplace
... ELSE IF "${action}"=="hijack" run keywords sleep ${sleep}
... AND click element id=proxyManipulationhijack
... ELSE IF "${action}"=="insert" run keywords sleep ${sleep}
... AND click element id=proxyManipulationinsert
Create-Source-Button
[Documentation] 点击Source的加号
sleep ${sleep}
click element xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[4]/div[1]/div/div
Create-Destination-Button
[Documentation] 点击Destination的加号
Wait Until Element Is Enabled xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[5]/div[1]/div/div 10
sleep ${sleep}
click element xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[5]/div[1]/div/div
ApplicationSearch
[Arguments] ${Application} ${HttpOrDoh}
[Documentation] 调用次关键字前需要添加必填参数:
... ${Application}:填入是Application的内容例如SSL或HTTP
... 选择search对象
run keyword if "${Application}"=="redirect" run keywords sleep ${sleep}
... AND click element id=interceptionadd_application
... AND sleep ${sleep}
... AND HttpOrDoh ${HttpOrDoh}
... ELSE log 不操作
HttpOrDoh
[Arguments] ${HttpOrDoh}
[Documentation] 调用次关键字前需要添加必填参数:
... ${HttpOrDoh}:填入是Application的内容例如SSL或HTTP
... 选择search对象
run keyword if "${HttpOrDoh}"=="HTTP" run keywords sleep ${sleep}
... AND click element id=interceptionadd_checkappshow1
... AND sleep ${sleep}
... AND click element xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[7]/div[3]/div/button
... ELSE IF "${HttpOrDoh}"=="Doh" run keywords sleep ${sleep}
... AND click element id=interceptionadd_checkappshow0
... AND sleep ${sleep}
... AND click element xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[7]/div[3]/div/button
Create-Filter
[Arguments] ${Application}=null ${Filter}=null ${Hostname}=null ${URLname}=null ${Request Headername}=null ${Response Headername}=null ${Request Contentname}=null
... ${Response Contentname}=null ${QNAMEname}=null ${DohHostname}=null
[Documentation] 调用次关键字前需要添加必填参数:
... ${Application}:填入是Application的内容例如SSL或HTTP
... ${Filter}:是一个列表列表中填入filter类型例如Host或URL等
... name:各个对象名称的列表
... 判断添加filter类型 xpath=//*[@id="policy_paper_left"]/div[8]/div/div[1]/label[contains(text(), "${filter}")]/following-sibling::div/div //*[@id="interceptionadd_checkappshow0"][contains(text(), "${filter}")]
sleep ${sleep}
FOR ${i} IN @{Filter}
sleep ${sleep}
click element id=interceptionadd_add_filter
sleep ${sleep}
run keyword if "${Application}"=="HTTP" and "${i}"=="Host" run keywords sleep ${sleep}
... AND click element xpath=//*[@id="interceptionadd_checkappshow0"][contains(text(), "${i}")]
... AND Create-Object-Search ${Hostname} ${i}
run keyword if "${Application}"=="HTTP" and "${i}"=="URL" run keywords sleep ${sleep}
... AND click element xpath=//*[@id="interceptionadd_checkappshow1"][contains(text(), "${i}")]
... AND Create-Object-Search ${URLname} ${i}
run keyword if "${Application}"=="HTTP" and "${i}"=="Request Header" run keywords sleep ${sleep}
... AND click element xpath=//*[@id="interceptionadd_checkappshow2"][contains(text(), "${i}")]
... AND Create-Object-Search ${Request Headername} ${i}
run keyword if "${Application}"=="HTTP" and "${i}"=="Response Header" run keywords sleep ${sleep}
... AND click element xpath=//*[@id="interceptionadd_checkappshow3"][contains(text(), "${i}")]
... AND Create-Object-Search ${Response Headername} ${i}
run keyword if "${Application}"=="HTTP" and "${i}"=="Request Content" run keywords sleep ${sleep}
... AND click element xpath=//*[@id="interceptionadd_checkappshow4"][contains(text(), "${i}")]
... AND Create-Object-Search ${Request Contentname} ${i}
run keyword if "${Application}"=="HTTP" and "${i}"=="Response Content" run keywords sleep ${sleep}
... AND click element xpath=//*[@id="interceptionadd_checkappshow5"][contains(text(), "${i}")]
... AND Create-Object-Search ${Response Contentname} ${i}
run keyword if "${Application}"=="Doh" and "${i}"=="Host" run keywords sleep ${sleep}
... AND click element xpath=//*[@id="interceptionadd_checkappshow0"][contains(text(), "${i}")]
... AND Create-Object-Search ${DohHostname} ${i}
run keyword if "${Application}"=="Doh" and "${i}"=="QNAME" run keywords sleep ${sleep}
... AND click element xpath=//*[@id="interceptionadd_checkappshow1"][contains(text(), "${i}")]
... AND Create-Object-Search ${QNAMEname} ${i}
END
Deny-subaction
[Arguments] ${action} ${denycode}
[Documentation] 调用次关键字前需要添加必填参数:
... ${denycode}:填入403或404或451
... ${action}:填入deny
... 添加subaction
run keyword if "${action}"=="deny" and "${denycode}"=="403" run keywords sleep ${sleep}
... AND click element id=manipulation_select_addAction
... AND sleep ${sleep}
... AND click element //span[.="${denycode}"]
... AND sleep ${sleep}
run keyword if "${action}"=="deny" and "${denycode}"=="404" run keywords sleep ${sleep}
... AND click element id=manipulation_select_addAction
... AND sleep ${sleep}
... AND click element //span[.="${denycode}"]
... AND sleep ${sleep}
run keyword if "${action}"=="deny" and "${denycode}"=="451" run keywords sleep ${sleep}
... AND click element id=manipulation_select_addAction
... AND sleep ${sleep}
... AND click element //span[.="${denycode}"]
... AND sleep ${sleep}
... AND
Deny-content
[Arguments] ${contenttype}=File ${SearchorCreate}=null ${ProfileName}=null ${file}=null ${textvalue}=null
[Documentation] 调用次关键字前需要添加必填参数:
... ${code}:填入403或404
... ${Content}:填入TEXT或Profile
... ${SearchorCreate}:填入Search或Create
... ${block-text}:填入TEXT文本框内容
... ${ProfileName}:Profile的名字
... ${file}:上传文件路径
... ${textvalue}:填入text输入框内容
... 添加block数据内容
sleep ${sleep}
run keyword if "${contenttype}"=="File" run keywords sleep ${sleep}
... AND click element id=manipulation_select_blockInfo
... AND sleep ${sleep}
... AND click element id=ResponseContentFile
... AND sleep ${sleep}
... AND click element id=manipulation_select_htmlProfile
... AND sleep ${sleep}
... AND Profile-SearchorCreate ${SearchorCreate} ${ProfileName} ${file}
run keyword if "${contenttype}"=="Text" run keywords sleep ${sleep}
... AND click element id=manipulation_select_blockInfo
... AND sleep ${sleep}
... AND click ellement id=ResponseContentText
... AND sllep 1
... AND input text id=manipulation_elInput_blockselect ${textvalue}
... AND sleep ${sleep}
Profile-SearchorCreate
[Arguments] ${SearchorCreate} ${ProfileName} ${file}
[Documentation] 调用次关键字前需要添加必填参数:
... ${SearchorCreate}:填入Search或Create
... ${ProfileName}:Profile的名字
... ${file}:上传文件路径
... 判断是新建还是搜索profile
sleep ${sleep}
run keyword if "${SearchorCreate}"=="Search" run keywords sleep ${sleep}
... AND input text xapth=/html/body/div/div[1]/div[1]/ul/div[1]/div/input ${ProfileName}
... AND sleep ${sleep}
... AND press keys xapth=/html/body/div/div[1]/div[1]/ul/div[1]/div/input ENTER
... AND sleep ${sleep}
... AND click element xpath=/html/body/div/div[1]/div[1]/ul/div[2]/div/li[1]
... AND sleep ${sleep}
... ELSE IF "${SearchorCreate}"=="Create" run keywords sleep ${sleep}
... AND click element xpath=/html/body/div/div[1]/div[1]/ul/div[1]/div/div/button
... AND sleep ${sleep}
... AND input text id=responsepages_profileName ${ProfileName}
... AND sleep ${sleep}
... AND Choose File xpath=//*[@id="policy_Manipulation_create6"]/div[2]/form/div[2]/div/div/div/input ${file} #上传文件
... AND sleep ${sleep}
... AND click element id=responseAddOk1
... AND sleep ${sleep}
... ELSE log 传入参数错误
Deny-Redirect
[Arguments] ${QType} ${Avalue} ${Attl} ${CNAMEvalue} ${CNAMEttl}
[Documentation] 调用次关键字前需要添加必填参数:
... ${QType}:填入A或AAAA
... ${Avalue}:根据${QType}填入IPV4或IPV6的值
... ${Attl}:根据${QType}填入A的ttl值或AAAA的ttl值
... ${CNAMEvalue}:根据${QType}填入A的CNAME的域名值或AAAA的CNAME域名值
... ${CNAMEttl}:根据${QType}填入A的CNAME的ttl值或AAAA的CNAME的ttl值
... 新建Redirect
sleep ${sleep}
click element id=interceptionadd_add_filter
sleep ${sleep}
run keyword if "${QType}"=="A" run keywords sleep ${sleep}
... AND input text id=A00 ${Avalue}
... AND sleep ${sleep}
... AND input text id=ttl00 ${Attl}
... AND sleep ${sleep}
... AND click element id=interceptionadd_addForm
... AND sleep ${sleep}
... AND input text id=Cname01 ${CNAMEvalue}
... AND sleep ${sleep}
... AND input text id=ttl01 ${CNAMEttl}
run keyword if "${QType}"=="AAAA" run keywords sleep ${sleep}
... AND click element id=dns_qtype_radio01
... AND input text id=AAAA00 ${Avalue}
... AND sleep ${sleep}
... AND input text id=ttl00 ${Attl}
... AND sleep ${sleep}
... AND click element id=interceptionadd_addForm
... AND sleep ${sleep}
... AND input text id=Cname01 ${CNAMEvalue}
... AND sleep ${sleep}
... AND input text id=ttl01 ${CNAMEttl}
sleep ${sleep}
click element id=interceptionadd_shezhidns
Replace-Action-Parameters-for1
[Arguments] ${ParametersType} ${RequestURIFind}=null ${RequestURIReplacewith}=null ${RequestBodyFind}=null ${RequestBodyReplacewith}=null ${ResponseBodyFind}=null
... ${ResponseBodyReplacewith}=null ${RequestHeaderFind}=null ${RequestHeaderReplacewith}=null ${ResponseHeaderFind}=null ${ResponseHeaderReplacewith}=null
[Documentation] 调用次关键字前需要添加必填参数:
... ${ParametersType}:列表格式Search 下拉框中内容
... ${i}:索引值
... ${xxxFind}是Find输入框输入的值
... ${XXXReplacewith} :是 Replacewith输入框中输入的值
${len} Get Length ${ParametersType}
${len1} evaluate ${len}+1
FOR ${i} IN RANGE 1 ${len1}
Replace-Action-Parameters-for1 ${ParametersType} ${i} ${RequestURIFind} ${RequestURIReplacewith} ${RequestBodyFind} ${RequestBodyReplacewith} ${ResponseBodyFind}
... ${ResponseBodyReplacewith} ${RequestHeaderFind} ${RequestHeaderReplacewith} ${ResponseHeaderFind} ${ResponseHeaderReplacewith}
sleep ${sleep}
run keyword if "${len}"!="1" run keywords sleep ${sleep}
... AND clcik element id=replaceadd_btn
... AND sleep ${sleep}
END
sleep ${sleep}
Replace-Action-Parameters-for2
[Arguments] ${ParametersType} ${i} ${RequestURIFind} ${RequestURIReplacewith} ${RequestBodyFind} ${RequestBodyReplacewith} ${ResponseBodyFind}
... ${ResponseBodyReplacewith} ${RequestHeaderFind} ${RequestHeaderReplacewith} ${ResponseHeaderFind} ${ResponseHeaderReplacewith}
[Documentation] 调用次关键字前需要添加必填参数:
... ${ParametersType}:列表格式Search 下拉框中内容
... ${i}:索引值
... ${xxxFind}是Find输入框输入的值
... ${XXXReplacewith} :是 Replacewith输入框中输入的值
FOR ${j} IN @{ParametersType}
run keyword if "${j}"=="RequestURI" run keywords sleep ${sleep}
... AND click element xpath=//*[@id="policy_paper_left"]/div[12]/div/div/form/div[3]/ul/li[${i}]/div[1]/div/div/div[1]/input
... AND sleep ${sleep}
... AND input text xpath=//*[@id="policy_paper_left"]/div[12]/div/div/form/div[3]/ul/li[${i}]/div[2]/div/div/input ${RequestURIFind}
... AND sleep ${sleep}
... AND input text xpath=//*[@id="policy_paper_left"]/div[12]/div/div/form/div[3]/ul/li[${i}]/div[3]/div/div/input ${RequestURIReplacewith}
... AND sleep ${sleep}
run keyword if "${j}"=="RequestBody" run keywords sleep ${sleep}
... AND click element xpath=//*[@id="policy_paper_left"]/div[12]/div/div/form/div[3]/ul/li[${i}]/div[1]/div/div/div[1]/input
... AND sleep ${sleep}
... AND input text xpath=//*[@id="policy_paper_left"]/div[12]/div/div/form/div[3]/ul/li[${i}]/div[2]/div/div/input ${RequestBodyFind}
... AND sleep ${sleep}
... AND input text xpath=//*[@id="policy_paper_left"]/div[12]/div/div/form/div[3]/ul/li[${i}]/div[3]/div/div/input ${RequestBodyReplacewith}
... AND sleep ${sleep}
run keyword if "${j}"=="ResponseBody" run keywords sleep ${sleep}
... AND click element xpath=//*[@id="policy_paper_left"]/div[12]/div/div/form/div[3]/ul/li[${i}]/div[1]/div/div/div[1]/input
... AND sleep ${sleep}
... AND input text xpath=//*[@id="policy_paper_left"]/div[12]/div/div/form/div[3]/ul/li[${i}]/div[2]/div/div/input ${ResponseBodyFind}
... AND sleep ${sleep}
... AND input text xpath=//*[@id="policy_paper_left"]/div[12]/div/div/form/div[3]/ul/li[${i}]/div[3]/div/div/input ${ResponseBodyReplacewith}
... AND sleep ${sleep}
run keyword if "${j}"=="RequestHeader" run keywords sleep ${sleep}
... AND click element xpath=//*[@id="policy_paper_left"]/div[12]/div/div/form/div[3]/ul/li[${i}]/div[1]/div/div/div[1]/input
... AND sleep ${sleep}
... AND input text xpath=//*[@id="policy_paper_left"]/div[12]/div/div/form/div[3]/ul/li[${i}]/div[2]/div/div/input ${RequestHeaderFind}
... AND sleep ${sleep}
... AND input text xpath=//*[@id="policy_paper_left"]/div[12]/div/div/form/div[3]/ul/li[${i}]/div[3]/div/div/input ${RequestHeaderReplacewith}
... AND sleep ${sleep}
run keyword if "${j}"=="ResponseHeader" run keywords sleep ${sleep}
... AND click element xpath=//*[@id="policy_paper_left"]/div[12]/div/div/form/div[3]/ul/li[${i}]/div[1]/div/div/div[1]/input
... AND sleep ${sleep}
... AND input text xpath=//*[@id="policy_paper_left"]/div[12]/div/div/form/div[3]/ul/li[${i}]/div[2]/div/div/input ${ResponseHeaderFind}
... AND sleep ${sleep}
... AND input text xpath=//*[@id="policy_paper_left"]/div[12]/div/div/form/div[3]/ul/li[${i}]/div[3]/div/div/input ${ResponseHeaderReplacewith}
... AND sleep ${sleep}
END
HijackFile-SearchorCreate
[Arguments] ${SearchorCreate} ${Hijackname} ${Hijackfile} ${dow_name} ${input} ${Hijackname} ${Hijacktype}
[Documentation] 调用次关键字前需要添加必填参数:
... ${SearchorCreate}:填入Search或Create
... ${Hijackname}:填入新建hijack的name
... ${Hijackfile}:填入新建hijack文件的路径
... ${dow_name}:根据情况填入close或open或其他
... ${input}填入shuru或其他
... ${Hijacktype}:填入选择文件类型的元素
... 判断是新建还是搜索HijackFile
sleep ${sleep}
click element xpath=//*[@id="policy_paper_left"]/div[12]/div/div/form/div[4]/div/div/div/div
sleep ${sleep}
run keyword if "${SearchorCreate}"=="Search" run keywords sleep ${sleep}
... AND input text xapth=/html/body/div/div[1]/div[1]/ul/div[1]/div/input ${Hijackname}
... AND sleep ${sleep}
... AND press keys xapth=/html/body/div/div[1]/div[1]/ul/div[1]/div/input ENTER
... AND sleep ${sleep}
... AND click element xpath=/html/body/div/div[1]/div[1]/ul/div[2]/div/li[1]
... AND sleep ${sleep}
... ELSE IF "${SearchorCreate}"=="Create" run keywords sleep ${sleep}
... AND click element xpath=/html/body/div/div[1]/div[1]/ul/div[1]/div/div/button
... AND sleep ${sleep}
... AND HijackFile-Create ${Hijackname} ${Hijackfile} ${dow_name} ${input} ${Hijackname} ${Hijacktype}
... ELSE log 传入参数错误
HijackFile-Create
[Arguments] ${Hijackname} ${Hijackfile} ${dow_name} ${input} ${Hijackname} ${Hijacktype}
[Documentation] 调用次关键字前需要添加必填参数:
... ${Hijackname}:填入新建hijack的name
... ${Hijackfile}:填入新建hijack文件的路径
... ${dow_name}:根据情况填入close或open或其他
... ${input}填入shuru或其他
... ${Hijacktype}:填入选择文件类型的元素
... 新建hijack
sleep ${sleep}
input id=hijack_profileName ${Hijackname} #输入name
sleep ${sleep}
Choose File xpath=//*[@id="proxy"]/div[11]/div/div[1]/div[2]/form/div[2]/div/div/div[1]/input ${Hijackfile} #上传文件
sleep ${sleep}
run keyword if "${dow_name}"=="close" and "${input}"=="shuru" run keywords sleep ${sleep}
... AND input text id=hijack_contentName ${Hijackname}
... ELSE IF "${dow_name}"=="open" click element xpath=//*[@id="contentNameChoose"]/div[1]/span[2]
sleep ${sleep}
click element id=hijackAddContentType #点击+ 打开侧滑窗口
sleep ${sleep}
click element ${Hijacktype} #选择文件类型
sleep ${sleep}
click element id=hijackAddOk1 #点击OK
InsertScript-SearchorCreate
[Arguments] ${SearchorCreate} ${Insertname} ${Insertfile} ${Inserttype} ${Insertjstype}
[Documentation] 调用次关键字前需要添加必填参数:
... ${SearchorCreate}:填入Search或Create
... ${Insertname}:填入新建insert的name
... ${Insertfile}:填入新建insert文件的路径
... ${Inserttype}:根据情况填入css或js
... ${Insertjstype}填入Before Page Load或After Page Load
... 判断是新建还是搜索insert
sleep ${sleep}
click element id=manipulation_select_insetScript
sleep ${sleep}
run keyword if "${SearchorCreate}"=="Search" run keywords sleep ${sleep}
... AND input text xapth=/html/body/div/div[1]/div[1]/ul/div[1]/div/input ${Hijackname}
... AND sleep ${sleep}
... AND press keys xapth=/html/body/div/div[1]/div[1]/ul/div[1]/div/input ENTER
... AND sleep ${sleep}
... AND click element xpath=/html/body/div/div[1]/div[1]/ul/div[2]/div/li[1]
... AND sleep ${sleep}
... ELSE IF "${SearchorCreate}"=="Create" run keywords sleep ${sleep}
... AND click element xpath=/html/body/div/div[1]/div[1]/ul/div[1]/div/div/button
... AND sleep ${sleep}
... AND InsertScript-Create ${Insertname} ${Insertfile} ${Inserttype} ${Insertjstype}
... ELSE log 传入参数错误
InsertScript-Create
[Arguments] ${Insertname} ${Insertfile} ${Inserttype} ${Insertjstype}
[Documentation] 调用次关键字前需要添加必填参数:
... ${Insertname}:填入新建insert的name
... ${Insertfile}:填入新建insert文件的路径
... ${Inserttype}:根据情况填入css或js
... ${Insertjstype}填入Before Page Load或After Page Load
... 新建insert
sleep ${sleep}
input id=insert_profileName ${Insertname} #输入name
sleep ${sleep}
Choose File xpath=//*[@id="insertAddUpload"]/div[1]/input ${Insertfile} #上传文件
sleep ${sleep}
clcik element id=insert_select_format
sleep ${sleep}
run keyword if "${Inserttype}"=="css" run keywords sleep ${sleep}
... AND click element //span[.="${Inserttype}"] #选择css
run keyword if "${Inserttype}"=="js" run keywords sleep ${sleep}
... AND click element //span[.="${Inserttype}"]
... AND sleep ${sleep}
... AND click element id=insert_select_insertOn #点击下拉框
... AND sleep ${sleep}
... AND click element //span[.="${Insertjstype}"]
sleep ${sleep}
click element id=insertAddOk1 #点击OK
LogSession
[Arguments] ${LogSession}
[Documentation] 调用次关键字前需要添加必填参数:
... ${LogSession}:填入clcos或其他
run keyword if "${LogSession}"=="close" run keywords sleep ${sleep}
... AND click element id=manipulationSwitch0
... ELSE log 开启日志
LogOptions
[Arguments] ${LogOptions}
[Documentation] 调用次关键字前需要添加必填参数:
... ${LogOptions}:填入All或其他
run keyword if "${LogOptions}"=="All" run keywords sleep ${sleep}
... AND click element id=logType1
... ELSE log 选择Metadata only
Enabled
[Arguments] ${Enabled}
[Documentation] 调用次关键字前需要添加必填参数:
... ${Enabled}:填入open或其他
run keyword if "${Enabled}"=="open" run keywords sleep ${sleep}
... AND click element xpath=//*[@id="proxyManipulationUse"]/label[contains(text(), "Enabled")]/following-sibling::div/div
... AND sleep ${sleep}
... AND click element xpath=/html/body/div/div/div[3]/button[2]
... ELSE log 开启日志
Proxy-Policies-OK
sleep ${sleep}
click element id=proxyManipulationSuccess
sleep ${sleep}
Create-Object-Search
[Arguments] ${name} ${filter}
[Documentation] 调用次关键字前需要添加必填参数:
... ${name}:填入是一个列表列表内容为object的name
... 选择search对象
sleep ${sleep}
click element xpath=//*[@id="policy_paper_left"]/div[9]/div/div[1]/label[contains(text(), "${filter}")]/following-sibling::div/div
sleep ${sleep}
FOR ${i} IN @{name}
input text xpath=//*[@id="condistions_protocol"]/div[2]/p[contains(text(), "${filter}")]/following-sibling::div[2]/div/div[1]/input ${i}
sleep ${sleep}
press keys xpath=//*[@id="condistions_protocol"]/div[2]/p[contains(text(), "${filter}")]/following-sibling::div[2]/div/div[1]/input ENTER
sleep ${sleep}
click element xpath=//*[@id="condistions_protocol"]/div[2]/p[contains(text(), "${filter}")]/following-sibling::div[2]/div/div[2]/div/div/ul/li[1]
sleep ${sleep}
END
Proxy-Source
[Arguments] ${SourceType} ${SourceValue}
Wait Until Element Is Enabled xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[1]/span/div/div/div[2]/div/div 10
sleep ${sleep}
click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[1]/span/div/div/div[2]/div/div
sleep ${sleep}
run keyword if "${SourceType}"=="ID" run keywords sleep ${sleep}
... AND click element xpath=/html/body/div/div[1]/div[1]/ul/li[2]
run keyword if "${SourceType}"=="Name" run keywords sleep ${sleep}
... AND click element xpath=/html/body/div/div[1]/div[1]/ul/li[3]
run keyword if "${SourceType}"=="Action" run keywords sleep ${sleep}
... AND click element xpath=/html/body/div/div[1]/div[1]/ul/li[4]
sleep ${sleep}
input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[1]/span/div/div/div[2]/div/div[1]/div[3]/div/input ${SourceValue}
sleep ${sleep}
click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[1]/span/div/i
sleep ${sleep}
click element xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]
sleep ${sleep}
EditButton
sleep ${sleep}
click element xpath=//*[@id="appEdit"]/span/div/div[2]
sleep ${sleep}
Initialize-Policie
[Arguments] ${InitializeAction}
[Documentation] 调用次关键字前需要添加必填参数:
... ${InitializeAction}:根据用例进行填写意思就是是那一个action就不要点击哪一个以免初始化失败
run keyword if "${InitializeAction}"=="Allow" run keywords sleep ${sleep}
... AND click element id=proxyManipulationdeny
... AND sleep ${sleep}
... ELSE IF "${InitializeAction}"=="Deny" run keywords sleep ${sleep}
... AND click element id=proxyManipulationallow
... ELSE IF "${InitializeAction}"=="Monitor" run keywords sleep ${sleep}
... AND click element id=proxyManipulationdeny
... ELSE IF "${InitializeAction}"=="Redirect" run keywords sleep ${sleep}
... AND click element id=proxyManipulationdeny
... ELSE IF "${InitializeAction}"=="Replace" run keywords sleep ${sleep}
... AND click element id=proxyManipulationdeny
... ELSE IF "${InitializeAction}"=="Hijack" run keywords sleep ${sleep}
... AND click element id=proxyManipulationdeny
... ELSE IF "${InitializeAction}"=="Insert" run keywords sleep ${sleep}
... AND click element id=proxyManipulationdeny
... ELSE log 不修改
sleep ${sleep}
${status} Run Keyword And Return Status Page should contain element xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form[1]/div/div[4]/div[1]/div/div/div #判断页面是否包含该元素
run keyword if "${status}"=="False" log go on
run keyword if "${status}"=="True" run keywords sleep ${sleep}
... AND click element xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form[1]/div/div[4]/div[1]/div/div/div/p/span/span/i[2]
... AND sleep ${sleep}
${status1} Run Keyword And Return Status Page should contain element xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form[1]/div/div[5]/div[1]/div/div/div #判断页面是否包含该元素
run keyword if "${status1}"=="False" log go on
run keyword if "${status1}"=="True" run keywords sleep ${sleep}
... AND click element xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form[1]/div/div[5]/div[1]/div/div/div/p/span/span/i[2]
... AND sleep ${sleep}
Delete-Proxy-estimate
[Arguments] ${securityname}
run keyword if "${securityname}"!="null" run keywords sleep ${sleep}
... AND Delete-Proxy ${securityname}
... ELSE log go on
Delete-Proxy
[Arguments] ${securityname}
Menu policys Proxy Policy
sleep ${sleep}
Wait Until Element Is Enabled xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[1]/span/div/div/div[2]/div/div 10
click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[1]/span/div/div/div[2]/div/div
sleep ${sleep}
click element xpath=/html/body/div/div[1]/div[1]/ul/li[3]
sleep ${sleep}
input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[1]/span/div/div/div[2]/div/div[1]/div[3]/div/input ${securityname}
sleep ${sleep}
click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[1]/span/div/i
sleep ${sleep}
Run Keyword And Ignore Error click element xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]
sleep ${sleep}
sleep ${sleep}
Run Keyword And Ignore Error click element id=appDel
sleep ${sleep}
Run Keyword And Ignore Error click element xpath=/html/body/div/div/div[3]/button[2]
sleep ${sleep}
Delete-object-estimate
[Arguments] ${obj}
run keyword if "${obj}"!="null" run keywords sleep ${sleep}
... AND Delete-object ${obj}
... ELSE log go on
Delete-object
[Arguments] ${obj}
FOR ${num} ${key} IN ENUMERATE @{obj}
Forname ${obj}[${key}] ${key}
END
Forname
[Arguments] ${objectname} ${key}
FOR ${i} IN @{objectname}
Menu objects ${key}
sleep ${sleep}
click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[1]/span/div/div/div[2]/div/div/div/input #点击输入框
sleep ${sleep}
click element xpath=/html/body/div/div[1]/div[1]/ul/li[3] #点击name为搜索类型
sleep ${sleep}
input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[1]/span/div/div/div[2]/div/div[1]/div[3]/div/input ${i} #输入搜索内容
sleep ${sleep}
click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[1]/span/div/i #点击搜索按钮
sleep ${sleep}
Run Keyword And Ignore Error click element xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span #选择搜索到的列表
sleep ${sleep}
sleep ${sleep}
Run Keyword And Ignore Error click element id=objectDel #点击删除按钮
sleep ${sleep}
Run Keyword And Ignore Error click element xpath=/html/body/div/div/div[3]/button[2]
sleep ${sleep}
END