2021-02-20 17:08:43 +08:00
*** Settings ***
Library json
Library Collections
Library Selenium2Library
Resource ../objects/NewObject.robot
Resource ../../../02-Keyword/tsg_ui/Menu.robot
Resource ../../../03-Variable/PolicyObjectDefault.txt
2021-02-25 14:25:45 +08:00
Resource ../../../03-Variable/BifangApiVariable.txt
2021-02-20 17:08:43 +08:00
*** Keywords ***
UIAddPolicies
2021-02-25 14:25:45 +08:00
[Arguments] ${policyInfo} ${sourceInfo}=null ${destinationInfo}=null ${filterInfo}=null ${subactionadd}=null ${Keyring}=null ${MirrorDecryptedTrafficInfo}=null ${DecryptionProfile}=null
... ${ProxyDenyadd}=null ${DenyRedirectadd}=null ${ReplaceActionParameters}=null ${HijackFileadd}=null ${InsertScript}=null
2021-02-20 17:08:43 +08:00
[Documentation] 创建策略
${emptyList} Create List
${return} ${policyType} Run Keyword And Ignore Error Get From Dictionary ${policyInfo} policyType
${policyType} Run Keyword If "${return}"=="FAIL" or "${policyType}"=="${EMPTY}" set variable ${Default_PolicyType}
... ELSE set variable ${policyType}
${return} ${policyName} Run Keyword And Ignore Error Get From Dictionary ${policyInfo} policyName
${policyName} Run Keyword If "${return}"=="FAIL" or "${policyName}"=="${EMPTY}" set variable ${Default_PolicyName}
... ELSE set variable ${policyName}
${return} ${policyAction} Run Keyword And Ignore Error Get From Dictionary ${policyInfo} policyAction
${policyAction} Run Keyword If "${return}"=="FAIL" or "${policyAction}"=="${EMPTY}" set variable ${Default_Action}
... ELSE set variable ${policyAction}
${return} ${policySubAction} Run Keyword And Ignore Error Get From Dictionary ${policyInfo} policySubAction
${policySubAction} Run Keyword If "${return}"=="FAIL" or "${policySubAction}"=="${EMPTY}" set variable ${Default_PolicySubAction}
... ELSE set variable ${policySubAction}
${return} ${ApplicationSearch} Run Keyword And Ignore Error Get From Dictionary ${policyInfo} ApplicationSearch
#${ApplicationSearchV} Run Keyword If "${return}"!="FAIL" and "${ApplicationSearch}"!="${EMPTY}" and "${ApplicationSearch}"!="${None}" Evaluate list(map(int, re.split('[,]', '${ApplicationSearch}'))) re
${ApplicationSearchV} Run Keyword If "${return}"!="FAIL" and "${ApplicationSearch}"!="${EMPTY}" and "${ApplicationSearch}"!="${None}" Evaluate list(re.split('[,]', '${ApplicationSearch}')) re
... ELSE Set Variable ${emptyList}
${return} ${policyLogSession} Run Keyword And Ignore Error Get From Dictionary ${policyInfo} policyLogSession
${policyLogSession} Run Keyword If "${return}"=="FAIL" or "${policyLogSession}"=="${EMPTY}" set variable ${Default_PolicyLogSession}
... ELSE set variable ${policyName}
2021-02-25 14:25:45 +08:00
${return} ${LogOptions} Run Keyword And Ignore Error Get From Dictionary ${policyInfo} LogOptions
${LogOptions} Run Keyword If "${return}"=="FAIL" or "${LogOptions}"=="${EMPTY}" set variable 1
... ELSE set variable ${LogOptions}
2021-02-20 17:08:43 +08:00
${return} ${policyEnabled} Run Keyword And Ignore Error Get From Dictionary ${policyInfo} policyEnabled
${policyEnabled} Run Keyword If "${return}"=="FAIL" or "${policyEnabled}"=="${EMPTY}" set variable ${Default_PolicyEnabled}
... ELSE set variable ${policyEnabled}
Comment 新建策略 打开菜单
Menu policys ${policyType}
Comment 新建策略 打开安全策略列表上方的新建策略按钮
UIPolicy.CreateButton
#${return} ${policyType} Run Keyword And Ignore Error Get From Dictionary ${policy} policyType
#Run Keyword If "${return}"=="FAIL" or "${policyType}"=="${EMPTY}" Set To Dictionary ${returnDict} policyType=${Default_PolicyType}
#... ELSE Set To Dictionary ${returnDict} policyType=${policyType}
2021-02-25 14:25:45 +08:00
UIPolicy.Create-name ${policyType} ${policyName}
UIPolicy.Create-actions ${policyType} ${policyAction}
2021-02-20 17:08:43 +08:00
#Create-Source-Button
Run Keyword If "${sourceInfo}"=="${EMPTY}" log there is no sourceInfoDict
... ELSE UIPolicy. Create-Source-Button
Run Keyword If "${sourceInfo}"=="${EMPTY}" log there is no sourceInfoDict
2021-02-25 14:25:45 +08:00
... ELSE UIPolicy.CreateEditDeleteSources ${sourceInfo}
2021-02-20 17:08:43 +08:00
#Create-Source type1=Ip CreateOrSearch=Create Add=Address name=zdhip001 ipclienttext1=192.168.100.1 post=1
#Create-Destination-Button
Run Keyword If "${destinationInfo}"=="${EMPTY}" log there is no destinationInfo
... ELSE UIPolicy.Create-Destination-Button
Run Keyword If "${destinationInfo}"=="${EMPTY}" log there is no destinationInfo
2021-02-25 14:25:45 +08:00
... ELSE UIPolicy.CreateEditDeleteDestination ${destinationInfo}
2021-02-20 17:08:43 +08:00
#Create-Destination type1=Ip CreateOrSearch=Create Add=Address name=zdhip001 ipclienttext1=192.168.100.1 post=1
2021-02-25 14:25:45 +08:00
UIPolicy.Create-Application-Button ${policyType} ${ApplicationSearchV} ${policyAction}
2021-02-20 17:08:43 +08:00
#编辑filter
Run Keyword If "${filterInfo}"=="${EMPTY}" log there is no filterInfo
2021-02-25 14:25:45 +08:00
... ELSE Create-Filter-SecurityOrProxy ${policyType} ${ApplicationSearchV}[0] ${filterInfo}
log 111111111111111111
Run Keyword If "${policyType}"=="Security Policy" and "${policyAction}"=="deny" run keywords sleep 2
... AND Deny-subaction ${policyAction} ${policySubAction} ${subactionadd}
Run Keyword If "${policyType}"=="Security Policy" and "${policyAction}"=="intercept" and "ApplicationSearchV"=="SSL" run keywords sleep 2
... AND interceptadd ${Keyring} ${MirrorDecryptedTrafficInfo} ${DecryptionProfile}
Run Keyword If "${policyType}"=="Proxy Policy" and "${policyAction}"=="deny" run keywords sleep 2
... AND Proxy-Deny ${ProxyDenyadd}
Run Keyword If "${policyType}"=="Proxy Policy" and "${policyAction}"=="redirect" run keywords sleep 2
... AND Deny-Redirect ${DenyRedirectadd}
Run Keyword If "${policyType}"=="Proxy Policy" and "${policyAction}"=="replace" run keywords sleep 2
... AND Replace-Action-Parameters-for1 ${ReplaceActionParameters}
Run Keyword If "${policyType}"=="Proxy Policy" and "${policyAction}"=="hijack" run keywords sleep 2
... AND HijackFile-SearchorCreate ${HijackFileadd}
Run Keyword If "${policyType}"=="Proxy Policy" and "${policyAction}"=="insert" run keywords sleep 2
... AND InsertScript-SearchorCreate ${InsertScript}
Run Keyword If "${policyType}"=="Proxy Policy" run keywords ProxyLogSession ${policyLogSession}
... AND ProxyLogOptions ${LogOptions}
... ELSE LogSession ${policyLogSession}
Run Keyword If "${policyType}"=="Security Policy" Enabled ${policyEnabled}
... ELSE ProxyEnabled ${policyEnabled}
Run Keyword If "${policyType}"=="Security Policy" Security-Policies-OK
... ELSE Proxy-Policies-OK
2021-02-20 17:08:43 +08:00
2021-02-25 14:25:45 +08:00
CreateEditDeleteSources
2021-02-20 17:08:43 +08:00
[Arguments] ${sourceInfoDict}
[Documentation] 策略源条件处理、包括增加: create、search, update、delete几个列表;
... 格式: 新增: type1=IP option=Create Add=Address name=zdhip001 ipclienttext1=192.168.100.1 port=1
... 修改: type1=IP option=Update Add=Address name=zdhip001 ipclienttext1=192.168.100.1 port=1 把为name对应值的的记录修改为输入的内容
... 新增: type1=Geography option=Create Add=Address name=zdhip001 ipclienttext1=192.168.100.1 port=1geo
${return} ${addList} Run Keyword And Ignore Error Get From Dictionary ${sourceInfoDict} sourceAddIpList
Run Keyword If "${return}"=="FAIL" or "${addList}"=="${EMPTY}" log there is no CreateSource
2021-02-25 14:25:45 +08:00
... ELSE CreateSources1 ${addList}
2021-02-20 17:08:43 +08:00
2021-02-25 14:25:45 +08:00
CreateSources1
2021-02-20 17:08:43 +08:00
[Arguments] ${addList}
[Documentation] 调用次关键字前需要添加必填参数:
... ${type1}:填入Ip或SUBID或Geography或IPLearning
... ${CreateOrSearch}:填入Create或者Search
... ${Add}:填入Address或Group
... ${name}:名称
... ${ip_type}:填入Ip或者Geography或者IPLearning
... ${ipclienttext1}:填入IPV4或6的值或range的ip段
... ${port}:填入端口
... ${Country}:列表形式,列表中是国家名字
... ${City}:列表形式,列表中是城市名字
... ${Protocols1}:填入HTTP或SSL或HTTPSSL
... ${Degree}:填入1Degree或2Degree
... ${times}:填入小时数, 例如1或2
... ${numbers}:填入数值, 例如1或10000
... ${limits}:填入数值, 例如1或10000
... ${object_name}:列表形式,列表中是对象的名字
... ${keywordtext}:填入新建subid的内容
... 判断新建source选择用什么样的类型数据
${listlenth}= Get Length ${addList}
#${tempValue} set Variable tempValue
#FOR ${var} IN RANGE ${addList}
FOR ${var} IN RANGE ${listlenth}
log ${var}
${tempValue} Get From List ${addList} ${var}
CreateSource ${tempValue}
END
2021-02-25 14:25:45 +08:00
CreateEditDeleteDestination
[Arguments] ${destinationInfoDict}
[Documentation] 策略源条件处理、包括增加: create、search, update、delete几个列表;
... 格式: 新增: type1=IP option=Create Add=Address name=zdhip001 ipclienttext1=192.168.100.1 port=1
... 修改: type1=IP option=Update Add=Address name=zdhip001 ipclienttext1=192.168.100.1 port=1 把为name对应值的的记录修改为输入的内容
... 新增: type1=Geography option=Create Add=Address name=zdhip001 ipclienttext1=192.168.100.1 port=1geo
${return} ${addList} Run Keyword And Ignore Error Get From Dictionary ${destinationInfoDict} destinationAddIpList
Run Keyword If "${return}"=="FAIL" or "${addList}"=="${EMPTY}" log there is no CreateSource
... ELSE CreateDestination1 ${addList}
2021-02-20 17:08:43 +08:00
2021-02-25 14:25:45 +08:00
CreateDestination1
[Arguments] ${addList}
[Documentation] 调用次关键字前需要添加必填参数:
... ${type1}:填入Ip或SUBID或Geography或IPLearning
... ${CreateOrSearch}:填入Create或者Search
... ${Add}:填入Address或Group
... ${name}:名称
... ${ip_type}:填入Ip或者Geography或者IPLearning
... ${ipclienttext1}:填入IPV4或6的值或range的ip段
... ${port}:填入端口
... ${Country}:列表形式,列表中是国家名字
... ${City}:列表形式,列表中是城市名字
... ${Protocols1}:填入HTTP或SSL或HTTPSSL
... ${Degree}:填入1Degree或2Degree
... ${times}:填入小时数, 例如1或2
... ${numbers}:填入数值, 例如1或10000
... ${limits}:填入数值, 例如1或10000
... ${object_name}:列表形式,列表中是对象的名字
... ${keywordtext}:填入新建subid的内容
... 判断新建source选择用什么样的类型数据
${listlenth}= Get Length ${addList}
#${tempValue} set Variable tempValue
#FOR ${var} IN RANGE ${addList}
FOR ${var} IN RANGE ${listlenth}
log ${var}
${tempValue} Get From List ${addList} ${var}
Create-Destination ${tempValue}
END
CreateSource
2021-02-20 17:08:43 +08:00
[Arguments] ${addDict}
#[Arguments] ${policytype}=null ${type1}=null ${CreateOrSearch}=null ${Add}=null ${name}=null
2021-02-25 14:25:45 +08:00
#... ${object_name}=null ${ipclienttext1}=null ${port}=null ${Country}=null ${City}=null
2021-02-20 17:08:43 +08:00
#... ${Protocols1}=null ${Degree}=null ${times}=null ${numbers}=null ${limits}=null ${keywordtext}=null
[Documentation] 调用次关键字前需要添加必填参数:
... ${policytype}:填入安全策略或管控策略或tcp策略中前置元素: 安全和代理源: /html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[4] 安全和代理目的:/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[5]
... tcp源: /html/body/div[1]/div/div[3]/div[2]/div/div/div[1]/div[1]/div/div[2]/form/div[2]
... tcp目的:/html/body/div[1]/div/div[3]/div[2]/div/div/div[1]/div[1]/div/div[2]/form/div[3]
... ${type1}:填入Ip或SUBID或Geography或IPLearning
... ${CreateOrSearch}:填入Create或者Search
... ${Add}:填入Address或Group
... ${name}:名称
... ${ip_type}:填入Ip或者Geography或者IPLearning
... ${ipclienttext1}:填入IPV4或6的值或range的ip段
2021-02-25 14:25:45 +08:00
... ${port}:填入端口
2021-02-20 17:08:43 +08:00
... ${Country}:列表形式,列表中是国家名字
... ${City}:列表形式,列表中是城市名字
... ${Protocols1}:填入HTTP或SSL或HTTPSSL
... ${Degree}:填入1Degree或2Degree
... ${times}:填入小时数, 例如1或2
... ${numbers}:填入数值, 例如1或10000
... ${limits}:填入数值, 例如1或10000
... ${object_name}:列表形式,列表中是对象的名字
... ${keywordtext}:填入新建subid的内容
... 判断新建source选择用什么样的类型数据
#调用次关键字前需要添加必填参数:
${return} ${sordtype} Run Keyword And Ignore Error Get From Dictionary ${addDict} sordtype
${sordtype} Run Keyword If "${return}"=="FAIL" or "${sordtype}"=="${EMPTY}" set variable Source
... ELSE set variable ${sordtype}
2021-02-25 14:25:45 +08:00
${typepath} Run Keyword If "${sordtype}"=="Source" set variable /html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[4]
2021-02-20 17:08:43 +08:00
... ELSE set variable /html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[5]
${return} ${type1} Run Keyword And Ignore Error Get From Dictionary ${addDict} type1
${type1} Run Keyword If "${return}"=="FAIL" or "${type1}"=="${EMPTY}" set variable IP
... ELSE set variable ${type1}
${return} ${CreateOrSearch} Run Keyword And Ignore Error Get From Dictionary ${addDict} CreateOrSearch
${CreateOrSearch} Run Keyword If "${return}"=="FAIL" or "${CreateOrSearch}"=="${EMPTY}" set variable Create
... ELSE set variable ${CreateOrSearch}
${return} ${Add} Run Keyword And Ignore Error Get From Dictionary ${addDict} Add
${Add} Run Keyword If "${return}"=="FAIL" or "${Add}"=="${EMPTY}" set variable Add
... ELSE set variable ${Add}
${return} ${object_name} Run Keyword And Ignore Error Get From Dictionary ${addDict} object_name
${object_name} Run Keyword If "${return}"=="FAIL" or "${object_name}"=="${EMPTY}" set variable null
... ELSE set variable ${object_name}
${return} ${name} Run Keyword And Ignore Error Get From Dictionary ${addDict} name
${type1} Run Keyword If "${return}"=="FAIL" or "${type1}"=="${EMPTY}" set variable null
... ELSE set variable ${type1}
${return} ${ipclienttext1} Run Keyword And Ignore Error Get From Dictionary ${addDict} ipclienttext1
${ipclienttext1} Run Keyword If "${return}"=="FAIL" or "${ipclienttext1}"=="${EMPTY}" set variable null
... ELSE set variable ${ipclienttext1}
${return} ${port} Run Keyword And Ignore Error Get From Dictionary ${addDict} port
${port} Run Keyword If "${return}"=="FAIL" or "${port}"=="${EMPTY}" set variable null
... ELSE set variable ${port}
${return} ${Country} Run Keyword And Ignore Error Get From Dictionary ${addDict} Country
${Country} Run Keyword If "${return}"=="FAIL" or "${Country}"=="${EMPTY}" set variable null
... ELSE set variable ${Country}
${return} ${City} Run Keyword And Ignore Error Get From Dictionary ${addDict} City
${City} Run Keyword If "${return}"=="FAIL" or "${City}"=="${EMPTY}" set variable null
... ELSE set variable ${City}
2021-02-25 14:25:45 +08:00
${return} ${fqdn} Run Keyword And Ignore Error Get From Dictionary ${addDict} fqdn
${fqdn} Run Keyword If "${return}"=="FAIL" or "${fqdn}"=="${EMPTY}" set variable null
... ELSE set variable ${fqdn}
2021-02-20 17:08:43 +08:00
${return} ${Protocols1} Run Keyword And Ignore Error Get From Dictionary ${addDict} Protocols1
${Protocols1} Run Keyword If "${return}"=="FAIL" or "${Protocols1}"=="${EMPTY}" set variable null
... ELSE set variable ${Protocols1}
${return} ${Degree} Run Keyword And Ignore Error Get From Dictionary ${addDict} Degree
${Degree} Run Keyword If "${return}"=="FAIL" or "${Degree}"=="${EMPTY}" set variable null
... ELSE set variable ${Degree}
${return} ${times} Run Keyword And Ignore Error Get From Dictionary ${addDict} times
${times} Run Keyword If "${return}"=="FAIL" or "${times}"=="${EMPTY}" set variable null
... ELSE set variable ${times}
${return} ${numbers} Run Keyword And Ignore Error Get From Dictionary ${addDict} numbers
${numbers} Run Keyword If "${return}"=="FAIL" or "${numbers}"=="${EMPTY}" set variable null
... ELSE set variable ${numbers}
${return} ${limits} Run Keyword And Ignore Error Get From Dictionary ${addDict} limits
${limits} Run Keyword If "${return}"=="FAIL" or "${limits}"=="${EMPTY}" set variable null
... ELSE set variable ${limits}
${return} ${keywordtext} Run Keyword And Ignore Error Get From Dictionary ${addDict} keywordtext
${keywordtext} Run Keyword If "${return}"=="FAIL" or "${keywordtext}"=="${EMPTY}" set variable null
... ELSE set variable ${keywordtext}
run keyword if "${type1}"=="Ip" run keywords sleep 2
... AND click element xpath=${typepath}/div[2]/div[1]/div[2]/div[1]/div/div/div/div[1]/div/div/div/div[1]
... AND sleep 1
... AND sleep 1
2021-02-25 14:25:45 +08:00
... AND SourceIPCreateOrSearch ${typepath} ${CreateOrSearch} ${Add} ${type1} ${name} ${object_name} ${ipclienttext1} ${port} ${Country} ${City} ${fqdn} ${Protocols1} ${Degree} ${times} ${numbers} ${limits}
2021-02-20 17:08:43 +08:00
... ELSE IF "${type1}"=="SUBID" run keywords sleep 2
... AND click element xpath=${typepath}/div[2]/div[1]/div[2]/div[1]/div/div/div/div[1]/div/div/div/div[2]
... AND sleep 1
2021-02-25 14:25:45 +08:00
... AND SUBIDCreateOrSearch ${typepath} ${CreateOrSearch} ${Add} ${name} ${keywordtext} ${object_name}
2021-02-20 17:08:43 +08:00
... ELSE IF "${type1}"=="Geography" run keywords sleep 2
2021-02-25 14:25:45 +08:00
... AND click element xpath=${typepath}/div[2]/div[1]/div[2]/div[1]/div/div/div/div[1]/div/div/div/div[3]
2021-02-20 17:08:43 +08:00
... AND sleep 1
2021-02-25 14:25:45 +08:00
... AND SourceIPCreateOrSearch ${typepath} ${CreateOrSearch} ${Add} ${type1} ${name} ${object_name} ${ipclienttext1} ${port} ${Country} ${City} ${fqdn} ${Protocols1} ${Degree} ${times} ${numbers} ${limits}
2021-02-20 17:08:43 +08:00
... ELSE IF "${type1}"=="IPLearning" run keywords sleep 2
... AND click element xpath=${typepath}/div[2]/div[1]/div[2]/div[1]/div/div/div/div[1]/div/div/div/div[4]
... AND sleep 1
2021-02-25 14:25:45 +08:00
... AND SourceIPCreateOrSearch ${typepath} ${CreateOrSearch} ${Add} ${type1} ${name} ${object_name} ${ipclienttext1} ${port} ${Country} ${City} ${fqdn} ${Protocols1} ${Degree} ${times} ${numbers} ${limits}
2021-02-20 17:08:43 +08:00
2021-02-25 14:25:45 +08:00
Create-Destination
[Arguments] ${addDict}
# ${policytype}=null ${type1}=null ${CreateOrSearch}=null ${Add}=null ${name}=null
# ... ${object_name}=null ${ipclienttext1}=null ${port}=null ${Country}=null ${City}=null
# ... ${Protocols1}=null ${Degree}=null ${times}=null ${numbers}=null ${limits}=null ${keywordtext}=null
2021-02-20 17:08:43 +08:00
[Documentation] 调用次关键字前需要添加必填参数:
... ${type1}:填入Ip或SUBID或Geography或IPLearning
... ${CreateOrSearch}:填入Create或者Search
... ${Add}:填入Address或Group
... ${name}:名称
... ${ip_type}:填入Ip或者Geography或者IPLearning
... ${ipclienttext1}:填入IPV4或6的值或range的ip段
... ${port}:填入端口
... ${Country}:列表形式,列表中是国家名字
... ${City}:列表形式,列表中是城市名字
... ${Protocols1}:填入HTTP或SSL或HTTPSSL
... ${Degree}:填入1Degree或2Degree
... ${times}:填入小时数, 例如1或2
... ${numbers}:填入数值, 例如1或10000
... ${limits}:填入数值, 例如1或10000
... ${object_name}:列表形式,列表中是对象的名字
... ${keywordtext}:填入新建subid的内容
... 判断新建source选择用什么样的类型数据
2021-02-25 14:25:45 +08:00
#调用次关键字前需要添加必填参数:
${return} ${sordtype} Run Keyword And Ignore Error Get From Dictionary ${addDict} sordtype
${sordtype} Run Keyword If "${return}"=="FAIL" or "${sordtype}"=="${EMPTY}" set variable Source
... ELSE set variable ${sordtype}
${typepath} Run Keyword If "${sordtype}"=="Source" set variable /html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[4]
... ELSE set variable /html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[5]
2021-02-20 17:08:43 +08:00
${return} ${type1} Run Keyword And Ignore Error Get From Dictionary ${addDict} type1
${type1} Run Keyword If "${return}"=="FAIL" or "${type1}"=="${EMPTY}" set variable IP
... ELSE set variable ${type1}
${return} ${CreateOrSearch} Run Keyword And Ignore Error Get From Dictionary ${addDict} CreateOrSearch
2021-02-25 14:25:45 +08:00
${CreateOrSearch} Run Keyword If "${return}"=="FAIL" or "${CreateOrSearch}"=="${EMPTY}" set variable Create
2021-02-20 17:08:43 +08:00
... ELSE set variable ${CreateOrSearch}
${return} ${Add} Run Keyword And Ignore Error Get From Dictionary ${addDict} Add
${Add} Run Keyword If "${return}"=="FAIL" or "${Add}"=="${EMPTY}" set variable Add
... ELSE set variable ${Add}
${return} ${object_name} Run Keyword And Ignore Error Get From Dictionary ${addDict} object_name
${object_name} Run Keyword If "${return}"=="FAIL" or "${object_name}"=="${EMPTY}" set variable null
... ELSE set variable ${object_name}
${return} ${name} Run Keyword And Ignore Error Get From Dictionary ${addDict} name
2021-02-25 14:25:45 +08:00
${name} Run Keyword If "${return}"=="FAIL" or "${name}"=="${EMPTY}" set variable null
... ELSE set variable ${name}
2021-02-20 17:08:43 +08:00
${return} ${ipclienttext1} Run Keyword And Ignore Error Get From Dictionary ${addDict} ipclienttext1
${ipclienttext1} Run Keyword If "${return}"=="FAIL" or "${ipclienttext1}"=="${EMPTY}" set variable null
... ELSE set variable ${ipclienttext1}
${return} ${port} Run Keyword And Ignore Error Get From Dictionary ${addDict} port
${port} Run Keyword If "${return}"=="FAIL" or "${port}"=="${EMPTY}" set variable null
... ELSE set variable ${port}
${return} ${Country} Run Keyword And Ignore Error Get From Dictionary ${addDict} Country
${Country} Run Keyword If "${return}"=="FAIL" or "${Country}"=="${EMPTY}" set variable null
... ELSE set variable ${Country}
${return} ${City} Run Keyword And Ignore Error Get From Dictionary ${addDict} City
${City} Run Keyword If "${return}"=="FAIL" or "${City}"=="${EMPTY}" set variable null
... ELSE set variable ${City}
2021-02-25 14:25:45 +08:00
${return} ${fqdn} Run Keyword And Ignore Error Get From Dictionary ${addDict} fqdn
${fqdn} Run Keyword If "${return}"=="FAIL" or "${fqdn}"=="${EMPTY}" set variable null
... ELSE set variable ${fqdn}
2021-02-20 17:08:43 +08:00
${return} ${Protocols1} Run Keyword And Ignore Error Get From Dictionary ${addDict} Protocols1
${Protocols1} Run Keyword If "${return}"=="FAIL" or "${Protocols1}"=="${EMPTY}" set variable null
... ELSE set variable ${Protocols1}
${return} ${Degree} Run Keyword And Ignore Error Get From Dictionary ${addDict} Degree
${Degree} Run Keyword If "${return}"=="FAIL" or "${Degree}"=="${EMPTY}" set variable null
... ELSE set variable ${Degree}
${return} ${times} Run Keyword And Ignore Error Get From Dictionary ${addDict} times
${times} Run Keyword If "${return}"=="FAIL" or "${times}"=="${EMPTY}" set variable null
... ELSE set variable ${times}
${return} ${numbers} Run Keyword And Ignore Error Get From Dictionary ${addDict} numbers
${numbers} Run Keyword If "${return}"=="FAIL" or "${numbers}"=="${EMPTY}" set variable null
... ELSE set variable ${numbers}
${return} ${limits} Run Keyword And Ignore Error Get From Dictionary ${addDict} limits
${limits} Run Keyword If "${return}"=="FAIL" or "${limits}"=="${EMPTY}" set variable null
... ELSE set variable ${limits}
2021-02-25 14:25:45 +08:00
run keyword if "${type1}"=="Ip" run keywords sleep ${sleep}
... AND click element xpath=${typepath}/div[2]/div[1]/div[2]/div[1]/div/div/div/div[1]/div/div/div/div[1]
... AND sleep ${sleep}
... AND sleep ${sleep}
... AND DestinationIPCreateOrSearch ${typepath} ${CreateOrSearch} ${Add} ${type1} ${name} ${object_name} ${ipclienttext1} ${port} ${Country} ${City} ${fqdn} ${Protocols1} ${Degree} ${times} ${numbers} ${limits}
... ELSE IF "${type1}"=="Geography" run keywords sleep ${sleep}
... AND click element xpath=${typepath}/div[2]/div[1]/div[2]/div[1]/div/div/div/div[1]/div/div/div/div[2]
... AND sleep ${sleep}
... AND DestinationIPCreateOrSearch ${typepath} ${CreateOrSearch} ${Add} ${type1} ${name} ${object_name} ${ipclienttext1} ${port} ${Country} ${City} ${fqdn} ${Protocols1} ${Degree} ${times} ${numbers} ${limits}
... ELSE IF "${type1}"=="IPLearning" run keywords sleep ${sleep}
... AND click element xpath=${typepath}/div[2]/div[1]/div[2]/div[1]/div/div/div/div[1]/div/div/div/div[3]
... AND sleep ${sleep}
... AND DestinationIPCreateOrSearch ${typepath} ${CreateOrSearch} ${Add} ${type1} ${name} ${object_name} ${ipclienttext1} ${port} ${Country} ${City} ${fqdn} ${Protocols1} ${Degree} ${times} ${numbers} ${limits}
2021-02-20 17:08:43 +08:00
2021-02-25 14:25:45 +08:00
2021-02-20 17:08:43 +08:00
CreateButton
[Documentation] 点击安全策略中的Create按钮
Wait Until Element Is Enabled id=app_create
sleep 3
click element id=app_create
Create-name
2021-02-25 14:25:45 +08:00
[Arguments] ${policyType} ${name}
2021-02-20 17:08:43 +08:00
[Documentation] 输入name
sleep 2
2021-02-25 14:25:45 +08:00
run keyword if "${policyType}"=="Security Policy" run keywords sleep 1
... AND input text id=interceptionadd_name ${name}
run keyword if "${policyType}"=="Proxy Policy" run keywords sleep 1
... AND input text id=manipulation_elInput_policyName ${name}
Create-actions
[Arguments] ${policyType} ${action}
sleep 1
run keyword if "${policyType}"=="Security Policy" run keywords sleep 1
... AND Create-Securityaction ${action}
run keyword if "${policyType}"=="Proxy Policy" run keywords sleep 1
... AND Create-Proxyaction ${action}
Create-Securityaction
2021-02-20 17:08:43 +08:00
[Arguments] ${action}
[Documentation] 调用次关键字前需要添加必填参数:
... ${action}:填入allow或deny或monitor或intercept
... 判断要创建什么动作的策略
sleep 1
run keyword if "${action}"=="allow" run keywords sleep 1
... AND click element id=security_action_allow
... ELSE IF "${action}"=="deny" run keywords sleep 1
... AND click element id=security_action_deny
... ELSE IF "${action}"=="monitor" run keywords sleep 1
... AND click element id=security_action_monitor
... ELSE IF "${action}"=="intercept" run keywords sleep 1
... AND click element id=security_action_intercept
2021-02-25 14:25:45 +08:00
Create-Proxyaction
[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
2021-02-20 17:08:43 +08:00
Create-Source-Button
[Documentation] 点击Source的加号
sleep 2
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 2
click element xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[5]/div[1]/div/div
2021-02-25 14:25:45 +08:00
Create-Application-Button
[Arguments] ${policyType} ${ApplicationSearchV} ${action}
2021-02-20 17:08:43 +08:00
[Documentation] 点击Application的加号
2021-02-25 14:25:45 +08:00
run keyword if "${policyType}"=="Security Policy" run keywords Wait Until Element Is Enabled id=interceptionadd_application 10
... AND click element id=interceptionadd_application
... AND sleep 1
... AND SecurityApplicationFor ${ApplicationSearchV}
... AND sleep 1
run keyword if "${policyType}"=="Proxy Policy" ProxyApplicationSearch ${action} ${ApplicationSearchV}
SecurityApplicationFor
[Arguments] ${ApplicationSearchV}
FOR ${i} IN ${ApplicationSearchV}
SecurityApplicationSearch ${ApplicationSearchV}
END
SecurityApplicationSearch
2021-02-20 17:08:43 +08:00
[Arguments] ${Application}
[Documentation] 调用次关键字前需要添加必填参数:
... ${Application}:填入是Application的内容, 例如SSL或HTTP
... 选择search对象
2021-02-25 14:25:45 +08:00
sleep 1
2021-02-20 17:08:43 +08:00
input text xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[5]/div[2]/div[2]/div/div[1]/input ${Application}
sleep 1
press keys xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[5]/div[2]/div[2]/div/div[1]/input ENTER
sleep 1
click element xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[5]/div[2]/div[2]/div/div[3]/div/div/ul/li[1]
sleep 1
2021-02-25 14:25:45 +08:00
ProxyApplicationSearch
[Arguments] ${action} ${HttpOrDoh}
[Documentation] 调用次关键字前需要添加必填参数:
... ${action}:填入是action的内容, 例如redirect或deny
... 选择search对象
run keyword if "${action}"=="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的内容, 例如Doh或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-SecurityOrProxy
[Arguments] ${policyType} ${Application} ${addFilter}
[Documentation] 点击Application的加号
${return} ${Filter} Run Keyword And Ignore Error Get From Dictionary ${addFilter} Filter
${Filter} Run Keyword If "${return}"=="FAIL" or "${Filter}"=="${EMPTY}" set variable null
... ELSE set variable ${Filter}
${return} ${Hostname} Run Keyword And Ignore Error Get From Dictionary ${addFilter} Hostname
${Hostname} Run Keyword If "${return}"=="FAIL" or "${Hostname}"=="${EMPTY}" set variable null
... ELSE set variable ${Hostname}
${return} ${URLname} Run Keyword And Ignore Error Get From Dictionary ${addFilter} URLname
${URLname} Run Keyword If "${return}"=="FAIL" or "${URLname}"=="${EMPTY}" set variable null
... ELSE set variable ${URLname}
${return} ${Request Headername} Run Keyword And Ignore Error Get From Dictionary ${addFilter} Request Headername
${Request Headername} Run Keyword If "${return}"=="FAIL" or "${Request Headername}"=="${EMPTY}" set variable null
... ELSE set variable ${Request Headername}
${return} ${Response Headername} Run Keyword And Ignore Error Get From Dictionary ${addFilter} Response Headername
${Response Headername} Run Keyword If "${return}"=="FAIL" or "${Response Headername}"=="${EMPTY}" set variable null
... ELSE set variable ${Response Headername}
${return} ${Request Contentname} Run Keyword And Ignore Error Get From Dictionary ${addFilter} Request Contentname
${Request Contentname} Run Keyword If "${return}"=="FAIL" or "${Request Contentname}"=="${EMPTY}" set variable null
... ELSE set variable ${Request Contentname}
${return} ${Response Contentname} Run Keyword And Ignore Error Get From Dictionary ${addFilter} Response Contentname
${Response Contentname} Run Keyword If "${return}"=="FAIL" or "${Response Contentname}"=="${EMPTY}" set variable null
... ELSE set variable ${Response Contentname}
${return} ${SSLSNIname} Run Keyword And Ignore Error Get From Dictionary ${addFilter} SSLSNIname
${SSLSNIname} Run Keyword If "${return}"=="FAIL" or "${SSLSNIname}"=="${EMPTY}" set variable null
... ELSE set variable ${SSLSNIname}
${return} ${CNname} Run Keyword And Ignore Error Get From Dictionary ${addFilter} CNname
${CNname} Run Keyword If "${return}"=="FAIL" or "${CNname}"=="${EMPTY}" set variable null
... ELSE set variable ${CNname}
${return} ${SANname} Run Keyword And Ignore Error Get From Dictionary ${addFilter} SANname
${SANname} Run Keyword If "${return}"=="FAIL" or "${SANname}"=="${EMPTY}" set variable null
... ELSE set variable ${SANname}
${return} ${QNAMEname} Run Keyword And Ignore Error Get From Dictionary ${addFilter} QNAMEname
${QNAMEname} Run Keyword If "${return}"=="FAIL" or "${QNAMEname}"=="${EMPTY}" set variable null
... ELSE set variable ${QNAMEname}
${return} ${Subjectname} Run Keyword And Ignore Error Get From Dictionary ${addFilter} Subjectname
${Subjectname} Run Keyword If "${return}"=="FAIL" or "${Subjectname}"=="${EMPTY}" set variable null
... ELSE set variable ${Subjectname}
${return} ${MAILContentname} Run Keyword And Ignore Error Get From Dictionary ${addFilter} MAILContentname
${MAILContentname} Run Keyword If "${return}"=="FAIL" or "${MAILContentname}"=="${EMPTY}" set variable null
... ELSE set variable ${MAILContentname}
${return} ${Attachment Namename} Run Keyword And Ignore Error Get From Dictionary ${addFilter} Attachment Namename
${Attachment Namename} Run Keyword If "${return}"=="FAIL" or "${Attachment Namename}"=="${EMPTY}" set variable null
... ELSE set variable ${Attachment Namename}
${return} ${Attachment Contentname} Run Keyword And Ignore Error Get From Dictionary ${addFilter} Attachment Contentname
${Attachment Contentname} Run Keyword If "${return}"=="FAIL" or "${Attachment Contentname}"=="${EMPTY}" set variable null
... ELSE set variable ${Attachment Contentname}
${return} ${Fromname} Run Keyword And Ignore Error Get From Dictionary ${addFilter} Fromname
${Fromname} Run Keyword If "${return}"=="FAIL" or "${Fromname}"=="${EMPTY}" set variable null
... ELSE set variable ${Fromname}
${return} ${Toname} Run Keyword And Ignore Error Get From Dictionary ${addFilter} Toname
${Toname} Run Keyword If "${return}"=="FAIL" or "${Toname}"=="${EMPTY}" set variable null
... ELSE set variable ${Toname}
${return} ${MAILAccountname} Run Keyword And Ignore Error Get From Dictionary ${addFilter} MAILAccountname
${MAILAccountname} Run Keyword If "${return}"=="FAIL" or "${MAILAccountname}"=="${EMPTY}" set variable null
... ELSE set variable ${MAILAccountname}
${return} ${URIname} Run Keyword And Ignore Error Get From Dictionary ${addFilter} URIname
${URIname} Run Keyword If "${return}"=="FAIL" or "${URIname}"=="${EMPTY}" set variable null
... ELSE set variable ${URIname}
${return} ${FTPContentname} Run Keyword And Ignore Error Get From Dictionary ${addFilter} FTPContentname
${FTPContentname} Run Keyword If "${return}"=="FAIL" or "${FTPContentname}"=="${EMPTY}" set variable null
... ELSE set variable ${FTPContentname}
${return} ${FTPAccountname} Run Keyword And Ignore Error Get From Dictionary ${addFilter} FTPAccountname
${FTPAccountname} Run Keyword If "${return}"=="FAIL" or "${FTPAccountname}"=="${EMPTY}" set variable null
... ELSE set variable ${FTPAccountname}
${return} ${QUICSNIname} Run Keyword And Ignore Error Get From Dictionary ${addFilter} QUICSNIname
${QUICSNIname} Run Keyword If "${return}"=="FAIL" or "${QUICSNIname}"=="${EMPTY}" set variable null
... ELSE set variable ${QUICSNIname}
${return} ${DohHostname} Run Keyword And Ignore Error Get From Dictionary ${addFilter} DohHostname
${DohHostname} Run Keyword If "${return}"=="FAIL" or "${DohHostname}"=="${EMPTY}" set variable null
... ELSE set variable ${DohHostname}
run keyword if "${policyType}"=="Security Policy" Create-SecurityFilter-judge ${Application} ${Filter} ${Hostname} ${URLname} ${Request Headername} ${Response Headername} ${Request Contentname}
... ${Response Contentname} ${SSLSNIname} ${CNname} ${SANname} ${QNAMEname} ${Subjectname} ${MAILContentname} ${Attachment Namename}
... ${Attachment Contentname} ${Fromname} ${Toname} ${MAILAccountname} ${URIname} ${FTPContentname} ${FTPAccountname} ${QUICSNIname}
run keyword if "${policyType}"=="Proxy Policy" Create-ProxyFilter ${Application} ${Filter} ${Hostname} ${URLname} ${Request Headername} ${Response Headername} ${Request Contentname}
... ${Response Contentname} ${QNAMEname} ${DohHostname}
Create-SecurityFilter-judge
2021-02-20 17:08:43 +08:00
[Arguments] ${Application}=null ${Filter}=null ${Hostname}=null ${URLname}=null ${Request Headername}=null ${Response Headername}=null ${Request Contentname}=null
... ${Response Contentname}=null ${SSLSNIname}=null ${CNname}=null ${SANname}=null ${QNAMEname}=null ${Subjectname}=null ${MAILContentname}=null ${Attachment Namename}=null
... ${Attachment Contentname}=null ${Fromname}=null ${Toname}=null ${MAILAccountname}=null ${URIname}=null ${FTPContentname}=null ${FTPAccountname}=null ${QUICSNIname}=null
[Documentation] 调用次关键字前需要添加必填参数:
... ${Application}:填入是Application的内容, 例如SSL或HTTP
... ${Filter}:是一个列表, 列表中填入filter类型, 例如Host或URL等
... name:各个对象名称的列表
... 判断filter是否可以点击
${class}= Get Element Attribute xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[8]/div[1]/div/div[1] class
run keyword if "${class}"=="addobject addobject-long-list obj-content-null filter-width-style cursor addobject-long-list-disabled" log filter不可点击, 不可添加filter
run keyword if "${class}"=="addobject addobject-long-list obj-content-null filter-width-style cursor" run keywords sleep 1
2021-02-25 14:25:45 +08:00
... AND Create-SecurityFilter ${Application} ${Filter} ${Hostname} ${URLname} ${Request Headername} ${Response Headername} ${Request Contentname}
2021-02-20 17:08:43 +08:00
... ${Response Contentname} ${SSLSNIname} ${CNname} ${SANname} ${QNAMEname} ${Subjectname} ${MAILContentname} ${Attachment Namename}
... ${Attachment Contentname} ${Fromname} ${Toname} ${MAILAccountname} ${URIname} ${FTPContentname} ${FTPAccountname} ${QUICSNIname}
2021-02-25 14:25:45 +08:00
Create-SecurityFilter
2021-02-20 17:08:43 +08:00
[Arguments] ${Application} ${Filter} ${Hostname} ${URLname} ${Request Headername} ${Response Headername} ${Request Contentname}
... ${Response Contentname} ${SSLSNIname} ${CNname} ${SANname} ${QNAMEname} ${Subjectname} ${MAILContentname} ${Attachment Namename}
... ${Attachment Contentname} ${Fromname} ${Toname} ${MAILAccountname} ${URIname} ${FTPContentname} ${FTPAccountname} ${QUICSNIname}
[Documentation] 调用次关键字前需要添加必填参数:
... ${Application}:填入是Application的内容, 例如SSL或HTTP
... ${Filter}:是一个列表, 列表中填入filter类型, 例如Host或URL等
... name:各个对象名称的列表
... 判断添加filter类型
sleep 2
2021-02-25 14:25:45 +08:00
log ${Application}
2021-02-20 17:08:43 +08:00
FOR ${i} IN @{Filter}
sleep 1
click element id=interceptionadd_add_filter
sleep 1
run keyword if "${Application}"=="HTTP" and "${i}"=="Host" run keywords sleep 1
... AND click element xpath=//*[@id="condistions_protocol"]/div/div[1]/div/div/div/ul/li[1]
... AND Create-Object-Search ${Hostname} ${i}
run keyword if "${Application}"=="HTTP" and "${i}"=="URL" run keywords sleep 1
... AND click element xpath=//*[@id="condistions_protocol"]/div/div[1]/div/div/div/ul/li[2]
... AND Create-Object-Search ${URLname} ${i}
run keyword if "${Application}"=="HTTP" and "${i}"=="Request Header" run keywords sleep 1
... AND click element xpath=//*[@id="condistions_protocol"]/div/div[1]/div/div/div/ul/li[3]
... AND Create-Object-Search ${Request Headername} ${i}
run keyword if "${Application}"=="HTTP" and "${i}"=="Response Header" run keywords sleep 1
... AND click element xpath=//*[@id="condistions_protocol"]/div/div[1]/div/div/div/ul/li[4]
... AND Create-Object-Search ${Response Headername} ${i}
run keyword if "${Application}"=="HTTP" and "${i}"=="Request Content" run keywords sleep 1
... AND click element xpath=//*[@id="condistions_protocol"]/div/div[1]/div/div/div/ul/li[5]
... AND Create-Object-Search ${Request Contentname} ${i}
run keyword if "${Application}"=="HTTP" and "${i}"=="Response Content" run keywords sleep 1
... AND click element xpath=//*[@id="condistions_protocol"]/div/div[1]/div/div/div/ul/li[6]
... AND Create-Object-Search ${Response Contentname} ${i}
run keyword if "${Application}"=="SSL" and "${i}"=="SNI" run keywords sleep 1
... AND click element xpath=//*[@id="condistions_protocol"]/div/div[1]/div/div/div/ul/li[1]
... AND Create-Object-Search ${SSLSNIname} ${i}
run keyword if "${Application}"=="SSL" and "${i}"=="CN" run keywords sleep 1
... AND click element xpath=//*[@id="condistions_protocol"]/div/div[1]/div/div/div/ul/li[2]
... AND Create-Object-Search ${CNname} ${i}
run keyword if "${Application}"=="SSL" and "${i}"=="SAN" run keywords sleep 1
... AND click element xpath=//*[@id="condistions_protocol"]/div/div[1]/div/div/div/ul/li[3]
... AND Create-Object-Search ${SANname} ${i}
run keyword if "${Application}"=="DNS" and "${i}"=="QNAME" run keywords sleep 1
... AND click element xpath=//*[@id="condistions_protocol"]/div/div[1]/div/div/div/ul/li[1]
... AND Create-Object-Search ${QNAMEname} ${i}
run keyword if "${Application}"=="MAIL" and "${i}"=="Subject" run keywords sleep 1
... AND click element xpath=//*[@id="condistions_protocol"]/div/div[1]/div/div/div/ul/li[1]
... AND Create-Object-Search ${Subjectname} ${i}
run keyword if "${Application}"=="MAIL" and "${i}"=="Content" run keywords sleep 1
... AND click element xpath=//*[@id="condistions_protocol"]/div/div[1]/div/div/div/ul/li[2]
... AND Create-Object-Search ${MAILContentname} ${i}
run keyword if "${Application}"=="MAIL" and "${i}"=="Attachment Name" run keywords sleep 1
... AND click element xpath=//*[@id="condistions_protocol"]/div/div[1]/div/div/div/ul/li[3]
... AND Create-Object-Search ${Attachment Namename} ${i}
run keyword if "${Application}"=="MAIL" and "${i}"=="Attachment Content" run keywords sleep 1
... AND click element xpath=//*[@id="condistions_protocol"]/div/div[1]/div/div/div/ul/li[4]
... AND Create-Object-Search ${Attachment Contentname} ${i}
run keyword if "${Application}"=="MAIL" and "${i}"=="From" run keywords sleep 1
... AND click element xpath=//*[@id="condistions_protocol"]/div/div[1]/div/div/div/ul/li[5]
... AND Create-Object-Search ${Fromname} ${i}
run keyword if "${Application}"=="MAIL" and "${i}"=="To" run keywords sleep 1
... AND click element xpath=//*[@id="condistions_protocol"]/div/div[1]/div/div/div/ul/li[6]
... AND Create-Object-Search ${Toname} ${i}
run keyword if "${Application}"=="MAIL" and "${i}"=="Account" run keywords sleep 1
... AND click element xpath=//*[@id="condistions_protocol"]/div/div[1]/div/div/div/ul/li[7]
... AND Create-Object-Search ${MAILAccountname} ${i}
run keyword if "${Application}"=="FTP" and "${i}"=="URI" run keywords sleep 1
... AND click element xpath=//*[@id="condistions_protocol"]/div/div[1]/div/div/div/ul/li[1]
... AND Create-Object-Search ${URIname} ${i}
run keyword if "${Application}"=="FTP" and "${i}"=="Content" run keywords sleep 1
... AND click element xpath=//*[@id="condistions_protocol"]/div/div[1]/div/div/div/ul/li[2]
... AND Create-Object-Search ${FTPContentname} ${i}
run keyword if "${Application}"=="FTP" and "${i}"=="Account" run keywords sleep 1
... AND click element xpath=//*[@id="condistions_protocol"]/div/div[1]/div/div/div/ul/li[3]
... AND Create-Object-Search ${FTPAccountname} ${i}
run keyword if "${Application}"=="QUIC" and "${i}"=="SNI" run keywords sleep 1
... AND click element xpath=//*[@id="condistions_protocol"]/div/div[1]/div/div/div/ul/li[1]
... AND Create-Object-Search ${QUICSNIname} ${i}
END
2021-02-25 14:25:45 +08:00
Create-ProxyFilter
[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
2021-02-20 17:08:43 +08:00
Deny-subaction
2021-02-25 14:25:45 +08:00
[Arguments] ${action} ${subaction} ${subactionadd}
2021-02-20 17:08:43 +08:00
[Documentation] 调用次关键字前需要添加必填参数:
... ${code}:填入403或404
... ${Content}:填入TEXT或Profile
... ${SearchorCreate}:填入Search或Create
... ${block-text}:填入TEXT文本框内容
... ${ProfileName}:Profile的名字
... ${file}:上传文件路径
... ${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值
... 添加subaction
2021-02-25 14:25:45 +08:00
${return} ${code} Run Keyword And Ignore Error Get From Dictionary ${subactionadd} code
${code} Run Keyword If "${return}"=="FAIL" or "${code}"=="${EMPTY}" set variable null
... ELSE set variable ${code}
${return} ${Content} Run Keyword And Ignore Error Get From Dictionary ${subactionadd} Content
${Content} Run Keyword If "${return}"=="FAIL" or "${Content}"=="${EMPTY}" set variable null
... ELSE set variable ${Content}
${return} ${block-text} Run Keyword And Ignore Error Get From Dictionary ${subactionadd} block-text
${block-text} Run Keyword If "${return}"=="FAIL" or "${block-text}"=="${EMPTY}" set variable null
... ELSE set variable ${block-text}
${return} ${SearchorCreate} Run Keyword And Ignore Error Get From Dictionary ${subactionadd} SearchorCreate
${SearchorCreate} Run Keyword If "${return}"=="FAIL" or "${SearchorCreate}"=="${EMPTY}" set variable null
... ELSE set variable ${SearchorCreate}
${return} ${ProfileName} Run Keyword And Ignore Error Get From Dictionary ${subactionadd} ProfileName
${ProfileName} Run Keyword If "${return}"=="FAIL" or "${ProfileName}"=="${EMPTY}" set variable null
... ELSE set variable ${ProfileName}
${return} ${file} Run Keyword And Ignore Error Get From Dictionary ${subactionadd} file
${file} Run Keyword If "${return}"=="FAIL" or "${file}"=="${EMPTY}" set variable null
... ELSE set variable ${file}
${return} ${QType} Run Keyword And Ignore Error Get From Dictionary ${subactionadd} QType
${QType} Run Keyword If "${return}"=="FAIL" or "${QType}"=="${EMPTY}" set variable null
... ELSE set variable ${QType}
${return} ${Avalue} Run Keyword And Ignore Error Get From Dictionary ${subactionadd} Avalue
${Avalue} Run Keyword If "${return}"=="FAIL" or "${Avalue}"=="${EMPTY}" set variable null
... ELSE set variable ${Avalue}
${return} ${Attl} Run Keyword And Ignore Error Get From Dictionary ${subactionadd} Attl
${Attl} Run Keyword If "${return}"=="FAIL" or "${Attl}"=="${EMPTY}" set variable null
... ELSE set variable ${Attl}
${return} ${CNAMEvalue} Run Keyword And Ignore Error Get From Dictionary ${subactionadd} CNAMEvalue
${CNAMEvalue} Run Keyword If "${return}"=="FAIL" or "${CNAMEvalue}"=="${EMPTY}" set variable null
... ELSE set variable ${CNAMEvalue}
${return} ${CNAMEttl} Run Keyword And Ignore Error Get From Dictionary ${subactionadd} CNAMEttl
${CNAMEttl} Run Keyword If "${return}"=="FAIL" or "${CNAMEttl}"=="${EMPTY}" set variable null
... ELSE set variable ${CNAMEttl}
2021-02-20 17:08:43 +08:00
run keyword if "${action}"=="deny" and "${subaction}"=="Drop" run keywords sleep 1
... AND click element id=denyUserRegionBlock_method0
run keyword if "${action}"=="deny" and "${subaction}"=="RST" run keywords sleep 1
... AND click element id=denyUserRegionBlock_method1
run keyword if "${action}"=="deny" and "${subaction}"=="Block" run keywords sleep 1
... AND click element id=denyUserRegionBlock_method2
... AND Deny-Block ${code} ${Content} ${block-text} ${SearchorCreate} ${ProfileName} ${file}
run keyword if "${action}"=="deny" and "${subaction}"=="Alert" run keywords sleep 1
... AND click element id=denyUserRegionBlock_method3
... AND Deny-Block ${code} ${Content} ${block-text} ${SearchorCreate} ${ProfileName} ${file}
run keyword if "${action}"=="deny" and "${subaction}"=="Redirect" run keywords sleep 1
... AND click element id=denyUserRegionBlock_method4
... AND sleep 1
... AND click element id=interceptionadd_rightdetails
... AND sleep 1
... AND Deny-Redirect ${QType} ${Avalue} ${Attl} ${CNAMEvalue} ${CNAMEttl}
Deny-Block
[Arguments] ${code} ${Content} ${block-text} ${SearchorCreate} ${ProfileName} ${file}
[Documentation] 调用次关键字前需要添加必填参数:
... ${code}:填入403或404
... ${Content}:填入TEXT或Profile
... ${SearchorCreate}:填入Search或Create
... ${block-text}:填入TEXT文本框内容
... ${ProfileName}:Profile的名字
... ${file}:上传文件路径
... 添加block数据内容
sleep 1
click element id=denyUserRegionBlock_code
run keyword if "${code}"=="403" or "${code}"=="200" run keywords sleep 1
... AND click element id=denyUserRegionBlock_code_select0
... AND sleep 1
... AND click element id=blockselect
... ELSE IF "${code}"=="404" run keywords sleep 1
... AND click element id=denyUserRegionBlock_code_select1
... AND sleep 1
... AND click element id=blockselect
... ELSE IF "${code}"=="204" run keywords sleep 1
... AND click element id=denyUserRegionBlock_code_select1
run keyword if "${Content}"=="TEXT" run keywords sleep 1
... AND click element id=blockselect_select0
... AND sleep 1
... AND input text id=denyUserRegionBlock_message ${block-text}
... ELSE IF "${Content}"=="Profile" run keywords sleep 1
... AND click element id=blockselect_select1
... AND sleep 1
... AND Profile-SearchorCreate ${SearchorCreate} ${ProfileName} ${file}
Profile-SearchorCreate
[Arguments] ${SearchorCreate} ${ProfileName} ${file}
[Documentation] 调用次关键字前需要添加必填参数:
... ${SearchorCreate}:填入Search或Create
... ${ProfileName}:Profile的名字
... ${file}:上传文件路径
... 判断是新建还是搜索profile
sleep 1
click element id=html_profile
sleep 1
run keyword if "${SearchorCreate}"=="Search" run keywords sleep 1
... AND input text id=filedata_profileName ${ProfileName}
... AND sleep 1
... AND press keys id=filedata_profileName ENTER
... AND sleep 1
... AND click element id=filelist_select0
... ELSE IF "${SearchorCreate}"=="Create" run keywords sleep 1
... AND click element id=interceptionadd_fileadd
... AND sleep 1
... AND input text id=responsepages_profileName ${ProfileName}
... AND sleep 1
... AND Choose File xpath=//*[@id="policy_Manipulation_create6"]/div[2]/form/div[2]/div/div/div/input ${file} #上传文件
... AND sleep 1
... AND clcik element id=responseAddOk1
... 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
run keyword if "${QType}"=="A" run keywords sleep 1
... AND input text id=A00 ${Avalue}
... AND sleep 1
... AND input text id=ttl00 ${Attl}
... AND sleep 1
... AND click element id=interceptionadd_addForm
... AND sleep 1
... AND input text id=Cname01 ${CNAMEvalue}
... AND sleep 1
... AND input text id=ttl01 ${CNAMEttl}
run keyword if "${QType}"=="AAAA" run keywords sleep 1
... AND click element id=dns_qtype_radio01
... AND input text id=AAAA00 ${Avalue}
... AND sleep 1
... AND input text id=ttl00 ${Attl}
... AND sleep 1
... AND click element id=interceptionadd_addForm
... AND sleep 1
... AND input text id=Cname01 ${CNAMEvalue}
... AND sleep 1
... AND input text id=ttl01 ${CNAMEttl}
sleep 1
click element id=interceptionadd_shezhidns
2021-02-25 14:25:45 +08:00
interceptadd
[Arguments] ${Keyring} ${MirrorDecryptedTrafficInfo} ${DecryptionProfile}
[Documentation] 引用次关键字,填入必填参数
... 必填参数:
... ${Keyring}:新建或替换证书的参数,字典
... ${MirrorDecryptedTrafficInfo}:新建解密流量参数,字典
... ${DecryptionProfile}:新建或修改属性参数,字典
Run Keyword If "${Keyring}"=="${EMPTY}" log there is no KeyringInfo
... ELSE Intercept-SSL-Keyring-SearchorCreate ${Keyring}
Run Keyword If "${MirrorDecryptedTrafficInfo}"=="${EMPTY}" log there is no MirrorDecryptedTrafficInfo
... ELSE Intercept-SSL-MirrorDecryptedTraffic-Open ${MirrorDecryptedTrafficInfo}
Run Keyword If "${DecryptionProfile}"=="${EMPTY}" log there is no interceptaddInfo
... ELSE DecryptionProfile-SearchorCreate ${DecryptionProfile}
2021-02-20 17:08:43 +08:00
Intercept-SSL-Keyring-SearchorCreate
2021-02-25 14:25:45 +08:00
[Arguments] ${Keyring}
2021-02-20 17:08:43 +08:00
[Documentation] 引用次关键字,填入必填参数
... 必填参数:
... ${KeySearchorCreate}:填入Create或Search
... ${name}:新建页面name输入框里的内容
... ${file}:上传文件所在本地的路径
... ${file1}:上传文件所在本地的路径
... ${ExpiryHours1or2}:根证书时间填入1: 自定义定义 2:原时间
... ${type}:上传证书类型的元素
... ${type1}:上传证书加密解密算法的元素
... ${shift}:是否打开客户端包含证书按钮
... ${PrivateKeyType}:私钥类型
2021-02-25 14:25:45 +08:00
${return} ${KeySearchorCreate} Run Keyword And Ignore Error Get From Dictionary ${Keyring} KeySearchorCreate
${KeySearchorCreate} Run Keyword If "${return}"=="FAIL" or "${KeySearchorCreate}"=="${EMPTY}" set variable null
... ELSE set variable ${KeySearchorCreate}
${return} ${keyname} Run Keyword And Ignore Error Get From Dictionary ${Keyring} keyname
${keyname} Run Keyword If "${return}"=="FAIL" or "${keyname}"=="${EMPTY}" set variable null
... ELSE set variable ${keyname}
${return} ${file} Run Keyword And Ignore Error Get From Dictionary ${Keyring} file
${file} Run Keyword If "${return}"=="FAIL" or "${file}"=="${EMPTY}" set variable null
... ELSE set variable ${file}
${return} ${file1} Run Keyword And Ignore Error Get From Dictionary ${Keyring} file1
${file1} Run Keyword If "${return}"=="FAIL" or "${file1}"=="${EMPTY}" set variable null
... ELSE set variable ${file1}
${return} ${ExpiryHours1or2} Run Keyword And Ignore Error Get From Dictionary ${Keyring} ExpiryHours1or2
${ExpiryHours1or2} Run Keyword If "${return}"=="FAIL" or "${ExpiryHours1or2}"=="${EMPTY}" set variable null
... ELSE set variable ${ExpiryHours1or2}
${return} ${type} Run Keyword And Ignore Error Get From Dictionary ${Keyring} type
${type} Run Keyword If "${return}"=="FAIL" or "${type}"=="${EMPTY}" set variable null
... ELSE set variable ${type}
${return} ${type1} Run Keyword And Ignore Error Get From Dictionary ${Keyring} type1
${type1} Run Keyword If "${return}"=="FAIL" or "${type1}"=="${EMPTY}" set variable null
... ELSE set variable ${type1}
${return} ${shift} Run Keyword And Ignore Error Get From Dictionary ${Keyring} shift
${shift} Run Keyword If "${return}"=="FAIL" or "${shift}"=="${EMPTY}" set variable null
... ELSE set variable ${shift}
${return} ${PrivateKeyType} Run Keyword And Ignore Error Get From Dictionary ${Keyring} PrivateKeyType
${PrivateKeyType} Run Keyword If "${return}"=="FAIL" or "${PrivateKeyType}"=="${EMPTY}" set variable null
... ELSE set variable ${PrivateKeyType}
2021-02-20 17:08:43 +08:00
sleep 1
click element id=interceptionadd_eventkeying1
sleep 1
run keyword if "${KeySearchorCreate}"=="Create" run keywords sleep 1
... AND click element id=interceptionadd_keyadd
... AND sleep 2
... AND Create-Keyring ${keyname} ${file} ${file1} ${ExpiryHours1or2} ${type} ${type1}
... ${shift}=close ${PrivateKeyType}=PrivateKeyFile
run keyword if "${KeySearchorCreate}"=="Search" run keywords sleep 1
... AND input text id=card_keyringName1 ${keyname}
... AND sleep 1
... AND press keys id=card_keyringName1 ENTER
... AND sleep 1
... AND clcik element id=card_keylist0
Create-Keyring
[Arguments] ${name} ${file} ${file1} ${ExpiryHours1or2} ${type} ${type1}
... ${shift}=close ${PrivateKeyType}=PrivateKeyFile
[Documentation] 引用次关键字,填入必填参数
... 必填参数:
... ${name}:新建页面name输入框里的内容
... ${file}:上传文件所在本地的路径
... ${file1}:上传文件所在本地的路径
... ${ExpiryHours1or2}:根证书时间填入1: 自定义定义 2:原时间
... ${type}:上传证书类型的元素
... ${type1}:上传证书加密解密算法的元素
... ${shift}:是否打开客户端包含证书按钮
... ${PrivateKeyType}:私钥类型
Sleep 2
input id=keyringsadd_name ${name} #输入name
Sleep 2
Choose File xpath=//*[@id="app"]/div/div[3]/div[2]/div/div/div[2]/div[2]/form/div[2]/div/div/div/input ${file} #上传文件
Sleep 2
Choose File xpath=//*[@id="app"]/div/div[3]/div[2]/div/div/div[2]/div[2]/form/div[3]/div/div[2]/div/div/input ${file1} #上传文件
${select} Set Variable ${ExpiryHours1or2}
Run Keyword If '${select}'=='1' click element id=keyringsadd_customized
Run Keyword If '${select}'=='1' input text id=reissueExpiryDate 10
sleep 1
click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div/div[2]/div[2]/form/div[6]/div/div/div[1]/span/span/i #点击下拉框
sleep 1
click element ${type} #选择证书类型
sleep 1
click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div/div[2]/div[2]/form/div[7]/div/div/div[1]/span/span/i #点击下拉框
sleep 1
click element ${type1} #选择加密解密类型
sleep 1
${root} Set Variable ${shift}
run keyword if "${root}"=="open" run keywords sleep 1
... AND click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div/div[2]/div[2]/form/div[9]/div/div/span
... ELSE IF "${root}"=="close" log "go on"
Run Keyword If '${PrivateKeyType}'=='HSM' run keywords sleep 1
... AND click element id=privateHSM
... AND sleep 1
... AND input text id=keyringsadd_slotid 10
sleep 1
click id=keyringsadd_sub #点击OK缇交
Intercept-SSL-MirrorDecryptedTraffic-Open
2021-02-25 14:25:45 +08:00
[Arguments] ${MirrorDecryptedTrafficInfo}
2021-02-20 17:08:43 +08:00
[Documentation] 引用次关键字,填入必填参数
... 必填参数:
... ${MirrorDecryptedTraffic}:输入open代表开启按钮, 其他代表不开启
... ${MirrorDecryptedTrafficSearchorCreate}: 填入Create或Search
... ${MirrorDecryptedTrafficname}:解密流量文件的name
... ${type}:是mac还是vlan的定位元素
... ${shuru}:输入mac或vlan的值
2021-02-25 14:25:45 +08:00
${return} ${MirrorDecryptedTraffic} Run Keyword And Ignore Error Get From Dictionary ${MirrorDecryptedTrafficInfo} MirrorDecryptedTraffic
${MirrorDecryptedTraffic} Run Keyword If "${return}"=="FAIL" or "${MirrorDecryptedTraffic}"=="${EMPTY}" set variable null
... ELSE set variable ${MirrorDecryptedTraffic}
${return} ${MirrorDecryptedTrafficSearchorCreate} Run Keyword And Ignore Error Get From Dictionary ${MirrorDecryptedTrafficInfo} MirrorDecryptedTrafficSearchorCreate
${MirrorDecryptedTrafficSearchorCreate} Run Keyword If "${return}"=="FAIL" or "${MirrorDecryptedTrafficSearchorCreate}"=="${EMPTY}" set variable null
... ELSE set variable ${MirrorDecryptedTrafficSearchorCreate}
${return} ${MirrorDecryptedTrafficname} Run Keyword And Ignore Error Get From Dictionary ${MirrorDecryptedTrafficInfo} MirrorDecryptedTrafficname
${MirrorDecryptedTrafficname} Run Keyword If "${return}"=="FAIL" or "${MirrorDecryptedTrafficname}"=="${EMPTY}" set variable null
... ELSE set variable ${MirrorDecryptedTrafficname}
${return} ${type} Run Keyword And Ignore Error Get From Dictionary ${MirrorDecryptedTrafficInfo} type
${type} Run Keyword If "${return}"=="FAIL" or "${type}"=="${EMPTY}" set variable null
... ELSE set variable ${type}
${return} ${shuru} Run Keyword And Ignore Error Get From Dictionary ${MirrorDecryptedTrafficInfo} shuru
${shuru} Run Keyword If "${return}"=="FAIL" or "${shuru}"=="${EMPTY}" set variable null
... ELSE set variable ${shuru}
2021-02-20 17:08:43 +08:00
sleep 1
run keyword if "${MirrorDecryptedTraffic}"=="open" run keywords sleep 1
... AND click element xpath=///*[@id="policy_paper_left"]/div[10]/div[2]/label[contains(text(), "Mirror Decrypted Traffic")]/following-sibling::div/div
... AND sleep 1
... AND clcik element id=mirror_profile
... AND MirrorDecryptedTraffic-SearchorCreate ${MirrorDecryptedTrafficSearchorCreate} ${MirrorDecryptedTrafficname} ${type} ${shuru}
... ELSE log 不开启
MirrorDecryptedTraffic-SearchorCreate
[Arguments] ${MirrorDecryptedTrafficSearchorCreate} ${MirrorDecryptedTrafficname} ${type} ${shuru}
[Documentation] 引用次关键字,填入必填参数
... 必填参数:
... ${MirrorDecryptedTrafficSearchorCreate}: 填入Create或Search
... ${MirrorDecryptedTrafficname}:解密流量文件的name
... ${type}:是mac还是vlan的定位元素
... ${shuru}:输入mac或vlan的值
sleep 1
run keyword if "${MirrorDecryptedTrafficSearchorCreate}"=="Create" run keywords sleep 1
... AND click element id=interceptionadd_trarightadd
... AND sleep 2
... AND Create-MirrorDecryptedTraffic ${MirrorDecryptedTrafficname} ${type} ${shuru}
run keyword if "${MirrorDecryptedTrafficSearchorCreate}"=="Search" run keywords sleep 1
... AND input text id=tradata_profileName ${MirrorDecryptedTrafficname}
... AND sleep 1
... AND press keys id=tradata_profileName ENTER
... AND sleep 1
... AND clcik element id=tralist_length0
Create-MirrorDecryptedTraffic
[Arguments] ${MirrorDecryptedTrafficname} ${type} ${shuru}
[Documentation] 引用次关键字,填入必填参数
... 必填参数:
... ${MirrorDecryptedTrafficname}:解密流量文件的name
... ${type}:是mac还是vlan的定位元素
... ${shuru}:输入mac或vlan的值
Sleep 2
input id=trafficmirror_profileName ${MirrorDecryptedTrafficname} #输入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[2]/div/div/div[2]/button[1] #点击OK
DecryptionProfile-SearchorCreate
2021-02-25 14:25:45 +08:00
[Arguments] ${DecryptionProfile}
2021-02-20 17:08:43 +08:00
[Documentation] 引用次关键字,填入必填参数
... 必填参数:
... ${DecryptionProfileSearchorCreate}: 填入Create或Search
... ${DecryptionProfilename}:文件name
... ${dict1}:是个字典, 等于1为开启, 等于0为关闭, 例如: Common Name=1 Issuer=1 Self-signed=1 Expiry Date=1 EV Certificat=1
... Certificate Transparency=1 Mutual Authentication=1 On Protocol Errors=1 Certificate Pinning=1 Certificate Not Installed=1 Mirror Client Versions=1
... Allow HTTP/2=1
... ${fail1} :输入Fail-close或Pass-through
... ${min1}:输入协议版本,
... ${max1}:输入协议版本,
2021-02-25 14:25:45 +08:00
${return} ${DecryptionProfileSearchorCreate} Run Keyword And Ignore Error Get From Dictionary ${DecryptionProfile} DecryptionProfileSearchorCreate
${DecryptionProfileSearchorCreate} Run Keyword If "${return}"=="FAIL" or "${DecryptionProfileSearchorCreate}"=="${EMPTY}" set variable null
... ELSE set variable ${DecryptionProfileSearchorCreate}
${return} ${DecryptionProfilename} Run Keyword And Ignore Error Get From Dictionary ${DecryptionProfile} DecryptionProfilename
${DecryptionProfilename} Run Keyword If "${return}"=="FAIL" or "${DecryptionProfilename}"=="${EMPTY}" set variable null
... ELSE set variable ${DecryptionProfilename}
${return} ${dict1} Run Keyword And Ignore Error Get From Dictionary ${DecryptionProfile} dict1
${dict1} Run Keyword If "${return}"=="FAIL" or "${dict1}"=="${EMPTY}" set variable null
... ELSE set variable ${dict1}
${return} ${fail1} Run Keyword And Ignore Error Get From Dictionary ${DecryptionProfile} fail1
${fail1} Run Keyword If "${return}"=="FAIL" or "${fail1}"=="${EMPTY}" set variable null
... ELSE set variable ${fail1}
${return} ${min1} Run Keyword And Ignore Error Get From Dictionary ${DecryptionProfile} min1
${min1} Run Keyword If "${return}"=="FAIL" or "${min1}"=="${EMPTY}" set variable null
... ELSE set variable ${min1}
${return} ${max1} Run Keyword And Ignore Error Get From Dictionary ${DecryptionProfile} max1
${max1} Run Keyword If "${return}"=="FAIL" or "${max1}"=="${EMPTY}" set variable null
... ELSE set variable ${max1}
2021-02-20 17:08:43 +08:00
sleep 1
click element id=interceptionadd_eventkeying
sleep 1
run keyword if "${DecryptionProfileSearchorCreate}"=="Create" run keywords sleep 1
... AND click element id=interceptionadd_decryptionProfileId
... AND sleep 2
... AND Create-DecryptionProfile ${DecryptionProfilename} ${dict1} ${fail1} ${min1} ${max1}
run keyword if "${DecryptionProfileSearchorCreate}"=="Search" run keywords sleep 1
... AND input text id=card_keyringName ${DecryptionProfilename}
... AND sleep 1
... AND press keys id=card_keyringName ENTER
... AND sleep 1
... AND clcik element xpath=//*[@id="decryptionProfileList"]/following-sibling::li[2]
Create-DecryptionProfile
[Arguments] ${name} ${dict1} ${fail1} ${min1} ${max1}
Sleep 1
input id=insert_profileName ${name}
Sleep 1
DecryptionProfileButtonSwitch ${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
Settings-Search ${name} ${search} #搜索框的关键字
sleep 2
${name1} get text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[3]/div/div/div[2]/div/div[3]/table/tbody/tr/td[2]/div/div/span
Should Be Equal As Strings ${name1} ${name}
DecryptionProfileButtonSwitch
[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 默认关闭,不进行操作
END
LogSession
[Arguments] ${LogSession}
[Documentation] 调用次关键字前需要添加必填参数:
... ${LogSession}:填入clcos或其他
run keyword if "${LogSession}"=="close" run keywords sleep 1
... AND click element id=addlabel_labels_log
... ELSE log 开启日志
Enabled
[Arguments] ${Enabled}
[Documentation] 调用次关键字前需要添加必填参数:
... ${Enabled}:填入open或其他
run keyword if "${Enabled}"=="open" run keywords sleep 1
... AND click element xpath=//*[@id="policy_paper_left"]/div/label[contains(text(), "Enabled")]/following-sibling::div/div
... AND sleep 2
... AND click element xpath=/html/body/div/div/div[3]/button[2]
... ELSE log 开启日志
Security-Policies-OK
sleep 1
click element id=interceptionadd_sub
Create-Object-Search
[Arguments] ${name} ${filter}
[Documentation] 调用次关键字前需要添加必填参数:
... ${name}:填入是一个列表, 列表内容为object的name
... 选择search对象
sleep 1
click element xpath=//*[@id="policy_paper_left"]/div[8]/div/div[1]/label[contains(text(), "${filter}")]/following-sibling::div/div
sleep 1
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 1
press keys xpath=//*[@id="condistions_protocol"]/div[2]/p[contains(text(), "${filter}")]/following-sibling::div[2]/div/div[1]/input ENTER
sleep 1
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 1
END
2021-02-25 14:25:45 +08:00
SourceIPCreateOrSearch
[Arguments] ${policytype} ${CreateOrSearch} ${Add} ${ip_type} ${name} ${object_name} ${ipclienttext1}
... ${port} ${Country} ${City} ${fqdn} ${Protocols1} ${Degree} ${times} ${numbers} ${limits}
2021-02-20 17:08:43 +08:00
[Documentation] 调用次关键字前需要添加必填参数:
... ${CreateOrSearch}:填入Create或者Search
... ${Add}:填入Address或Group
... ${name}:名称
... ${ip_type}:填入Ip或者Geography或者IPLearning
... ${ipclienttext1}:填入IPV4或6的值或range的ip段
2021-02-25 14:25:45 +08:00
... ${port}:填入端口
2021-02-20 17:08:43 +08:00
... ${Country}:列表形式,列表中是国家名字
... ${City}:列表形式,列表中是城市名字
... ${Protocols1}:填入HTTP或SSL或HTTPSSL
... ${Degree}:填入1Degree或2Degree
... ${times}:填入小时数, 例如1或2
... ${numbers}:填入数值, 例如1或10000
... ${limits}:填入数值, 例如1或10000
... ${object_name}:列表形式,列表中是对象的名字
... 判断是新建ip还是搜索添加ip
2021-02-25 14:25:45 +08:00
run keyword if "${CreateOrSearch}"=="Create" run keywords sleep ${sleep}
2021-02-20 17:08:43 +08:00
... AND click element id=interceptionadd_proaddaddSource
2021-02-25 14:25:45 +08:00
... AND SourceIPAdd ${policytype} ${Add} ${ip_type} ${name} ${object_name} ${ipclienttext1} ${port} ${Country} ${City} ${fqdn} ${Protocols1} ${Degree} ${times} ${numbers} ${limits}
... ELSE IF "${CreateOrSearch}"=="Search" run keywords sleep ${sleep}
... AND SourceSearch ${policytype} ${object_name}
2021-02-20 17:08:43 +08:00
SUBIDCreateOrSearch
2021-02-25 14:25:45 +08:00
[Arguments] ${policytype} ${CreateOrSearch} ${Add} ${name} ${keywordtext} ${object_name}
2021-02-20 17:08:43 +08:00
[Documentation] 调用次关键字前需要添加必填参数:
... ${CreateOrSearch}:填入Create或者Search
... ${name}:名称
... ${keywordtext}:填入新建subid的内容
... ${object_name}:列表形式,列表中是对象的名字
... 判断是新建subid还是搜索添加subid
2021-02-25 14:25:45 +08:00
run keyword if "${CreateOrSearch}"=="Create" run keywords sleep ${sleep}
2021-02-20 17:08:43 +08:00
... AND click element id=interceptionadd_proaddaddSource
2021-02-25 14:25:45 +08:00
... AND SUBIDAdd ${policytype} ${Add} ${name} ${keywordtext} ${object_name}
... ELSE IF "${CreateOrSearch}"=="Search" run keywords sleep ${sleep}
... AND SourceSearch ${policytype} ${object_name}
2021-02-20 17:08:43 +08:00
DestinationIPCreateOrSearch
2021-02-25 14:25:45 +08:00
[Arguments] ${policytype} ${CreateOrSearch} ${Add} ${ip_type} ${name} ${object_name} ${ipclienttext1}
... ${port} ${Country} ${City} ${fqdn} ${Protocols1} ${Degree} ${times} ${numbers} ${limits}
2021-02-20 17:08:43 +08:00
[Documentation] 调用次关键字前需要添加必填参数:
... ${CreateOrSearch}:填入Create或者Search
... ${Add}:填入Address或Group
... ${name}:名称
... ${ip_type}:填入Ip或者Geography或者IPLearning
... ${ipclienttext1}:填入IPV4或6的值或range的ip段
2021-02-25 14:25:45 +08:00
... ${port}:填入端口
2021-02-20 17:08:43 +08:00
... ${Country}:列表形式,列表中是国家名字
... ${City}:列表形式,列表中是城市名字
... ${Protocols1}:填入HTTP或SSL或HTTPSSL
... ${Degree}:填入1Degree或2Degree
... ${times}:填入小时数, 例如1或2
... ${numbers}:填入数值, 例如1或10000
... ${limits}:填入数值, 例如1或10000
... ${object_name}:列表形式,列表中是对象的名字
... 判断是新建ip还是搜索添加ip
2021-02-25 14:25:45 +08:00
run keyword if "${CreateOrSearch}"=="Create" run keywords sleep ${sleep}
2021-02-20 17:08:43 +08:00
... AND click element id=interceptionadd_proaddaddDestination
2021-02-25 14:25:45 +08:00
... AND DestinationIPAdd ${policytype} ${Add} ${ip_type} ${name} ${object_name} ${ipclienttext1} ${port} ${Country} ${City} ${fqdn} ${Protocols1} ${Degree} ${times} ${numbers} ${limits}
... ELSE IF "${CreateOrSearch}"=="Search" run keywords sleep ${sleep}
... AND DestinationSearch ${policytype} ${object_name}
2021-02-20 17:08:43 +08:00
SourceSearch
2021-02-25 14:25:45 +08:00
[Arguments] ${policytype} ${name}
2021-02-20 17:08:43 +08:00
[Documentation] 调用次关键字前需要添加必填参数:
... ${name}:填入是一个列表, 列表内容为source的name
... 选择search对象
FOR ${i} IN @{name}
2021-02-25 14:25:45 +08:00
input text xpath=${policytype}/div[2]/div[1]/div[2]/div[2]/div/div[1]/input ${i}
sleep ${sleep}
press keys xpath=${policytype}/div[2]/div[1]/div[2]/div[2]/div/div[1]/input ENTER
sleep ${sleep}
click element xpath=${policytype}/div[2]/div[1]/div[2]/div[2]/div/div[2]/div/div/ul/li[1]
sleep ${sleep}
2021-02-20 17:08:43 +08:00
END
DestinationSearch
2021-02-25 14:25:45 +08:00
[Arguments] ${policytype} ${name}
2021-02-20 17:08:43 +08:00
[Documentation] 调用次关键字前需要添加必填参数:
... ${name}:填入是一个列表, 列表内容为source的name
... 选择search对象
FOR ${i} IN @{name}
2021-02-25 14:25:45 +08:00
input text xpath=${policytype}/div[2]/div[1]/div[2]/div[2]/div/div[1]/input ${i}
sleep ${sleep}
press keys xpath=${policytype}/div[2]/div[1]/div[2]/div[2]/div/div[1]/input ENTER
sleep ${sleep}
click element xpath=${policytype}/div[2]/div[1]/div[2]/div[2]/div/div[2]/div/div/ul/li[1]
sleep ${sleep}
2021-02-20 17:08:43 +08:00
END
SUBIDAdd
2021-02-25 14:25:45 +08:00
[Arguments] ${policytype} ${Add} ${name} ${keywordtext} ${object_name}
2021-02-20 17:08:43 +08:00
[Documentation] 调用次关键字前需要添加必填参数:
... ${Add}:填入Address或Group
... ${name}:名称
... ${keywordtext}:填入新建subid的内容
... ${object_name}:列表形式,列表中是对象的名字
... 判断是新建subid还是新建subid分组
2021-02-25 14:25:45 +08:00
run keyword if "${Add}"=="Address" run keywords sleep ${sleep}
2021-02-20 17:08:43 +08:00
... AND click element xpath=/html/body/ul/li[1]
2021-02-25 14:25:45 +08:00
... AND sleep ${sleep}
... AND SUBAddress ${policytype} ${name} ${keywordtext}
... ELSE IF "${Add}"=="Group" run keywords sleep ${sleep}
2021-02-20 17:08:43 +08:00
... AND click element xpath=/html/body/ul/li[2]
2021-02-25 14:25:45 +08:00
... AND sleep ${sleep}
... AND SUBGroupAdd ${policytype} ${name} ${object_name}
2021-02-20 17:08:43 +08:00
SUBAddress
2021-02-25 14:25:45 +08:00
[Arguments] ${policytype} ${name} ${keywordtext}
2021-02-20 17:08:43 +08:00
[Documentation] 调用次关键字前需要添加必填参数:
... ${name}:名称
... ${keywordtext}:填入新建subid的内容
... 新建subid
SourceCreate-name ${name}
2021-02-25 14:25:45 +08:00
click element xpath=${policytype}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[3]/div/div[1]
sleep ${sleep}
2021-02-20 17:08:43 +08:00
Create-SubscriberID-text ${keywordtext}
2021-02-25 14:25:45 +08:00
sleep ${sleep}
click element xpath=${policytype}/div[2]/div[2]/div/div[2]/button[1]
2021-02-20 17:08:43 +08:00
SUBGroupAdd
2021-02-25 14:25:45 +08:00
[Arguments] ${policytype} ${name} ${object_name}
2021-02-20 17:08:43 +08:00
[Documentation] 调用次关键字前需要添加必填参数:
... ${name}:名称
... ${object_name}:列表形式,列表中是对象的名字
... 新建subid分组
SourceCreate-name ${name}
2021-02-25 14:25:45 +08:00
click element xpath=${policytype}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[3]/div/div/div[2]
sleep ${sleep}
2021-02-20 17:08:43 +08:00
Create-Sub-Objects ${object_name}
2021-02-25 14:25:45 +08:00
click element xpath=${policytype}/div[2]/div[2]/div/div[2]/button[1]
SourceIPAdd
[Arguments] ${policytype} ${Add} ${ip_type} ${name} ${object_name} ${ipclienttext1} ${port} ${Country} ${City} ${fqdn} ${Protocols1} ${Degree} ${times} ${numbers} ${limits}
2021-02-20 17:08:43 +08:00
[Documentation] 调用次关键字前需要添加必填参数:
... ${Add}:填入Address或Group
... ${ip_type}:填入IP或者Geography或者IPLearning
... 判断是新建ip还是新建ip分组
2021-02-25 14:25:45 +08:00
run keyword if "${Add}"=="Address" run keywords sleep ${sleep}
2021-02-20 17:08:43 +08:00
... AND click element xpath=/html/body/ul/li[1]
2021-02-25 14:25:45 +08:00
... AND sleep ${sleep}
... AND SourceIPAddress ${policytype} ${name} ${ip_type} ${ipclienttext1} ${port} ${Country} ${City} ${fqdn} ${Protocols1} ${Degree} ${times} ${numbers} ${limits}
... ELSE IF "${Add}"=="Group" run keywords sleep ${sleep}
2021-02-20 17:08:43 +08:00
... AND click element xpath=/html/body/ul/li[2]
2021-02-25 14:25:45 +08:00
... AND sleep ${sleep}
2021-02-20 17:08:43 +08:00
... AND SourceIPGroupAdd ${policytype} ${name} ${ip_type} ${object_name}
SourceIPAddress
2021-02-25 14:25:45 +08:00
[Arguments] ${policytype} ${name} ${ip_type} ${ipclienttext1} ${port} ${Country} ${City} ${fqdn} ${Protocols1} ${Degree} ${times} ${numbers} ${limits}
2021-02-20 17:08:43 +08:00
[Documentation] 调用次关键字前需要添加必填参数:
... ${name}:名称
... ${ip_type}:填入Ip或者Geography或者IPLearning
... ${ipclienttext1}:填入IPV4或6的值或range的ip段
2021-02-25 14:25:45 +08:00
... ${port}:填入端口
2021-02-20 17:08:43 +08:00
... ${Country}:列表形式,列表中是国家名字
... ${City}:列表形式,列表中是城市名字
... ${Protocols1}:填入HTTP或SSL或HTTPSSL
... ${Degree}:填入1Degree或2Degree
... ${times}:填入小时数, 例如1或2
... ${numbers}:填入数值, 例如1或10000
... ${limits}:填入数值, 例如1或10000
... 判断 新建选择用什么样的类型,并进行新建
SourceCreate-name ${name}
2021-02-25 14:25:45 +08:00
sleep ${sleep}
2021-02-20 17:08:43 +08:00
run keyword if "${ip_type}"=="Ip" run keywords click element xpath=${policytype}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[4]/div/div[1]
2021-02-25 14:25:45 +08:00
... AND sleep ${sleep}
... AND NewObject.Create-ip-ClientIP-text ${ipclienttext1} ${port}
2021-02-20 17:08:43 +08:00
run keyword if "${ip_type}"=="Geography" run keywords click element xpath=${policytype}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[3]/div/div/label[2]
2021-02-25 14:25:45 +08:00
... AND sleep ${sleep}
2021-02-20 17:08:43 +08:00
... AND click element xpath=${policytype}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[4]/div/div[1]/div[2]
2021-02-25 14:25:45 +08:00
... AND sleep ${sleep}
2021-02-20 17:08:43 +08:00
... AND NewObject.Create-Geography ${Country} ${City}
2021-02-25 14:25:45 +08:00
... AND sleep ${sleep}
2021-02-20 17:08:43 +08:00
... AND click element xpath=${policytype}/div[2]/div[2]/div/div[1]/div[10]/div/div/div/div[4]/button
2021-02-25 14:25:45 +08:00
... AND sleep ${sleep}
2021-02-20 17:08:43 +08:00
run keyword if "${ip_type}"=="IPLearning" run keywords click element xpath=${policytype}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[3]/div/div/label[3]
2021-02-25 14:25:45 +08:00
... AND sleep ${sleep}
2021-02-20 17:08:43 +08:00
... AND click element xpath=${policytype}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[4]/div/div[1]
2021-02-25 14:25:45 +08:00
... AND sleep ${sleep}
... AND input text xpath=${policytype}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[4]/div/div[3]/div/div[1]/div[2]/div[1]/div[1]/form/div[1]/div/div[1]/input ${fqdn}
... AND sleep ${sleep}
2021-02-20 17:08:43 +08:00
... AND click element xpath=//*[@id="policy_Manipulation2"]/div[1]/div[1]/div[2]/form/div[5]/div[1]/div/div/div[2]
2021-02-25 14:25:45 +08:00
... AND sleep ${sleep}
... AND UIPolicy.Learn-From-Protocols ${Protocols1}
... AND UIPolicy.Learning-Depth ${policytype} ${Degree}
... AND sleep ${sleep}
2021-02-20 17:08:43 +08:00
... AND input text xpath=//*[@id="policy_Manipulation2"]/div[1]/div[1]/div[2]/form/div[5]/div[3]/div/div[1]/input ${times}
2021-02-25 14:25:45 +08:00
... AND sleep ${sleep}
2021-02-20 17:08:43 +08:00
... AND input text xpath=//*[@id="policy_Manipulation2"]/div[1]/div[1]/div[2]/form/div[5]/div[4]/div/div[1]/input ${numbers}
2021-02-25 14:25:45 +08:00
... AND sleep ${sleep}
2021-02-20 17:08:43 +08:00
... AND input text xpath=//*[@id="policy_Manipulation2"]/div[1]/div[1]/div[2]/form/div[5]/div[5]/div/div[1]/input ${limits}
2021-02-25 14:25:45 +08:00
... AND sleep ${sleep}
sleep ${sleep}
2021-02-20 17:08:43 +08:00
SourceCreate-ok
DestinationIPAdd
2021-02-25 14:25:45 +08:00
[Arguments] ${policytype} ${Add} ${ip_type} ${name} ${object_name} ${ipclienttext1} ${port} ${Country} ${City} ${fqdn} ${Protocols1} ${Degree} ${times} ${numbers} ${limits}
2021-02-20 17:08:43 +08:00
[Documentation] 调用次关键字前需要添加必填参数:
... ${Add}:填入Address或Group
... ${ip_type}:填入IP或者Geography或者IPLearning
... 判断是新建ip还是新建ip分组
2021-02-25 14:25:45 +08:00
run keyword if "${Add}"=="Address" run keywords sleep ${sleep}
2021-02-20 17:08:43 +08:00
... AND click element xpath=/html/body/ul[contains(@id,'dropdown-menu' )and @x-placement='bottom-start']/child::li[1]
2021-02-25 14:25:45 +08:00
... AND sleep ${sleep}
... AND DestinationIPAddress ${policytype} ${name} ${ip_type} ${ipclienttext1} ${port} ${Country} ${City} ${fqdn} ${Protocols1} ${Degree} ${times} ${numbers} ${limits}
... ELSE IF "${Add}"=="Group" run keywords sleep ${sleep}
2021-02-20 17:08:43 +08:00
... AND click element xpath=/html/body/ul[contains(@id,'dropdown-menu' )and @x-placement='bottom-start']/child::li[2]
2021-02-25 14:25:45 +08:00
... AND sleep ${sleep}
2021-02-20 17:08:43 +08:00
... AND DestinationIPGroupAdd ${policytype} ${name} ${ip_type} ${object_name}
DestinationIPAddress
2021-02-25 14:25:45 +08:00
[Arguments] ${policytype} ${name} ${ip_type} ${ipclienttext1} ${port} ${Country} ${City} ${fqdn} ${Protocols1} ${Degree} ${times} ${numbers} ${limits}
2021-02-20 17:08:43 +08:00
[Documentation] 调用次关键字前需要添加必填参数:
... ${name}:名称
... ${ip_type}:填入Ip或者Geography或者IPLearning
... ${ipclienttext1}:填入IPV4或6的值或range的ip段
2021-02-25 14:25:45 +08:00
... ${port}:填入端口
2021-02-20 17:08:43 +08:00
... ${Country}:列表形式,列表中是国家名字
... ${City}:列表形式,列表中是城市名字
... ${Protocols1}:填入HTTP或SSL或HTTPSSL
... ${Degree}:填入1Degree或2Degree
... ${times}:填入小时数, 例如1或2
... ${numbers}:填入数值, 例如1或10000
... ${limits}:填入数值, 例如1或10000
... 判断 新建选择用什么样的类型,并进行新建
2021-02-25 14:25:45 +08:00
DestinationCreate-name ${policytype} ${name}
sleep ${sleep}
run keyword if "${ip_type}"=="Ip" run keywords click element xpath=${policytype}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[4]/div/div[1]
... AND sleep ${sleep}
... AND NewObject.Create-ip-ClientIP-text ${ipclienttext1} ${port}
run keyword if "${ip_type}"=="Geography" run keywords click element xpath=${policytype}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[3]/div/div/label[2]
... AND sleep ${sleep}
... AND click element xpath=${policytype}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[4]/div/div[1]/div[2]
... AND sleep ${sleep}
2021-02-20 17:08:43 +08:00
... AND NewObject.Create-Geography ${Country} ${City}
2021-02-25 14:25:45 +08:00
... AND sleep ${sleep}
2021-02-20 17:08:43 +08:00
... AND click element id=interceptionadd_allcancelobjec3t
2021-02-25 14:25:45 +08:00
... AND sleep ${sleep}
run keyword if "${ip_type}"=="IPLearning" run keywords click element xpath=${policytype}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[3]/div/div/label[3]
... AND sleep ${sleep}
... AND click element xpath=${policytype}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[4]/div/div[1]
... AND sleep ${sleep}
... AND input text xpath=${policytype}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[4]/div/div[3]/div/div[1]/div[2]/div[1]/div[1]/form/div[1]/div/div[1]/input ${fqdn}
... AND sleep ${sleep}
... AND click element xpath=${policytype}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[5]/div[1]/div/div/div[2]
... AND sleep ${sleep}
... AND UIPolicy.Learn-From-Protocols ${Protocols1}
... AND UIPolicy.Learning-Depth ${policytype} ${Degree}
... AND sleep ${sleep}
... AND input text xpath=${policytype}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[5]/div[3]/div/div[1]/input ${times}
... AND sleep ${sleep}
... AND input text xpath=${policytype}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[5]/div[4]/div/div[1]/input ${numbers}
... AND sleep ${sleep}
... AND input text xpath=${policytype}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[5]/div[5]/div/div[1]/input ${limits}
... AND sleep ${sleep}
DestinationCreate-ok ${policytype}
2021-02-20 17:08:43 +08:00
Learn-From-Protocols
[Arguments] ${Protocols1}
[Documentation] 调用次关键字前需要添加必填参数:
... ${Protocols1}:填入HTTP或SSL或者HTTPSSL
... 判断选择用什么样的协议
2021-02-25 14:25:45 +08:00
run keyword if "${Protocols1}"=="HTTP" run keywords sleep ${sleep}
... AND click element xpath=/html/body/div/div[1]/div[1]/ul/li[1]
run keyword if "${Protocols1}"=="SSL" run keywords sleep ${sleep}
... AND click element xpath=/html/body/div/div[1]/div[1]/ul/li[2]
run keyword if "${Protocols1}"=="HTTPSSL" run keywords sleep ${sleep}
... AND click element xpath=/html/body/div/div[1]/div[1]/ul/li[1]
... AND sleep ${sleep}
... AND click element xpath=/html/body/div/div[1]/div[1]/ul/li[2]
2021-02-20 17:08:43 +08:00
Learning-Depth
2021-02-25 14:25:45 +08:00
[Arguments] ${policytype} ${Degree}
2021-02-20 17:08:43 +08:00
[Documentation] 调用次关键字前需要添加必填参数:
... ${Degree}:填入1Degree或2Degree
... 判断是用1Degree或2Degree
2021-02-25 14:25:45 +08:00
run keyword if "${Degree}"=="1Degree" run keywords sleep ${sleep}
... AND click element xpath=${policytype}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[5]/div[2]/div/div/label[1]
run keyword if "${Degree}"=="2Degree" run keywords sleep ${sleep}
... AND click element xpath=${policytype}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[5]/div[2]/div/div/label[2]
2021-02-20 17:08:43 +08:00
SourceIPGroupAdd
2021-02-25 14:25:45 +08:00
[Arguments] ${policytype} ${name} ${ip_type} ${object_name}
2021-02-20 17:08:43 +08:00
[Documentation] 调用次关键字前需要添加必填参数:
... ${name}:名称
... ${ip_type}:填入Ip或者Geography
... ${object_name}:列表形式,列表中是对象的名字
SourceCreate-name ${name}
Select-ip_type ${ip_type}
2021-02-25 14:25:45 +08:00
sleep ${sleep}
click element xpath=${policytype}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[4]/div/div/div[2]
2021-02-20 17:08:43 +08:00
Create-Sub-Objects ${object_name}
NewObject.Create-ok
2021-02-25 14:25:45 +08:00
DestinationIPGroupAdd
[Arguments] ${policytype} ${name} ${ip_type} ${object_name}
[Documentation] 调用次关键字前需要添加必填参数:
... ${name}:名称
... ${ip_type}:填入Ip或者Geography
... ${object_name}:列表形式,列表中是对象的名字
SourceCreate-name ${name}
Select-ip_type ${ip_type}
sleep ${sleep}
click element xpath=${policytype}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[4]/div/div/div[2]
Create-Sub-Objects ${object_name}
NewObject.Create-ok
2021-02-20 17:08:43 +08:00
SourceCreate-name
[Arguments] ${objName}
2021-02-25 14:25:45 +08:00
sleep ${sleep}
input text id=objectAdd_name ${objName}
2021-02-20 17:08:43 +08:00
SourceCreate-ok
2021-02-25 14:25:45 +08:00
sleep ${sleep}
2021-02-20 17:08:43 +08:00
click button id=objectAdd_ok
DestinationCreate-name
2021-02-25 14:25:45 +08:00
[Arguments] ${policytype} ${objName}
input text xpath=${policytype}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[1]/div/div[1]/input ${objName}
2021-02-20 17:08:43 +08:00
DestinationCreate-ok
2021-02-25 14:25:45 +08:00
[Arguments] ${policytype}
sleep ${sleep}
click button xpath=${policytype}/div[2]/div[2]/div/div[2]/button[1]
2021-02-20 17:08:43 +08:00
Security-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
click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[1]/span/div/div/div[2]/div/div
sleep 1
run keyword if "${SourceType}"=="ID" run keywords sleep 1
... AND click element xpath=/html/body/div/div[1]/div[1]/ul/li[2]
run keyword if "${SourceType}"=="Name" run keywords sleep 1
... AND click element xpath=/html/body/div/div[1]/div[1]/ul/li[3]
run keyword if "${SourceType}"=="Action" run keywords sleep 1
... AND click element xpath=/html/body/div/div[1]/div[1]/ul/li[4]
sleep 1
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 1
click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[1]/span/div/i
sleep 1
click element xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]
sleep 1
EditButton
sleep 1
click element xpath=//*[@id="appEdit"]/span/div/div[2]
sleep 1
Initialize-Policie
[Arguments] ${InitializeAction}
[Documentation] 调用次关键字前需要添加必填参数:
... ${InitializeAction}:根据用例进行填写, 意思就是是那一个action就不要点击哪一个, 以免初始化失败
run keyword if "${InitializeAction}"=="Allow" run keywords sleep 1
... AND click element id=security_action_deny
... AND sleep 1
... ELSE IF "${InitializeAction}"=="Deny" run keywords sleep 1
... AND click element id=security_action_allow
... ELSE IF "${InitializeAction}"=="Monitor" run keywords sleep 1
... AND click element id=security_action_deny
... ELSE IF "${InitializeAction}"=="Intercept" run keywords sleep 1
... AND click element id=security_action_deny
... ELSE log 不修改
sleep 1
${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 1
... 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 1
${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 1
... 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 1
2021-02-25 14:25:45 +08:00
Proxy-Deny
[Arguments] ${ProxyDenyadd}
${return} ${action} Run Keyword And Ignore Error Get From Dictionary ${ProxyDenyadd} action
${action} Run Keyword If "${return}"=="FAIL" or "${action}"=="${EMPTY}" set variable null
... ELSE set variable ${action}
${return} ${denycode} Run Keyword And Ignore Error Get From Dictionary ${ProxyDenyadd} denycode
${denycode} Run Keyword If "${return}"=="FAIL" or "${denycode}"=="${EMPTY}" set variable null
... ELSE set variable ${denycode}
${return} ${contenttype} Run Keyword And Ignore Error Get From Dictionary ${ProxyDenyadd} contenttype
${contenttype} Run Keyword If "${return}"=="FAIL" or "${contenttype}"=="${EMPTY}" set variable null
... ELSE set variable ${contenttype}
${return} ${SearchorCreate} Run Keyword And Ignore Error Get From Dictionary ${ProxyDenyadd} SearchorCreate
${SearchorCreate} Run Keyword If "${return}"=="FAIL" or "${SearchorCreate}"=="${EMPTY}" set variable null
... ELSE set variable ${SearchorCreate}
${return} ${ProfileName} Run Keyword And Ignore Error Get From Dictionary ${ProxyDenyadd} ProfileName
${ProfileName} Run Keyword If "${return}"=="FAIL" or "${ProfileName}"=="${EMPTY}" set variable null
... ELSE set variable ${ProfileName}
${return} ${file} Run Keyword And Ignore Error Get From Dictionary ${ProxyDenyadd} file
${file} Run Keyword If "${return}"=="FAIL" or "${ProfileName}"=="${EMPTY}" set variable null
... ELSE set variable ${file}
${return} ${textvalue} Run Keyword And Ignore Error Get From Dictionary ${ProxyDenyadd} textvalue
${textvalue} Run Keyword If "${return}"=="FAIL" or "${textvalue}"=="${EMPTY}" set variable null
... ELSE set variable ${textvalue}
Deny-subaction ${action} ${denycode}
sleep 1
Deny-content ${contenttype} ${SearchorCreate} ${ProfileName} ${file} ${textvalue}
Deny-subaction
[Arguments] ${action} ${denycode}
[Documentation] 调用次关键字前需要添加必填参数:
... ${denycode}:填入403或404或451
... ${action}:填入deny
... 添加subaction
${return} ${DecryptionProfileSearchorCreate} Run Keyword And Ignore Error Get From Dictionary ${DecryptionProfile} DecryptionProfileSearchorCreate
${DecryptionProfileSearchorCreate} Run Keyword If "${return}"=="FAIL" or "${DecryptionProfileSearchorCreate}"=="${EMPTY}" set variable null
... ELSE set variable ${DecryptionProfileSearchorCreate}
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] ${DenyRedirectadd}
[Documentation] 调用次关键字前需要添加必填参数:${DenyRedirectadd}是个字典,字典中的数据为下
... ${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
${return} ${QType} Run Keyword And Ignore Error Get From Dictionary ${DenyRedirectadd} QType
${QType} Run Keyword If "${return}"=="FAIL" or "${QType}"=="${EMPTY}" set variable null
... ELSE set variable ${QType}
${return} ${Avalue} Run Keyword And Ignore Error Get From Dictionary ${DenyRedirectadd} Avalue
${Avalue} Run Keyword If "${return}"=="FAIL" or "${Avalue}"=="${EMPTY}" set variable null
... ELSE set variable ${Avalue}
${return} ${Attl} Run Keyword And Ignore Error Get From Dictionary ${DenyRedirectadd} Attl
${Attl} Run Keyword If "${return}"=="FAIL" or "${Attl}"=="${EMPTY}" set variable null
... ELSE set variable ${Attl}
${return} ${CNAMEvalue} Run Keyword And Ignore Error Get From Dictionary ${DenyRedirectadd} CNAMEvalue
${CNAMEvalue} Run Keyword If "${return}"=="FAIL" or "${CNAMEvalue}"=="${EMPTY}" set variable null
... ELSE set variable ${CNAMEvalue}
${return} ${CNAMEttl} Run Keyword And Ignore Error Get From Dictionary ${DenyRedirectadd} CNAMEttl
${CNAMEttl} Run Keyword If "${return}"=="FAIL" or "${CNAMEttl}"=="${EMPTY}" set variable null
... ELSE set variable ${CNAMEttl}
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] ${ReplaceActionParameters}
[Documentation] 调用次关键字前需要添加必填参数:${ReplaceActionParameters}是个字典,字典中的数据为下
... ${ParametersType}:列表格式, Search 下拉框中内容
... ${i}:索引值
... ${xxxFind}: 是Find输入框输入的值
... ${XXXReplacewith} :是 Replacewith输入框中输入的值
${return} ${ParametersType} Run Keyword And Ignore Error Get From Dictionary ${ReplaceActionParameters} ParametersType
${ParametersType} Run Keyword If "${return}"=="FAIL" or "${ParametersType}"=="${EMPTY}" set variable null
... ELSE set variable ${ParametersType}
${return} ${RequestURIFind} Run Keyword And Ignore Error Get From Dictionary ${ReplaceActionParameters} RequestURIFind
${RequestURIFind} Run Keyword If "${return}"=="FAIL" or "${RequestURIFind}"=="${EMPTY}" set variable null
... ELSE set variable ${RequestURIFind}
${return} ${RequestURIReplacewith} Run Keyword And Ignore Error Get From Dictionary ${ReplaceActionParameters} RequestURIReplacewith
${RequestURIReplacewith} Run Keyword If "${return}"=="FAIL" or "${RequestURIReplacewith}"=="${EMPTY}" set variable null
... ELSE set variable ${RequestURIReplacewith}
${return} ${RequestBodyFind} Run Keyword And Ignore Error Get From Dictionary ${ReplaceActionParameters} RequestBodyFind
${RequestBodyFind} Run Keyword If "${return}"=="FAIL" or "${RequestBodyFind}"=="${EMPTY}" set variable null
... ELSE set variable ${RequestBodyFind}
${return} ${RequestBodyReplacewith} Run Keyword And Ignore Error Get From Dictionary ${ReplaceActionParameters} RequestBodyReplacewith
${RequestBodyReplacewith} Run Keyword If "${return}"=="FAIL" or "${RequestBodyReplacewith}"=="${EMPTY}" set variable null
... ELSE set variable ${RequestBodyReplacewith}
${return} ${ResponseBodyFind} Run Keyword And Ignore Error Get From Dictionary ${ReplaceActionParameters} ResponseBodyFind
${ResponseBodyFind} Run Keyword If "${return}"=="FAIL" or "${ResponseBodyFind}"=="${EMPTY}" set variable null
... ELSE set variable ${ResponseBodyFind}
${return} ${ResponseBodyReplacewith} Run Keyword And Ignore Error Get From Dictionary ${ReplaceActionParameters} ResponseBodyReplacewith
${ResponseBodyReplacewith} Run Keyword If "${return}"=="FAIL" or "${ResponseBodyReplacewith}"=="${EMPTY}" set variable null
... ELSE set variable ${ResponseBodyReplacewith}
${return} ${RequestHeaderFind} Run Keyword And Ignore Error Get From Dictionary ${ReplaceActionParameters} RequestHeaderFind
${RequestHeaderFind} Run Keyword If "${return}"=="FAIL" or "${RequestHeaderFind}"=="${EMPTY}" set variable null
... ELSE set variable ${RequestHeaderFind}
${return} ${RequestHeaderReplacewith} Run Keyword And Ignore Error Get From Dictionary ${ReplaceActionParameters} RequestHeaderReplacewith
${RequestHeaderReplacewith} Run Keyword If "${return}"=="FAIL" or "${RequestHeaderReplacewith}"=="${EMPTY}" set variable null
... ELSE set variable ${RequestHeaderReplacewith}
${return} ${ResponseHeaderFind} Run Keyword And Ignore Error Get From Dictionary ${ReplaceActionParameters} ResponseHeaderFind
${ResponseHeaderFind} Run Keyword If "${return}"=="FAIL" or "${ResponseHeaderFind}"=="${EMPTY}" set variable null
... ELSE set variable ${ResponseHeaderFind}
${return} ${ResponseHeaderReplacewith} Run Keyword And Ignore Error Get From Dictionary ${ReplaceActionParameters} ResponseHeaderReplacewith
${ResponseHeaderReplacewith} Run Keyword If "${return}"=="FAIL" or "${ResponseHeaderReplacewith}"=="${EMPTY}" set variable null
... ELSE set variable ${ResponseHeaderReplacewith}
${len} Get Length ${ParametersType}
${len1} evaluate ${len}+1
FOR ${i} IN RANGE 1 ${len1}
Replace-Action-Parameters-for2 ${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] ${HijackFileadd}
[Documentation] 调用次关键字前需要添加必填参数:${HijackFileadd}是个字典,字典中的数据为下
... ${SearchorCreate}:填入Search或Create
... ${Hijackname}:填入新建hijack的name
... ${Hijackfile}:填入新建hijack文件的路径
... ${dow_name}:根据情况填入close或open或其他
... ${input}; 填入shuru或其他
... ${Hijacktype}:填入选择文件类型的元素
... 判断是新建还是搜索HijackFile
${return} ${SearchorCreate} Run Keyword And Ignore Error Get From Dictionary ${HijackFileadd} SearchorCreate
${SearchorCreate} Run Keyword If "${return}"=="FAIL" or "${SearchorCreate}"=="${EMPTY}" set variable null
... ELSE set variable ${SearchorCreate}
${return} ${Hijackname} Run Keyword And Ignore Error Get From Dictionary ${HijackFileadd} Hijackname
${Hijackname} Run Keyword If "${return}"=="FAIL" or "${Hijackname}"=="${EMPTY}" set variable null
... ELSE set variable ${Hijackname}
${return} ${Hijackfile} Run Keyword And Ignore Error Get From Dictionary ${HijackFileadd} Hijackfile
${Hijackfile} Run Keyword If "${return}"=="FAIL" or "${Hijackfile}"=="${EMPTY}" set variable null
... ELSE set variable ${Hijackfile}
${return} ${dow_name} Run Keyword And Ignore Error Get From Dictionary ${HijackFileadd} dow_name
${dow_name} Run Keyword If "${return}"=="FAIL" or "${dow_name}"=="${EMPTY}" set variable null
... ELSE set variable ${dow_name}
${return} ${input} Run Keyword And Ignore Error Get From Dictionary ${HijackFileadd} input
${input} Run Keyword If "${return}"=="FAIL" or "${input}"=="${EMPTY}" set variable null
... ELSE set variable ${input}
${return} ${Hijacktype} Run Keyword And Ignore Error Get From Dictionary ${HijackFileadd} Hijacktype
${Hijacktype} Run Keyword If "${return}"=="FAIL" or "${Hijacktype}"=="${EMPTY}" set variable null
... ELSE set variable ${Hijacktype}
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] ${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] ${InsertScript}
[Documentation] 调用次关键字前需要添加必填参数:${InsertScript}是个字典,字典中的数据为下
... ${SearchorCreate}:填入Search或Create
... ${Insertname}:填入新建insert的name
... ${Insertfile}:填入新建insert文件的路径
... ${Inserttype}:根据情况填入css或js
... ${Insertjstype}; 填入Before Page Load或After Page Load
... 判断是新建还是搜索insert
${return} ${SearchorCreate} Run Keyword And Ignore Error Get From Dictionary ${InsertScript} SearchorCreate
${SearchorCreate} Run Keyword If "${return}"=="FAIL" or "${SearchorCreate}"=="${EMPTY}" set variable null
... ELSE set variable ${SearchorCreate}
${return} ${Insertname} Run Keyword And Ignore Error Get From Dictionary ${InsertScript} Insertname
${Insertname} Run Keyword If "${return}"=="FAIL" or "${Insertname}"=="${EMPTY}" set variable null
... ELSE set variable ${Insertname}
${return} ${Insertfile} Run Keyword And Ignore Error Get From Dictionary ${InsertScript} Insertfile
${Insertfile} Run Keyword If "${return}"=="FAIL" or "${Insertfile}"=="${EMPTY}" set variable null
... ELSE set variable ${Insertfile}
${return} ${Inserttype} Run Keyword And Ignore Error Get From Dictionary ${InsertScript} Inserttype
${Inserttype} Run Keyword If "${return}"=="FAIL" or "${Inserttype}"=="${EMPTY}" set variable null
... ELSE set variable ${Inserttype}
${return} ${Insertjstype} Run Keyword And Ignore Error Get From Dictionary ${InsertScript} Insertjstype
${Insertjstype} Run Keyword If "${return}"=="FAIL" or "${Insertjstype}"=="${EMPTY}" set variable null
... ELSE set variable ${Insertjstype}
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 ${Insertname}
... 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
ProxyLogSession
[Arguments] ${LogSession}
[Documentation] 调用次关键字前需要添加必填参数:
... ${LogSession}:填入clcos或其他
run keyword if "${LogSession}"=="close" run keywords sleep ${sleep}
... AND click element id=manipulationSwitch0
... ELSE log 开启日志
ProxyLogOptions
[Arguments] ${LogOptions}
[Documentation] 调用次关键字前需要添加必填参数:
... ${LogOptions}:填入All或其他
run keyword if "${LogOptions}"=="All" run keywords sleep ${sleep}
... AND click element id=logType1
... ELSE log 选择Metadata only
ProxyEnabled
[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 策略生效
2021-02-20 17:08:43 +08:00
2021-02-25 14:25:45 +08:00
Proxy-Policies-OK
sleep ${sleep}
click element id=proxyManipulationSuccess
sleep ${sleep}