2021-02-05 17:50:26 +08:00
*** Settings ***
Library Selenium2Library
Resource ../objects/NewObject.robot
Resource ../Menu.robot
*** Keywords ***
Create-Source
[Arguments] ${policytype}=null ${type1}=null ${CreateOrSearch}=null ${Add}=null ${name}=null
... ${object_name}=null ${ipclienttext1}=null ${post}=null ${Country}=null ${City}=null
... ${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段
... ${post}:填入端口
... ${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-20 15:05:32 +08:00
run keyword if "${type1}"=="Ip" run keywords sleep ${sleep}
2021-02-05 17:50:26 +08:00
... AND click element xpath=${policytype}/div[2]/div[1]/div[2]/div[1]/div/div/div/div[1]/div/div/div/div[1]
2021-02-20 15:05:32 +08:00
... AND sleep ${sleep}
... AND sleep ${sleep}
2021-02-05 17:50:26 +08:00
... AND SourceIPCreateOrSearch ${policytype} ${CreateOrSearch} ${Add} ${type1} ${name} ${object_name} ${ipclienttext1} ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits}
2021-02-20 15:05:32 +08:00
... ELSE IF "${type1}"=="SUBID" run keywords sleep ${sleep}
2021-02-05 17:50:26 +08:00
... AND click element xpath=${policytype}/div[2]/div[1]/div[2]/div[1]/div/div/div/div[1]/div/div/div/div[2]
2021-02-20 15:05:32 +08:00
... AND sleep ${sleep}
2021-02-05 17:50:26 +08:00
... AND SUBIDCreateOrSearch ${policytype} ${name} ${keywordtext} ${object_name}
2021-02-20 15:05:32 +08:00
... ELSE IF "${type1}"=="Geography" run keywords sleep ${sleep}
2021-02-05 17:50:26 +08:00
... AND click element xpath=${policytype}/div[2]/div[1]/div[2]/div[1]/div/div/div/div[1]/div/div/div/div[3]
2021-02-20 15:05:32 +08:00
... AND sleep ${sleep}
2021-02-05 17:50:26 +08:00
... AND SourceIPCreateOrSearch ${policytype} ${CreateOrSearch} ${Add} ${type1} ${name} ${object_name} ${ipclienttext1} ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits}
2021-02-20 15:05:32 +08:00
... ELSE IF "${type1}"=="IPLearning" run keywords sleep ${sleep}
2021-02-05 17:50:26 +08:00
... AND click element xpath=${policytype}/div[2]/div[1]/div[2]/div[1]/div/div/div/div[1]/div/div/div/div[4]
2021-02-20 15:05:32 +08:00
... AND sleep ${sleep}
2021-02-05 17:50:26 +08:00
... AND SourceIPCreateOrSearch ${policytype} ${CreateOrSearch} ${Add} ${type1} ${name} ${object_name} ${ipclienttext1} ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits}
Create-Destination
[Arguments] ${policytype}=null ${type1}=null ${CreateOrSearch}=null ${Add}=null ${name}=null
... ${object_name}=null ${ipclienttext1}=null ${post}=null ${Country}=null ${City}=null
... ${Protocols1}=null ${Degree}=null ${times}=null ${numbers}=null ${limits}=null ${keywordtext}=null
[Documentation] 调用次关键字前需要添加必填参数:
... ${type1}:填入Ip或SUBID或Geography或IPLearning
... ${CreateOrSearch}:填入Create或者Search
... ${Add}:填入Address或Group
... ${name}:名称
... ${ip_type}:填入Ip或者Geography或者IPLearning
... ${ipclienttext1}:填入IPV4或6的值或range的ip段
... ${post}:填入端口
... ${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-20 15:05:32 +08:00
run keyword if "${type1}"=="Ip" run keywords sleep ${sleep}
2021-02-05 17:50:26 +08:00
... AND click element xpath=${policytype}/div[2]/div[1]/div[2]/div[1]/div/div/div/div[1]/div/div/div/div[1]
2021-02-20 15:05:32 +08:00
... AND sleep ${sleep}
... AND sleep ${sleep}
2021-02-05 17:50:26 +08:00
... AND DestinationIPCreateOrSearch ${policytype} ${CreateOrSearch} ${Add} ${type1} ${name} ${object_name} ${ipclienttext1} ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits}
2021-02-20 15:05:32 +08:00
... ELSE IF "${type1}"=="Geography" run keywords sleep ${sleep}
2021-02-05 17:50:26 +08:00
... AND click element xpath=${policytype}/div[2]/div[1]/div[2]/div[1]/div/div/div/div[1]/div/div/div/div[3]
2021-02-20 15:05:32 +08:00
... AND sleep ${sleep}
2021-02-05 17:50:26 +08:00
... AND DestinationIPCreateOrSearch ${policytype} ${CreateOrSearch} ${Add} ${type1} ${name} ${object_name} ${ipclienttext1} ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits}
2021-02-20 15:05:32 +08:00
... ELSE IF "${type1}"=="IPLearning" run keywords sleep ${sleep}
2021-02-05 17:50:26 +08:00
... AND click element xpath=${policytype}/div[2]/div[1]/div[2]/div[1]/div/div/div/div[1]/div/div/div/div[4]
2021-02-20 15:05:32 +08:00
... AND sleep ${sleep}
2021-02-05 17:50:26 +08:00
... AND DestinationIPCreateOrSearch ${policytype} ${CreateOrSearch} ${Add} ${type1} ${name} ${object_name} ${ipclienttext1} ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits}
SourceIPCreateOrSearch
[Arguments] ${policytype} ${CreateOrSearch} ${Add} ${ip_type} ${name} ${object_name} ${ipclienttext1}
... ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits}
[Documentation] 调用次关键字前需要添加必填参数:
... ${CreateOrSearch}:填入Create或者Search
... ${Add}:填入Address或Group
... ${name}:名称
... ${ip_type}:填入Ip或者Geography或者IPLearning
... ${ipclienttext1}:填入IPV4或6的值或range的ip段
... ${post}:填入端口
... ${Country}:列表形式,列表中是国家名字
... ${City}:列表形式,列表中是城市名字
... ${Protocols1}:填入HTTP或SSL或HTTPSSL
... ${Degree}:填入1Degree或2Degree
... ${times}:填入小时数, 例如1或2
... ${numbers}:填入数值, 例如1或10000
... ${limits}:填入数值, 例如1或10000
... ${object_name}:列表形式,列表中是对象的名字
... 判断是新建ip还是搜索添加ip
2021-02-20 15:05:32 +08:00
run keyword if "${CreateOrSearch}"=="Create" run keywords sleep ${sleep}
2021-02-05 17:50:26 +08:00
... AND click element id=interceptionadd_proaddaddSource
... AND SourceIPAdd ${policytype} ${Add} ${ip_type} ${name} ${object_name} ${ipclienttext1} ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits}
2021-02-20 15:05:32 +08:00
... ELSE IF "${CreateOrSearch}"=="Search" run keywords sleep ${sleep}
2021-02-05 17:50:26 +08:00
... AND SourceSearch ${policytype} ${object_name}
SUBIDCreateOrSearch
[Arguments] ${policytype} ${name} ${keywordtext} ${object_name}
[Documentation] 调用次关键字前需要添加必填参数:
... ${CreateOrSearch}:填入Create或者Search
... ${name}:名称
... ${keywordtext}:填入新建subid的内容
... ${object_name}:列表形式,列表中是对象的名字
... 判断是新建subid还是搜索添加subid
2021-02-20 15:05:32 +08:00
run keyword if "${CreateOrSearch}"=="Create" run keywords sleep ${sleep}
2021-02-05 17:50:26 +08:00
... AND click element id=interceptionadd_proaddaddSource
... AND SUBIDAdd ${policytype} ${Add} ${name} ${keywordtext} ${object_name}
2021-02-20 15:05:32 +08:00
... ELSE IF "${CreateOrSearch}"=="Search" run keywords sleep ${sleep}
2021-02-05 17:50:26 +08:00
... AND SourceSearch ${object_name}
DestinationIPCreateOrSearch
[Arguments] ${policytype} ${CreateOrSearch} ${Add} ${ip_type} ${name} ${object_name} ${ipclienttext1}
... ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits}
[Documentation] 调用次关键字前需要添加必填参数:
... ${CreateOrSearch}:填入Create或者Search
... ${Add}:填入Address或Group
... ${name}:名称
... ${ip_type}:填入Ip或者Geography或者IPLearning
... ${ipclienttext1}:填入IPV4或6的值或range的ip段
... ${post}:填入端口
... ${Country}:列表形式,列表中是国家名字
... ${City}:列表形式,列表中是城市名字
... ${Protocols1}:填入HTTP或SSL或HTTPSSL
... ${Degree}:填入1Degree或2Degree
... ${times}:填入小时数, 例如1或2
... ${numbers}:填入数值, 例如1或10000
... ${limits}:填入数值, 例如1或10000
... ${object_name}:列表形式,列表中是对象的名字
... 判断是新建ip还是搜索添加ip
2021-02-20 15:05:32 +08:00
run keyword if "${CreateOrSearch}"=="Create" run keywords sleep ${sleep}
2021-02-05 17:50:26 +08:00
... AND click element id=interceptionadd_proaddaddDestination
... AND DestinationIPAdd ${policytype} ${Add} ${ip_type} ${name} ${object_name} ${ipclienttext1} ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits}
2021-02-20 15:05:32 +08:00
... ELSE IF "${CreateOrSearch}"=="Search" run keywords sleep ${sleep}
2021-02-05 17:50:26 +08:00
... AND DestinationSearch ${policytype} ${object_name}
SourceSearch
[Arguments] ${policytype} ${name}
[Documentation] 调用次关键字前需要添加必填参数:
... ${name}:填入是一个列表, 列表内容为source的name
... 选择search对象
FOR ${i} IN @{name}
input text xpath=${policytype}/div[2]/div[1]/div[2]/div[2]/div/div[1]/input ${i}
2021-02-20 15:05:32 +08:00
sleep ${sleep}
2021-02-05 17:50:26 +08:00
press keys xpath=${policytype}/div[2]/div[1]/div[2]/div[2]/div/div[1]/input ENTER
2021-02-20 15:05:32 +08:00
sleep ${sleep}
2021-02-05 17:50:26 +08:00
click element xpath=${policytype}/div[2]/div[1]/div[2]/div[2]/div/div[2]/div/div/ul/li[1]
2021-02-20 15:05:32 +08:00
sleep ${sleep}
2021-02-05 17:50:26 +08:00
END
DestinationSearch
[Arguments] ${policytype} ${name}
[Documentation] 调用次关键字前需要添加必填参数:
... ${name}:填入是一个列表, 列表内容为source的name
... 选择search对象
FOR ${i} IN @{name}
input text xpath=${policytype}/div[2]/div[1]/div[2]/div[2]/div/div[1]/input ${i}
2021-02-20 15:05:32 +08:00
sleep ${sleep}
2021-02-05 17:50:26 +08:00
press keys xpath=${policytype}/div[2]/div[1]/div[2]/div[2]/div/div[1]/input ENTER
2021-02-20 15:05:32 +08:00
sleep ${sleep}
2021-02-05 17:50:26 +08:00
click element xpath=${policytype}/div[2]/div[1]/div[2]/div[2]/div/div[2]/div/div/ul/li[1]
2021-02-20 15:05:32 +08:00
sleep ${sleep}
2021-02-05 17:50:26 +08:00
END
SUBIDAdd
[Arguments] ${policytype} ${Add} ${name} ${keywordtext} ${object_name}
[Documentation] 调用次关键字前需要添加必填参数:
... ${Add}:填入Address或Group
... ${name}:名称
... ${keywordtext}:填入新建subid的内容
... ${object_name}:列表形式,列表中是对象的名字
... 判断是新建subid还是新建subid分组
2021-02-20 15:05:32 +08:00
run keyword if "${Add}"=="Address" run keywords sleep ${sleep}
2021-02-05 17:50:26 +08:00
... AND click element xpath=/html/body/ul/li[1]
2021-02-20 15:05:32 +08:00
... AND sleep ${sleep}
2021-02-05 17:50:26 +08:00
... AND SUBAddress ${policytype}${name} ${keywordtext}
2021-02-20 15:05:32 +08:00
... ELSE IF "${Add}"=="Group" run keywords sleep ${sleep}
2021-02-05 17:50:26 +08:00
... AND click element xpath=/html/body/ul/li[2]
2021-02-20 15:05:32 +08:00
... AND sleep ${sleep}
2021-02-05 17:50:26 +08:00
... AND SUBGroupAdd ${policytype} ${name} ${object_name}
SUBAddress
[Arguments] ${policytype} ${name} ${keywordtext}
[Documentation] 调用次关键字前需要添加必填参数:
... ${name}:名称
... ${keywordtext}:填入新建subid的内容
... 新建subid
SourceCreate-name ${name}
click element xpath=${policytype}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[3]/div/div[1]
2021-02-20 15:05:32 +08:00
sleep ${sleep}
2021-02-05 17:50:26 +08:00
Create-SubscriberID-text ${keywordtext}
2021-02-20 15:05:32 +08:00
sleep ${sleep}
2021-02-05 17:50:26 +08:00
SUBGroupAdd
[Arguments] ${policytype} ${name} ${object_name}
[Documentation] 调用次关键字前需要添加必填参数:
... ${name}:名称
... ${object_name}:列表形式,列表中是对象的名字
... 新建subid分组
SourceCreate-name ${name}
click element xpath=${policytype}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[3]/div/div/div[2]
2021-02-20 15:05:32 +08:00
sleep ${sleep}
2021-02-05 17:50:26 +08:00
Create-Sub-Objects ${object_name}
NewObject.Create-ok
SourceIPAdd
[Arguments] ${policytype} ${Add} ${ip_type} ${name} ${object_name} ${ipclienttext1} ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits}
[Documentation] 调用次关键字前需要添加必填参数:
... ${Add}:填入Address或Group
... ${ip_type}:填入IP或者Geography或者IPLearning
... 判断是新建ip还是新建ip分组
2021-02-20 15:05:32 +08:00
run keyword if "${Add}"=="Address" run keywords sleep ${sleep}
2021-02-05 17:50:26 +08:00
... AND click element xpath=/html/body/ul/li[1]
2021-02-20 15:05:32 +08:00
... AND sleep ${sleep}
2021-02-05 17:50:26 +08:00
... AND SourceIPAddress ${policytype} ${name} ${ip_type} ${ipclienttext1} ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits}
2021-02-20 15:05:32 +08:00
... ELSE IF "${Add}"=="Group" run keywords sleep ${sleep}
2021-02-05 17:50:26 +08:00
... AND click element xpath=/html/body/ul/li[2]
2021-02-20 15:05:32 +08:00
... AND sleep ${sleep}
2021-02-05 17:50:26 +08:00
... AND SourceIPGroupAdd ${policytype} ${name} ${ip_type} ${object_name}
SourceIPAddress
[Arguments] ${policytype} ${name} ${ip_type} ${ipclienttext1} ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits}
[Documentation] 调用次关键字前需要添加必填参数:
... ${name}:名称
... ${ip_type}:填入Ip或者Geography或者IPLearning
... ${ipclienttext1}:填入IPV4或6的值或range的ip段
... ${post}:填入端口
... ${Country}:列表形式,列表中是国家名字
... ${City}:列表形式,列表中是城市名字
... ${Protocols1}:填入HTTP或SSL或HTTPSSL
... ${Degree}:填入1Degree或2Degree
... ${times}:填入小时数, 例如1或2
... ${numbers}:填入数值, 例如1或10000
... ${limits}:填入数值, 例如1或10000
... 判断 新建选择用什么样的类型,并进行新建
SourceCreate-name ${name}
2021-02-20 15:05:32 +08:00
sleep ${sleep}
2021-02-05 17:50:26 +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-20 15:05:32 +08:00
... AND sleep ${sleep}
2021-02-05 17:50:26 +08:00
... AND NewObject.Create-ip-ClientIP-text ${ipclienttext1} ${post}
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-20 15:05:32 +08:00
... AND sleep ${sleep}
2021-02-05 17:50:26 +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-20 15:05:32 +08:00
... AND sleep ${sleep}
2021-02-05 17:50:26 +08:00
... AND NewObject.Create-Geography ${Country} ${City}
2021-02-20 15:05:32 +08:00
... AND sleep ${sleep}
2021-02-05 17:50:26 +08:00
... AND click element xpath=${policytype}/div[2]/div[2]/div/div[1]/div[10]/div/div/div/div[4]/button
2021-02-20 15:05:32 +08:00
... AND sleep ${sleep}
2021-02-05 17:50:26 +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-20 15:05:32 +08:00
... AND sleep ${sleep}
2021-02-05 17:50:26 +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-20 15:05:32 +08:00
... AND sleep ${sleep}
2021-02-05 17:50:26 +08:00
... 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}
2021-02-20 15:05:32 +08:00
... AND sleep ${sleep}
2021-02-05 17:50:26 +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-20 15:05:32 +08:00
... AND sleep ${sleep}
2021-02-05 17:50:26 +08:00
... AND Learn-From-Protocols ${Protocols1}
... AND Learning-Depth ${policytype} ${Degree}
2021-02-20 15:05:32 +08:00
... AND sleep ${sleep}
2021-02-05 17:50:26 +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-20 15:05:32 +08:00
... AND sleep ${sleep}
2021-02-05 17:50:26 +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-20 15:05:32 +08:00
... AND sleep ${sleep}
2021-02-05 17:50:26 +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-20 15:05:32 +08:00
... AND sleep ${sleep}
sleep ${sleep}
2021-02-05 17:50:26 +08:00
SourceCreate-ok
DestinationIPAdd
[Arguments] ${policytype} ${Add} ${ip_type} ${name} ${object_name} ${ipclienttext1} ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits}
[Documentation] 调用次关键字前需要添加必填参数:
... ${Add}:填入Address或Group
... ${ip_type}:填入IP或者Geography或者IPLearning
... 判断是新建ip还是新建ip分组
2021-02-20 15:05:32 +08:00
run keyword if "${Add}"=="Address" run keywords sleep ${sleep}
2021-02-05 17:50:26 +08:00
... AND click element xpath=/html/body/ul[contains(@id,'dropdown-menu' )and @x-placement='bottom-start']/child::li[1]
2021-02-20 15:05:32 +08:00
... AND sleep ${sleep}
2021-02-05 17:50:26 +08:00
... AND DestinationIPAddress ${policytype} ${name} ${ip_type} ${ipclienttext1} ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits}
2021-02-20 15:05:32 +08:00
... ELSE IF "${Add}"=="Group" run keywords sleep ${sleep}
2021-02-05 17:50:26 +08:00
... AND click element xpath=/html/body/ul[contains(@id,'dropdown-menu' )and @x-placement='bottom-start']/child::li[2]
2021-02-20 15:05:32 +08:00
... AND sleep ${sleep}
2021-02-05 17:50:26 +08:00
... AND DestinationIPGroupAdd ${policytype} ${name} ${ip_type} ${object_name}
DestinationIPAddress
[Arguments] ${policytype} ${name} ${ip_type} ${ipclienttext1} ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits}
[Documentation] 调用次关键字前需要添加必填参数:
... ${name}:名称
... ${ip_type}:填入Ip或者Geography或者IPLearning
... ${ipclienttext1}:填入IPV4或6的值或range的ip段
... ${post}:填入端口
... ${Country}:列表形式,列表中是国家名字
... ${City}:列表形式,列表中是城市名字
... ${Protocols1}:填入HTTP或SSL或HTTPSSL
... ${Degree}:填入1Degree或2Degree
... ${times}:填入小时数, 例如1或2
... ${numbers}:填入数值, 例如1或10000
... ${limits}:填入数值, 例如1或10000
... 判断 新建选择用什么样的类型,并进行新建
DestinationCreate-name ${policytype} ${name}
2021-02-20 15:05:32 +08:00
sleep ${sleep}
2021-02-05 17:50:26 +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-20 15:05:32 +08:00
... AND sleep ${sleep}
2021-02-05 17:50:26 +08:00
... AND NewObject.Create-ip-ClientIP-text ${ipclienttext1} ${post}
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-20 15:05:32 +08:00
... AND sleep ${sleep}
2021-02-05 17:50:26 +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-20 15:05:32 +08:00
... AND sleep ${sleep}
2021-02-05 17:50:26 +08:00
... AND NewObject.Create-Geography ${Country} ${City}
2021-02-20 15:05:32 +08:00
... AND sleep ${sleep}
2021-02-05 17:50:26 +08:00
... AND click element id=interceptionadd_allcancelobjec3t
2021-02-20 15:05:32 +08:00
... AND sleep ${sleep}
2021-02-05 17:50:26 +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-20 15:05:32 +08:00
... AND sleep ${sleep}
2021-02-05 17:50:26 +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-20 15:05:32 +08:00
... AND sleep ${sleep}
2021-02-05 17:50:26 +08:00
... 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}
2021-02-20 15:05:32 +08:00
... AND sleep ${sleep}
2021-02-05 17:50:26 +08:00
... 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]
2021-02-20 15:05:32 +08:00
... AND sleep ${sleep}
2021-02-05 17:50:26 +08:00
... AND Learn-From-Protocols ${Protocols1}
... AND Learning-Depth ${policytype} ${Degree}
2021-02-20 15:05:32 +08:00
... AND sleep ${sleep}
2021-02-05 17:50:26 +08:00
... 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}
2021-02-20 15:05:32 +08:00
... AND sleep ${sleep}
2021-02-05 17:50:26 +08:00
... 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}
2021-02-20 15:05:32 +08:00
... AND sleep ${sleep}
2021-02-05 17:50:26 +08:00
... 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}
2021-02-20 15:05:32 +08:00
... AND sleep ${sleep}
2021-02-05 17:50:26 +08:00
DestinationCreate-ok ${policytype}
Learn-From-Protocols
[Arguments] ${Protocols1}
[Documentation] 调用次关键字前需要添加必填参数:
... ${Protocols1}:填入HTTP或SSL或者HTTPSSL
... 判断选择用什么样的协议
2021-02-20 15:05:32 +08:00
run keyword if "${Protocols1}"=="HTTP" run keywords sleep ${sleep}
2021-02-05 17:50:26 +08:00
... AND click element xpath=/html/body/div/div[1]/div[1]/ul/li[1]
2021-02-20 15:05:32 +08:00
run keyword if "${Protocols1}"=="SSL" run keywords sleep ${sleep}
2021-02-05 17:50:26 +08:00
... AND click element xpath=/html/body/div/div[1]/div[1]/ul/li[2]
2021-02-20 15:05:32 +08:00
run keyword if "${Protocols1}"=="HTTPSSL" run keywords sleep ${sleep}
2021-02-05 17:50:26 +08:00
... AND click element xpath=/html/body/div/div[1]/div[1]/ul/li[1]
2021-02-20 15:05:32 +08:00
... AND sleep ${sleep}
2021-02-05 17:50:26 +08:00
... AND click element xpath=/html/body/div/div[1]/div[1]/ul/li[2]
Learning-Depth
[Arguments] ${policytype} ${Degree}
[Documentation] 调用次关键字前需要添加必填参数:
... ${Degree}:填入1Degree或2Degree
... 判断是用1Degree或2Degree
2021-02-20 15:05:32 +08:00
run keyword if "${Degree}"=="1Degree" run keywords sleep ${sleep}
2021-02-05 17:50:26 +08:00
... 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]
2021-02-20 15:05:32 +08:00
run keyword if "${Degree}"=="2Degree" run keywords sleep ${sleep}
2021-02-05 17:50:26 +08:00
... 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]
SourceIPGroupAdd
[Arguments] ${policytype} ${name} ${ip_type} ${object_name}
[Documentation] 调用次关键字前需要添加必填参数:
... ${name}:名称
... ${ip_type}:填入Ip或者Geography
... ${object_name}:列表形式,列表中是对象的名字
SourceCreate-name ${name}
Select-ip_type ${ip_type}
2021-02-20 15:05:32 +08:00
sleep ${sleep}
2021-02-05 17:50:26 +08:00
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
DestinationIPGroupAdd
[Arguments] ${policytype} ${name} ${ip_type} ${object_name}
[Documentation] 调用次关键字前需要添加必填参数:
... ${name}:名称
... ${ip_type}:填入Ip或者Geography
... ${object_name}:列表形式,列表中是对象的名字
SourceCreate-name ${name}
Select-ip_type ${ip_type}
2021-02-20 15:05:32 +08:00
sleep ${sleep}
2021-02-05 17:50:26 +08:00
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
SourceCreate-name
[Arguments] ${objName}
2021-02-20 15:05:32 +08:00
sleep ${sleep}
2021-02-05 17:50:26 +08:00
input text id=objectAdd_name ${objName}
SourceCreate-ok
2021-02-20 15:05:32 +08:00
sleep ${sleep}
2021-02-05 17:50:26 +08:00
click button id=objectAdd_ok
DestinationCreate-name
[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}
DestinationCreate-ok
[Arguments] ${policytype}
2021-02-20 15:05:32 +08:00
sleep ${sleep}
2021-02-05 17:50:26 +08:00
click button xpath=${policytype}/div[2]/div[2]/div/div[2]/button[1]