765 lines
48 KiB
Plaintext
765 lines
48 KiB
Plaintext
*** Settings ***
|
||
Library Selenium2Library
|
||
Resource ../Menu.robot
|
||
#Resource ../SecurityPolicy/SourceAndDestination.robot
|
||
Resource ../objects/NewObject.robot
|
||
Resource ../../../03-Variable/BifangApiVariable.txt
|
||
*** Keywords ***
|
||
UIAddWANNAT
|
||
[Arguments] ${AddWANNATDict} ${VPNAccountDict}=null ${SourceInfo}=null ${DestinationInfo}=null ${TranslatedPacketDict}=null
|
||
${return} ${Wannatname} Run Keyword And Ignore Error Get From Dictionary ${AddWANNATDict} Wannatname
|
||
${Wannatname} Run Keyword If "${return}"=="FAIL" or "${Wannatname}"=="${EMPTY}" set variable null
|
||
... ELSE set variable ${Wannatname}
|
||
|
||
${return} ${WannatAction} Run Keyword And Ignore Error Get From Dictionary ${AddWANNATDict} WannatAction
|
||
${WannatAction} Run Keyword If "${return}"=="FAIL" or "${WannatAction}"=="${EMPTY}" set variable null
|
||
... ELSE set variable ${WannatAction}
|
||
|
||
${return} ${WannatAccessMode} Run Keyword And Ignore Error Get From Dictionary ${AddWANNATDict} WannatAccessMode
|
||
${WannatAccessMode} Run Keyword If "${return}"=="FAIL" or "${WannatAccessMode}"=="${EMPTY}" set variable null
|
||
... ELSE set variable ${WannatAccessMode}
|
||
|
||
${return} ${PrivateNetworkAddress} Run Keyword And Ignore Error Get From Dictionary ${AddWANNATDict} PrivateNetworkAddress
|
||
${PrivateNetworkAddress} Run Keyword If "${return}"=="FAIL" or "${PrivateNetworkAddress}"=="${EMPTY}" set variable null
|
||
... ELSE set variable ${PrivateNetworkAddress}
|
||
|
||
${return} ${Enabled} Run Keyword And Ignore Error Get From Dictionary ${AddWANNATDict} Enabled
|
||
${Enabled} Run Keyword If "${return}"=="FAIL" or "${Enabled}"=="${EMPTY}" set variable null
|
||
... ELSE set variable ${Enabled}
|
||
|
||
Create-WANNAT ${Wannatname}
|
||
|
||
Wannat-Action ${WannatAction}
|
||
|
||
Wannat-AccessMode ${WannatAccessMode}
|
||
|
||
Wannat-OriginalPacket ${WannatAction} ${WannatAccessMode} ${VPNAccountDict} ${TranslatedPacketDict} ${SourceInfo} ${DestinationInfo} ${PrivateNetworkAddress}
|
||
|
||
WANNAT-Enabled ${Enabled}
|
||
|
||
WANNAT-OK
|
||
|
||
WANNAT-Assertion ${Wannatname}
|
||
|
||
UIUpdateWANNAT
|
||
[Arguments] ${UpdateWANNATDict} ${VPNAccountDict}=null ${SourceInfo}=null ${DestinationInfo}=null ${TranslatedPacketDict}=null
|
||
${return} ${Wannatname} Run Keyword And Ignore Error Get From Dictionary ${UpdateWANNATDict} Wannatname
|
||
${Wannatname} Run Keyword If "${return}"=="FAIL" or "${Wannatname}"=="${EMPTY}" set variable null
|
||
... ELSE set variable ${Wannatname}
|
||
|
||
${return} ${Edittcpname} Run Keyword And Ignore Error Get From Dictionary ${UpdateWANNATDict} Edittcpname
|
||
${Edittcpname} Run Keyword If "${return}"=="FAIL" or "${Wannatname}"=="${EMPTY}" set variable ${Wannatname}
|
||
... ELSE set variable ${Edittcpname}
|
||
|
||
${return} ${WannatAction} Run Keyword And Ignore Error Get From Dictionary ${UpdateWANNATDict} WannatAction
|
||
${WannatAction} Run Keyword If "${return}"=="FAIL" or "${WannatAction}"=="${EMPTY}" set variable null
|
||
... ELSE set variable ${WannatAction}
|
||
|
||
${return} ${WannatAccessMode} Run Keyword And Ignore Error Get From Dictionary ${UpdateWANNATDict} WannatAccessMode
|
||
${WannatAccessMode} Run Keyword If "${return}"=="FAIL" or "${WannatAccessMode}"=="${EMPTY}" set variable null
|
||
... ELSE set variable ${WannatAccessMode}
|
||
|
||
${return} ${PrivateNetworkAddress} Run Keyword And Ignore Error Get From Dictionary ${UpdateWANNATDict} PrivateNetworkAddress
|
||
${PrivateNetworkAddress} Run Keyword If "${return}"=="FAIL" or "${PrivateNetworkAddress}"=="${EMPTY}" set variable null
|
||
... ELSE set variable ${PrivateNetworkAddress}
|
||
|
||
${return} ${Enabled} Run Keyword And Ignore Error Get From Dictionary ${UpdateWANNATDict} Enabled
|
||
${Enabled} Run Keyword If "${return}"=="FAIL" or "${Enabled}"=="${EMPTY}" set variable null
|
||
... ELSE set variable ${Enabled}
|
||
|
||
Edit-WANNAT ${Wannatname}
|
||
|
||
Edit-Proxy-TCP-Name ${Edittcpname}
|
||
|
||
Wannat-Action ${WannatAction}
|
||
|
||
Wannat-AccessMode ${WannatAccessMode}
|
||
|
||
Wannat-OriginalPacket ${WannatAction} ${WannatAccessMode} ${VPNAccountDict} ${TranslatedPacketDict} ${SourceInfo} ${DestinationInfo} ${PrivateNetworkAddress}
|
||
|
||
WANNAT-Enabled ${Enabled}
|
||
|
||
WANNAT-OK
|
||
|
||
WANNAT-Assertion ${Edittcpname}
|
||
|
||
Create-WANNAT
|
||
[Arguments] ${Wannatname}
|
||
sleep ${sleep}
|
||
Menu policys WAN NAT
|
||
sleep ${sleep}
|
||
click element id=app_create #点击Create按钮
|
||
sleep ${sleep}
|
||
input text id=WANNATADD_name1 ${Wannatname} #输入name
|
||
sleep ${sleep}
|
||
|
||
Edit-WANNAT
|
||
[Arguments] ${Wannatname}
|
||
sleep ${sleep}
|
||
Menu policys WAN NAT
|
||
sleep ${sleep}
|
||
WANNAT-Search ${Wannatname} Name #搜索策略
|
||
sleep ${sleep}
|
||
click element id=appEdit #点击Edit按钮
|
||
sleep ${sleep}
|
||
|
||
Edit-Proxy-TCP-Name
|
||
[Arguments] ${Edittcpname}
|
||
input text id=WANNATADD_name1 ${Edittcpname} #输入name
|
||
|
||
Wannat-Action
|
||
[Arguments] ${WannatAction}
|
||
Run Keyword If "${WannatAction}"=="SNAT" run keywords sleep ${sleep}
|
||
... AND click element id=WANNAT_action_SNAT #点击SNAT按钮
|
||
... ELSE IF "${WannatAction}"=="DNAT" click element id=WANNAT_action_DNAT #点击DNAT按钮
|
||
... ELSE log 不操作
|
||
|
||
Wannat-AccessMode
|
||
[Arguments] ${WannatAccessMode}
|
||
Run Keyword If "${WannatAccessMode}"=="VPN" run keywords sleep ${sleep}
|
||
... AND click element id=WANNAT_accessMode_VPN #点击VPN按钮
|
||
... ELSE IF "${WannatAccessMode}"=="Layer2" click element id=WANNAT_accessMode_Layer2 #点击Layer2按钮
|
||
... ELSE log 不操作
|
||
|
||
Wannat-OriginalPacket
|
||
[Arguments] ${WannatAction} ${WannatAccessMode} ${VPNAccountDict} ${TranslatedPacketDict} ${SourceInfo} ${DestinationInfo} ${PrivateNetworkAddress}
|
||
Run Keyword If "${WannatAction}"=="SNAT" and "${WannatAccessMode}"=="VPN" run keywords sleep ${sleep}
|
||
... AND Wannat-Edit-SANT-VPNAccount ${VPNAccountDict} #判断是否添加vpnaccount
|
||
... AND WANNAT-IPPools ${TranslatedPacketDict}
|
||
... AND ChangeSourceIP ${TranslatedPacketDict}
|
||
... AND Connection Timeout ${TranslatedPacketDict}
|
||
Run Keyword If "${WannatAction}"=="SNAT" and "${WannatAccessMode}"=="Layer2" run keywords sleep ${sleep}
|
||
... AND input text xpath=//*[@id="policy_paper_left"]/div[5]/form/div[1][contains(text(), "Original Packet")]/following-sibling::div[2]/div/div/input ${PrivateNetworkAddress}
|
||
... AND sleep ${sleep}
|
||
... AND AND WANNAT-IPPools ${TranslatedPacketDict}
|
||
... AND ChangeSourceIP ${TranslatedPacketDict}
|
||
... AND Connection Timeout ${TranslatedPacketDict}
|
||
Run Keyword If "${WannatAction}"=="DNAT" and "${WannatAccessMode}"=="VPN" run keywords sleep ${sleep}
|
||
... AND Create-Source-Button ${SourceInfo} #是否添加源ip
|
||
... AND Create-Destination-Button ${DestinationInfo} #是否添加目的ip
|
||
... AND Wannat-Edit-DANT-VPNAccount ${VPNAccountDict} #添加vpnaccount
|
||
... AND TranslatePort ${TranslatedPacketDict}
|
||
... AND Failover ${TranslatedPacketDict}
|
||
Run Keyword If "${WannatAction}"=="DNAT" and "${WannatAccessMode}"=="Layer2" run keywords sleep ${sleep}
|
||
... AND Create-Source-Button ${SourceInfo} #是否添加源ip
|
||
... AND Create-Destination-Button ${DestinationInfo} #是否添加目的ip
|
||
... AND input text xpath=//*[@id="policy_paper_left"]/div[6]/div[4][contains(text(), "Translated Packet")]/following-sibling::form/div/div/div/input ${PrivateNetworkAddress}
|
||
... AND sleep ${sleep}
|
||
... AND TranslatePort ${TranslatedPacketDict}
|
||
... AND Failover ${TranslatedPacketDict}
|
||
|
||
Wannat-Edit-SANT-VPNAccount
|
||
[Arguments] ${VPNAccountDict}
|
||
Run Keyword If "${VPNAccountDict}"=="null" run keywords sleep ${sleep}
|
||
... AND click element xpath=//*[@id="policy_paper_left"]/div[5]/form/div[1][contains(text(), "Original Packet")]/following-sibling::div/div/div/div[2]/i[2] #删除原有VpnAccount
|
||
... AND sleep ${sleep}
|
||
... ELSE Wannat-SANT-VPNAccount ${VPNAccountDict}
|
||
Wannat-SANT-VPNAccount
|
||
[Arguments] ${VPNAccountDict}
|
||
${return} ${CreateOrSearch} Run Keyword And Ignore Error Get From Dictionary ${VPNAccountDict} CreateOrSearch
|
||
${CreateOrSearch} Run Keyword If "${return}"=="FAIL" or "${CreateOrSearch}"=="${EMPTY}" set variable Create
|
||
... ELSE set variable ${CreateOrSearch}
|
||
|
||
${return} ${VPNAccountName} Run Keyword And Ignore Error Get From Dictionary ${VPNAccountDict} VPNAccountName
|
||
${VPNAccountName} Run Keyword If "${return}"=="FAIL" or "${VPNAccountName}"=="${EMPTY}" set variable VPNAccountName
|
||
... ELSE set variable ${VPNAccountName}
|
||
|
||
${return} ${VPNAccountPassword} Run Keyword And Ignore Error Get From Dictionary ${VPNAccountDict} VPNAccountPassword
|
||
${VPNAccountPassword} Run Keyword If "${return}"=="FAIL" or "${VPNAccountPassword}"=="${EMPTY}" set variable Password
|
||
... ELSE set variable ${VPNAccountPassword}
|
||
|
||
|
||
click element xpath=//*[@id="policy_paper_left"]/div[5]/form/div[1][contains(text(), "Original Packet")]/following-sibling::div/div/div/div #点击VPN Account 加号按钮
|
||
sleep ${sleep}
|
||
Run Keyword If "${CreateOrSearch}"=="Create" run keywords sleep ${sleep}
|
||
... AND click element xpath=//*[@id="policy_paper_left"]/div[5]/form/div[1][contains(text(), "Original Packet")]/following-sibling::div/div[2]/div[2]/div/div/div/div/button #点击VPN Account 加号按钮
|
||
... AND sleep ${sleep}
|
||
... AND input text xpath=//*[@id="policy_paper_left"]/div[5]/form/div[1][contains(text(), "Original Packet")]/following-sibling::div/div[3]/div/div[2]/div/div[2]/div/div/div/form/div[2]/div/div/div/input ${VPNAccountName} #输入vpn的name
|
||
... AND sleep ${sleep}
|
||
... AND input text xpath=//*[@id="policy_paper_left"]/div[5]/form/div[1][contains(text(), "Original Packet")]/following-sibling::div/div[3]/div/div[2]/div/div[2]/div/div/div/form/div[3]/div/div/input ${VPNAccountPassword} #输入vpn的password
|
||
... AND sleep ${sleep}
|
||
... AND click element xpath=//*[@id="policy_paper_left"]/div[5]/form/div[1][contains(text(), "Original Packet")]/following-sibling::div/div[3]/div/div[3]/button #点击OK
|
||
... AND sleep ${sleep}
|
||
... AND click element xpath=//*[@id="policy_paper_left"]/div[5]/form/div[1][contains(text(), "Original Packet")]/following-sibling::div/div[2]/div[2]/div[3]/div/button #点击close
|
||
... AND sleep ${sleep}
|
||
... ELSE IF "${CreateOrSearch}"=="Search" sleep ${sleep}
|
||
... AND input text xpath=//*[@id="policy_paper_left"]/div[5]/form/div[1][contains(text(), "Original Packet")]/following-sibling::div/div[2]/div[2]/div/div/div/input ${VPNAccountName} #输入vpn的name
|
||
... AND sleep ${sleep}
|
||
... AND press keys xpath=//*[@id="policy_paper_left"]/div[5]/form/div[1][contains(text(), "Original Packet")]/following-sibling::div/div[2]/div[2]/div/div/div/input ENTER
|
||
... AND sleep ${sleep}
|
||
... AND click element xpath=//*[@id="policy_paper_left"]/div[5]/form/div[1][contains(text(), "Original Packet")]/following-sibling::div/div[2]/div[2]/div/div/div[3]/div/div/ul/li
|
||
... AND sleep ${sleep}
|
||
... AND click element xpath=//*[@id="policy_paper_left"]/div[5]/form/div[1][contains(text(), "Original Packet")]/following-sibling::div/div[2]/div[2]/div[3]/div/button #点击close
|
||
... ELSE log 不操作
|
||
|
||
Wannat-Edit-DANT-VPNAccount
|
||
[Arguments] ${VPNAccountDict}
|
||
Run Keyword If "${VPNAccountDict}"=="null" run keywords sleep ${sleep}
|
||
... AND click element xpath=//*[@id="policy_paper_left"]/div[6]/div[4][contains(text(), "Other Options")]/following-sibling::div/div/div/div[2]/i[2] #删除原有VpnAccount
|
||
... AND sleep ${sleep}
|
||
... ELSE Wannat-DANT-VPNAccount ${VPNAccountDict}
|
||
|
||
Wannat-DANT-VPNAccount
|
||
[Arguments] ${VPNAccountDict}
|
||
${return} ${CreateOrSearch} Run Keyword And Ignore Error Get From Dictionary ${VPNAccountDict} CreateOrSearch
|
||
${CreateOrSearch} Run Keyword If "${return}"=="FAIL" or "${CreateOrSearch}"=="${EMPTY}" set variable Create
|
||
... ELSE set variable ${CreateOrSearch}
|
||
|
||
${return} ${VPNAccountName} Run Keyword And Ignore Error Get From Dictionary ${VPNAccountDict} VPNAccountName
|
||
${VPNAccountName} Run Keyword If "${return}"=="FAIL" or "${VPNAccountName}"=="${EMPTY}" set variable VPNAccountName
|
||
... ELSE set variable ${VPNAccountName}
|
||
|
||
${return} ${VPNAccountPassword} Run Keyword And Ignore Error Get From Dictionary ${VPNAccountDict} VPNAccountPassword
|
||
${VPNAccountPassword} Run Keyword If "${return}"=="FAIL" or "${VPNAccountPassword}"=="${EMPTY}" set variable Password
|
||
... ELSE set variable ${VPNAccountPassword}
|
||
|
||
|
||
click element xpath=//*[@id="policy_paper_left"]/div[6]/div[4][contains(text(), "Other Options")]/following-sibling::div/div/div/div #点击VPN Account 加号按钮
|
||
sleep ${sleep}
|
||
Run Keyword If "${CreateOrSearch}"=="Create" run keywords sleep ${sleep}
|
||
... AND click element xpath=//*[@id="policy_paper_left"]/div[6]/div[4][contains(text(), "Other Options")]/following-sibling::div/div[2]/div[2]/div/div/div/div/button #点击VPN Account 加号按钮
|
||
... AND sleep ${sleep}
|
||
... AND input text xpath=//*[@id="policy_paper_left"]/div[6]/div[4][contains(text(), "Other Options")]/following-sibling::div/div[3]/div/div[2]/div/div[2]/div/div/div/form/div[2]/div/div/div/input ${VPNAccountName} #输入vpn的name
|
||
... AND sleep ${sleep}
|
||
... AND input text xpath=//*[@id="policy_paper_left"]/div[6]/div[4][contains(text(), "Other Options")]/following-sibling::div/div[3]/div/div[2]/div/div[2]/div/div/div/form/div[3]/div/div/input ${VPNAccountPassword} #输入vpn的password
|
||
... AND sleep ${sleep}
|
||
... AND click element xpath=//*[@id="policy_paper_left"]/div[6]/div[4][contains(text(), "Other Options")]/following-sibling::div/div[3]/div/div[3]/button #点击OK
|
||
... AND sleep ${sleep}
|
||
... AND click element xpath=//*[@id="policy_paper_left"]/div[6]/div[4][contains(text(), "Other Options")]/following-sibling::div/div[2]/div[2]/div[3]/div/button #点击close
|
||
... AND sleep ${sleep}
|
||
... ELSE IF "${CreateOrSearch}"=="Search" sleep ${sleep}
|
||
... AND input text xpath=//*[@id="policy_paper_left"]/div[6]/div[4][contains(text(), "Other Options")]/following-sibling::div/div[2]/div[2]/div/div/div/input ${VPNAccountName} #输入vpn的name
|
||
... AND sleep ${sleep}
|
||
... AND press keys xpath=//*[@id="policy_paper_left"]/div[6]/div[4][contains(text(), "Other Options")]/following-sibling::div/div[2]/div[2]/div/div/div/input ENTER
|
||
... AND sleep ${sleep}
|
||
... AND click element xpath=//*[@id="policy_paper_left"]/div[6]/div[4][contains(text(), "Other Options")]/following-sibling::div/div[2]/div[2]/div/div/div[3]/div/div/ul/li
|
||
... AND sleep ${sleep}
|
||
... AND click element xpath=//*[@id="policy_paper_left"]/div[6]/div[4][contains(text(), "Other Options")]/following-sibling::div/div[2]/div[2]/div[3]/div/button #点击close
|
||
... ELSE log 不操作
|
||
|
||
Create-Source-Button
|
||
[Arguments] ${SourceInfo}
|
||
Run Keyword If "${SourceInfo}"!="${EMPTY}" or "${SourceInfo}"!="null" run keywords sleep ${sleep}
|
||
... AND click element xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[6]/div[2]/div[1]/div/div #点击添加源ip
|
||
... AND sleep ${sleep}
|
||
... AND CreateEditDeleteSources ${SourceInfo}
|
||
... ELSE log there is no SourceInfo
|
||
|
||
|
||
|
||
Create-Destination-Button
|
||
[Arguments] ${DestinationInfo}
|
||
Run Keyword If "${DestinationInfo}"!="${EMPTY}" or "${DestinationInfo}"!="null" run keywords sleep ${sleep}
|
||
... AND click element xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[6]/div[3]/div[1]/div/div #点击添加源ip
|
||
... AND sleep ${sleep}
|
||
... AND CreateEditDeleteSources ${DestinationInfo}
|
||
... ELSE log there is no DestinationInfo
|
||
|
||
|
||
CreateEditDeleteSources
|
||
[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
|
||
... ELSE CreateSources1 ${AddList}
|
||
|
||
CreateSources1
|
||
[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
|
||
... ${ObjectName}:列表形式,列表中是对象的名字
|
||
... ${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
|
||
|
||
|
||
CreateSource
|
||
[Arguments] ${AddDict}
|
||
#[Arguments] ${PolicyType}=null ${Type1}=null ${CreateOrSearch}=null ${Add}=null ${Name}=null
|
||
#... ${ObjectName}=null ${Ipclienttext1}=null ${Port}=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段
|
||
... ${Port}:填入端口
|
||
... ${Country}:列表形式,列表中是国家名字
|
||
... ${City}:列表形式,列表中是城市名字
|
||
... ${Protocols1}:填入HTTP或SSL或HTTPSSL
|
||
... ${Degree}:填入1Degree或2Degree
|
||
... ${Times}:填入小时数,例如1或2
|
||
... ${Numbers}:填入数值,例如1或10000
|
||
... ${Limits}:填入数值,例如1或10000
|
||
... ${ObjectName}:列表形式,列表中是对象的名字
|
||
... ${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}
|
||
${typepath} Run Keyword If "${Sordtype}"=="Source" set variable /html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[6]/div[2]
|
||
... ELSE set variable /html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[6]/div[3]
|
||
|
||
${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} ${ObjectName} Run Keyword And Ignore Error Get From Dictionary ${AddDict} ObjectName
|
||
${ObjectName} Run Keyword If "${return}"=="FAIL" or "${ObjectName}"=="${EMPTY}" set variable null
|
||
... ELSE set variable ${ObjectName}
|
||
${return} ${Name} Run Keyword And Ignore Error Get From Dictionary ${AddDict} Name
|
||
${Name} Run Keyword If "${return}"=="FAIL" or "${Name}"=="${EMPTY}" set variable null
|
||
... ELSE set variable ${Name}
|
||
${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}
|
||
${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}
|
||
${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}
|
||
|
||
sleep ${sleep}
|
||
SourceIPCreateOrSearch ${Sordtype} ${typepath} ${CreateOrSearch} ${Add} ${Type1} ${Name} ${ObjectName} ${Ipclienttext1} ${Port} ${Country} ${City} ${Fqdn} ${Protocols1} ${Degree} ${Times} ${Numbers} ${Limits}
|
||
|
||
|
||
SourceIPCreateOrSearch
|
||
[Arguments] ${Sordtype} ${PolicyType} ${CreateOrSearch} ${Add} ${Ip_type} ${Name} ${ObjectName} ${Ipclienttext1}
|
||
... ${Port} ${Country} ${City} ${Fqdn} ${Protocols1} ${Degree} ${Times} ${Numbers} ${Limits}
|
||
[Documentation] 调用次关键字前需要添加必填参数:
|
||
... ${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
|
||
... ${ObjectName}:列表形式,列表中是对象的名字
|
||
... 判断是新建ip还是搜索添加ip
|
||
run keyword if "${CreateOrSearch}"=="Create" run keywords sleep ${sleep}
|
||
... AND SourceOrDestination ${Sordtype}
|
||
... AND SourceIPAdd ${PolicyType} ${Add} ${Ip_type} ${Name} ${ObjectName} ${Ipclienttext1} ${Port} ${Country} ${City} ${Fqdn} ${Protocols1} ${Degree} ${Times} ${Numbers} ${Limits}
|
||
... ELSE IF "${CreateOrSearch}"=="Search" run keywords sleep ${sleep}
|
||
... AND SourceSearch ${PolicyType} ${ObjectName}
|
||
|
||
SourceOrDestination
|
||
[Arguments] ${Sordtype}
|
||
run keyword if "${Sordtype}"=="Source" run keywords sleep ${sleep}
|
||
... AND click element id=interceptionadd_proaddaddSource
|
||
... ELSE click element id=interceptionadd_proaddaddDestination
|
||
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}
|
||
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}
|
||
END
|
||
|
||
|
||
|
||
SourceIPAdd
|
||
[Arguments] ${PolicyType} ${Add} ${Ip_type} ${Name} ${ObjectName} ${Ipclienttext1} ${Port} ${Country} ${City} ${Fqdn} ${Protocols1} ${Degree} ${Times} ${Numbers} ${Limits}
|
||
[Documentation] 调用次关键字前需要添加必填参数:
|
||
... ${Add}:填入Address或Group
|
||
... ${Ip_type}:填入IP或者Geography或者IPLearning
|
||
... 判断是新建ip还是新建ip分组
|
||
run keyword if "${Add}"=="Address" run keywords sleep ${sleep}
|
||
... AND click element xpath=/html/body/ul/li[1]
|
||
... 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}
|
||
... AND click element xpath=/html/body/ul/li[2]
|
||
... AND sleep ${sleep}
|
||
... AND SourceIPGroupAdd ${PolicyType} ${Name} ${Ip_type} ${ObjectName}
|
||
SourceIPAddress
|
||
[Arguments] ${PolicyType} ${Name} ${Ip_type} ${Ipclienttext1} ${Port} ${Country} ${City} ${Fqdn} ${Protocols1} ${Degree} ${Times} ${Numbers} ${Limits}
|
||
[Documentation] 调用次关键字前需要添加必填参数:
|
||
... ${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
|
||
... 判断 新建选择用什么样的类型,并进行新建
|
||
SourceCreate-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}
|
||
... AND NewObject.Create-Geography ${Country} ${City}
|
||
... AND sleep ${sleep}
|
||
... AND click element xpath=${PolicyType}/div[2]/div[2]/div/div[1]/div[10]/div/div/div/div[4]/button
|
||
... 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=//*[@id="policy_Manipulation2"]/div[1]/div[1]/div[2]/form/div[5]/div[1]/div/div/div[2]
|
||
... AND sleep ${sleep}
|
||
... AND ProxyWANNAT.Learn-From-Protocols ${Protocols1}
|
||
... AND ProxyWANNAT.Learning-Depth ${PolicyType} ${Degree}
|
||
... AND sleep ${sleep}
|
||
... AND input text xpath=//*[@id="policy_Manipulation2"]/div[1]/div[1]/div[2]/form/div[5]/div[3]/div/div[1]/input ${Times}
|
||
... AND sleep ${sleep}
|
||
... AND input text xpath=//*[@id="policy_Manipulation2"]/div[1]/div[1]/div[2]/form/div[5]/div[4]/div/div[1]/input ${Numbers}
|
||
... AND sleep ${sleep}
|
||
... AND input text xpath=//*[@id="policy_Manipulation2"]/div[1]/div[1]/div[2]/form/div[5]/div[5]/div/div[1]/input ${Limits}
|
||
... AND sleep ${sleep}
|
||
sleep ${sleep}
|
||
SourceCreate-ok ${PolicyType}
|
||
|
||
|
||
Learn-From-Protocols
|
||
[Arguments] ${Protocols1}
|
||
[Documentation] 调用次关键字前需要添加必填参数:
|
||
... ${Protocols1}:填入HTTP或SSL或者HTTPSSL
|
||
... 判断选择用什么样的协议
|
||
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]
|
||
|
||
Learning-Depth
|
||
[Arguments] ${PolicyType} ${Degree}
|
||
[Documentation] 调用次关键字前需要添加必填参数:
|
||
... ${Degree}:填入1Degree或2Degree
|
||
... 判断是用1Degree或2Degree
|
||
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]
|
||
|
||
SourceIPGroupAdd
|
||
[Arguments] ${PolicyType} ${Name} ${Ip_type} ${ObjectName}
|
||
[Documentation] 调用次关键字前需要添加必填参数:
|
||
... ${Name}:名称
|
||
... ${Ip_type}:填入Ip或者Geography
|
||
... ${ObjectName}:列表形式,列表中是对象的名字
|
||
SourceCreate-name ${PolicyType} ${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 ${ObjectName}
|
||
NewObject.Create-ok
|
||
|
||
SourceCreate-name
|
||
[Arguments] ${PolicyType} ${ObjName}
|
||
sleep ${sleep}
|
||
input text xpath=${PolicyType}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[1]/div/div[1]/input ${ObjName}
|
||
|
||
SourceCreate-ok
|
||
[Arguments] ${PolicyType}
|
||
sleep ${sleep}
|
||
click button xpath=${PolicyType}/div[2]/div[2]/div/div[2]/button[1]
|
||
|
||
WANNAT-IPPools
|
||
[Arguments] ${TranslatedPacketDict} #${CreateOrSearch} ${IPPoolsName} ${IPPoolsValue}
|
||
|
||
${return} ${CreateOrSearch} Run Keyword And Ignore Error Get From Dictionary ${TranslatedPacketDict} CreateOrSearch
|
||
${CreateOrSearch} Run Keyword If "${return}"=="FAIL" or "${CreateOrSearch}"=="${EMPTY}" set variable null
|
||
... ELSE set variable ${CreateOrSearch}
|
||
|
||
${return} ${IPPoolsName} Run Keyword And Ignore Error Get From Dictionary ${TranslatedPacketDict} IPPoolsName
|
||
${IPPoolsName} Run Keyword If "${return}"=="FAIL" or "${IPPoolsName}"=="${EMPTY}" set variable null
|
||
... ELSE set variable ${IPPoolsName}
|
||
|
||
${return} ${IPPoolsValue} Run Keyword And Ignore Error Get From Dictionary ${TranslatedPacketDict} IPPoolsValue
|
||
${IPPoolsValue} Run Keyword If "${return}"=="FAIL" or "${IPPoolsValue}"=="${EMPTY}" set variable null
|
||
... ELSE set variable ${IPPoolsValue}
|
||
|
||
sleep ${sleep}
|
||
click element id=WANNAT_ipPool #点击ipPool 的加号按钮
|
||
run keyword if "${CreateOrSearch}"=="Create" run keywords sleep ${sleep}
|
||
... AND click element id=WANNAT_proaddadd
|
||
... AND sleep ${sleep}
|
||
... AND input text xpath=//*[@id="wannat_vpn_color"]/form/div[1]/div/div[1]/div[1]/input ${IPPoolsName}[0] #输入name
|
||
... AND sleep ${sleep}
|
||
... AND IPPoolsFor ${IPPoolsValue}
|
||
... AND sleep ${sleep}
|
||
... AND click element id=wan_reach_test # 点击Reachability Test
|
||
... AND sleep 10
|
||
... AND click element xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[5]/div[2]/div/div[3]/button[1] #点击OK
|
||
run keyword if "${CreateOrSearch}"=="Search" run keywords sleep ${sleep}
|
||
... AND SearchIPPoolsFor ${IPPoolsName}
|
||
... AND sleep ${sleep}
|
||
|
||
IPPoolsFor
|
||
[Arguments] ${IPPoolsValue}
|
||
FOR ${i} IN @{IPPoolsValue}
|
||
click element xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[5]/div[2]/div/div[2]/div/div[2]/div/div/div/form/div[3]/div/div/div[3]/i #点击+号
|
||
sleep ${sleep}
|
||
input text xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[5]/div[2]/div/div[2]/div/div[2]/div/div/div/form/div[3]/div/div/div[2]/div[1]/div/div/div[1]/div[1]/div/div[2]/div/input ${i} #输入值
|
||
END
|
||
|
||
SearchIPPoolsFor
|
||
[Arguments] ${IPPoolsName}
|
||
FOR ${i} IN @{IPPoolsName}
|
||
input text id=objectName_seach_IPPool ${i}
|
||
sleep ${sleep}
|
||
press keys id=objectName_seach_IPPool ENTER
|
||
sleep ${sleep}
|
||
click element xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[5]/div[1]/div[2]/div[1]/div/div[3]/div/div/ul/li[1]
|
||
|
||
END
|
||
|
||
ChangeSourceIP
|
||
[Arguments] ${TranslatedPacketDict}
|
||
|
||
${return} ${ChangeSourceIP} Run Keyword And Ignore Error Get From Dictionary ${TranslatedPacketDict} ChangeSourceIP
|
||
${ChangeSourceIP} Run Keyword If "${return}"=="FAIL" or "${ChangeSourceIP}"=="${EMPTY}" set variable null
|
||
... ELSE set variable ${ChangeSourceIP}
|
||
|
||
${return} ${ByTimeValue} Run Keyword And Ignore Error Get From Dictionary ${TranslatedPacketDict} ByTimeValue
|
||
${ByTimeValue} Run Keyword If "${return}"=="FAIL" or "${ByTimeValue}"=="${EMPTY}" set variable null
|
||
... ELSE set variable ${ByTimeValue}
|
||
|
||
${return} ${ByConnectionsValue} Run Keyword And Ignore Error Get From Dictionary ${TranslatedPacketDict} ByConnectionsValue
|
||
${ByConnectionsValue} Run Keyword If "${return}"=="FAIL" or "${ByConnectionsValue}"=="${EMPTY}" set variable null
|
||
... ELSE set variable ${ByConnectionsValue}
|
||
|
||
run keyword if "${ChangeSourceIP}"=="Never" run keywords sleep ${sleep}
|
||
... AND click element id=WANNAT_snat_algorithm_Never
|
||
... AND sleep ${sleep}
|
||
run keyword if "${ChangeSourceIP}"=="By Time" run keywords sleep ${sleep}
|
||
... AND click element id=WANNAT_snat_algorithm_By Time
|
||
... AND sleep ${sleep}
|
||
... AND input text id=WANNATADD_Time_time1 ${ByTimeValue}
|
||
... AND sleep ${sleep}
|
||
run keyword if "${ChangeSourceIP}"=="By Connections" run keywords sleep ${sleep}
|
||
... AND click element id=WANNAT_snat_algorithm_By Connections
|
||
... AND sleep ${sleep}
|
||
... AND input text id=WANNATADD_Time_count1 ${ByConnectionsValue}
|
||
... AND sleep ${sleep}
|
||
|
||
Connection Timeout
|
||
[Arguments] ${TranslatedPacketDict}
|
||
|
||
${return} ${ConnectionTimeout} Run Keyword And Ignore Error Get From Dictionary ${TranslatedPacketDict} ConnectionTimeout
|
||
${ConnectionTimeout} Run Keyword If "${return}"=="FAIL" or "${ConnectionTimeout}"=="${EMPTY}" set variable null
|
||
... ELSE set variable ${ConnectionTimeout}
|
||
|
||
input text id=WANNATADD_connectionTimeout1 ${ConnectionTimeout}
|
||
|
||
TranslatePort
|
||
[Arguments] ${TranslatedPacketDict}
|
||
|
||
${return} ${TranslatePort} Run Keyword And Ignore Error Get From Dictionary ${TranslatedPacketDict} TranslatePort
|
||
${TranslatePort} Run Keyword If "${return}"=="FAIL" or "${TranslatePort}"=="${EMPTY}" set variable null
|
||
... ELSE set variable ${TranslatePort}
|
||
|
||
input text id=WANNATADD_dnat_destination_port1 ${TranslatePort}
|
||
|
||
Failover
|
||
[Arguments] ${TranslatedPacketDict} # ${ChangeSourceIP} ${ByTimeValue} ${ByConnectionsValue}
|
||
|
||
${return} ${Failover} Run Keyword And Ignore Error Get From Dictionary ${TranslatedPacketDict} Failover
|
||
${Failover} Run Keyword If "${return}"=="FAIL" or "${Failover}"=="${EMPTY}" set variable null
|
||
... ELSE set variable ${Failover}
|
||
|
||
|
||
run keyword if "${Failover}"=="Drop Packet" run keywords sleep ${sleep}
|
||
... AND click element id=WANNAT_failoverlist_Drop Packet
|
||
... AND sleep ${sleep}
|
||
run keyword if "${Failover}"=="Forward to original destination" run keywords sleep ${sleep}
|
||
... AND click element id=WANNAT_failoverlist_Forward to original destination
|
||
|
||
WANNAT-Enabled
|
||
[Arguments] ${Enabled}
|
||
run keyword if "${Enabled}"=="open" or "${Enabled}"=="close" run keywords sleep ${sleep}
|
||
... AND click element xpath=//*[@id="policy_paper_left"]/div[10]/div/div
|
||
... AND sleep ${sleep}
|
||
... AND click element xpath=/html/body/div/div/div[3]/button[2]
|
||
... AND sleep ${sleep}
|
||
... ELSE log 保持不动
|
||
|
||
|
||
WANNAT-OK
|
||
click element id=tagAddOk1 #点击ok
|
||
|
||
|
||
|
||
|
||
WANNAT-Assertion
|
||
[Arguments] ${name} ${search}=Name
|
||
sleep 5
|
||
WANNAT-Search ${name} ${search} #搜索刚新建的name
|
||
${text1} Get Text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/p #获取点击后页面文本信息
|
||
Should Be Equal As Strings ${text1} ${name} #断言
|
||
|
||
|
||
|
||
WANNAT-Search
|
||
[Arguments] ${value} ${search}
|
||
sleep ${sleep}
|
||
click element id=sidebarWan_nat
|
||
sleep ${sleep}
|
||
Wait Until Element Is Visible xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[1]/span/div/div/div[2]/div/div/div/input 20
|
||
click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[1]/span/div/div/div[2]/div/div/div/input #点击搜索框
|
||
sleep ${sleep}
|
||
#判断是使用name搜索还是id搜索
|
||
run keyword if "${search}"=="Name" run keywords sleep ${sleep}
|
||
... AND click element xpath=/html/body/div/div[1]/div[1]/ul/li[3]
|
||
... AND 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 ${value}
|
||
... ELSE IF "${search}"=="ID" run keywords sleep ${sleep}
|
||
... AND click element xpath=/html/body/div/div[1]/div[1]/ul/li[2]
|
||
... AND 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 ${value}
|
||
... AND sleep ${sleep}
|
||
click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[1]/span/div/i #点击搜索按钮
|
||
sleep ${sleep}
|
||
Run Keyword And Ignore Error click element xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1] #点击搜索到的列表
|
||
sleep ${sleep}
|
||
|
||
|
||
Delete-Proxy-estimate
|
||
[Arguments] ${securityname}
|
||
run keyword if "${securityname}"!="null" run keywords sleep ${sleep}
|
||
... AND Delete-Proxy ${securityname}
|
||
... ELSE log go on
|
||
|
||
Delete-Proxy
|
||
[Arguments] ${name}
|
||
|
||
Menu policys WAN NAT
|
||
sleep ${sleep}
|
||
WANNAT-Search ${name} Name
|
||
sleep ${sleep}
|
||
Run Keyword And Ignore Error click element id=appDel
|
||
sleep ${sleep}
|
||
Run Keyword And Ignore Error click element xpath=/html/body/div/div/div[3]/button[2]
|
||
sleep ${sleep}
|
||
|
||
Delete-object-estimate
|
||
[Arguments] ${obj}
|
||
run keyword if "${obj}"!="null" run keywords sleep ${sleep}
|
||
... AND Delete-object ${obj}
|
||
... ELSE log go on
|
||
Delete-object
|
||
[Arguments] ${obj}
|
||
FOR ${num} ${key} IN ENUMERATE @{obj}
|
||
Forname ${obj}[${key}] ${key}
|
||
|
||
END
|
||
|
||
Forname
|
||
[Arguments] ${objectname} ${key}
|
||
FOR ${i} IN @{objectname}
|
||
Menu settings WAN NAT Profiles
|
||
sleep ${sleep}
|
||
run keyword if "${key}"=="SNAT IP Pools" run keywords sleep ${sleep}
|
||
... AND click element id=ip
|
||
... AND sleep ${sleep}
|
||
... AND click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div/div[2]/div[2]/div/div/div[2]/div/div/div/input #点击输入框
|
||
... AND sleep ${sleep}
|
||
... AND click element xpath=/html/body/div/div[1]/div[1]/ul/li[3] #点击name为搜索类型
|
||
... AND sleep ${sleep}
|
||
... AND input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div/div[2]/div[2]/div/div/div[2]/div/div[1]/div[3]/div/input ${i} #输入搜索内容
|
||
... AND sleep ${sleep}
|
||
... AND click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div/div[2]/div[2]/div/i #点击搜索按钮
|
||
... AND sleep ${sleep}
|
||
... AND Run Keyword And Ignore Error click element xpath=//*[@id="wannat-table"]/div[3]/table/tbody/tr[1] #选择搜索到的列表
|
||
... AND sleep ${sleep}
|
||
... AND Run Keyword And Ignore Error click element id=appDel #点击删除按钮
|
||
... AND sleep ${sleep}
|
||
... AND Run Keyword And Ignore Error click element xpath=/html/body/div/div/div[3]/button[2]
|
||
... AND sleep ${sleep}
|
||
run keyword if "${key}"=="VPN Accounts" run keywords sleep ${sleep}
|
||
... AND click element id=account
|
||
... AND sleep ${sleep}
|
||
... AND click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div/div[2]/div[2]/div/div/div[2]/div/div/div/input #点击输入框
|
||
... AND sleep ${sleep}
|
||
... AND click element xpath=/html/body/div/div[1]/div[1]/ul/li[2] #点击name为搜索类型
|
||
... AND sleep ${sleep}
|
||
... AND input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div/div[2]/div[2]/div/div/div[2]/div/div[1]/div[3]/div/input ${i} #输入搜索内容
|
||
... AND sleep ${sleep}
|
||
... AND click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div/div[2]/div[2]/div/i #点击搜索按钮
|
||
... AND sleep ${sleep}
|
||
... AND Run Keyword And Ignore Error click element xpath=//*[@id="wannat-table"]/div[3]/table/tbody/tr[1] #选择搜索到的列表
|
||
... AND sleep ${sleep}
|
||
... AND Run Keyword And Ignore Error click element id=appDel #点击删除按钮
|
||
... AND sleep ${sleep}
|
||
... AND Run Keyword And Ignore Error click element xpath=/html/body/div/div/div[3]/button[2]
|
||
... AND sleep ${sleep}
|
||
END |