提交wannat关键字和用例示例

This commit is contained in:
lyf
2021-03-12 18:12:24 +08:00
parent 2e9014d555
commit 6490e234f0
2 changed files with 268 additions and 70 deletions

View File

@@ -0,0 +1,110 @@
*** Settings ***
Test Teardown run keywords Delete-Proxy-estimate ${PolicyName}
... AND Delete-object-estimate ${ObjName}
Force Tags tsg-ui Policies Security
Library Selenium2Library
Resource ../../../02-Keyword/tsg_ui/objects/NewObjectPages.robot
Resource ../../../02-Keyword/tsg_ui/objects/NewObject.robot
Resource ../../../02-Keyword/tsg_ui/Menu.robot
Resource ../../../03-Variable/PolicyObjectDefault.txt
Resource ../../../02-Keyword/tsg_ui/ProxyWANNAT.robot/ProxyWANNAT.robot
*** Test Cases ***
###############################################################WANNAT#################################################################
CreateWANNATCase-001
${AddWANNATDict} Create Dictionary Wannatname=${TEST NAME}_Wannat WannatAction=SNAT WannatAccessMode=VPN Enabled=open
${VPNAccountDict} Create Dictionary CreateOrSearch=Create VPNAccountName=${TEST NAME}_VPN1 VPNAccountPassword=123456
${VPNAccounName} create list ${TEST NAME}_VPN1
${IPPoolsName} create list ${TEST NAME}_IPPools1
${IPPoolsValue} create list 192.168.50.17
${TranslatedPacketDict} Create Dictionary CreateOrSearch=Create IPPoolsName=${IPPoolsName} IPPoolsValue=${IPPoolsValue} ChangeSourceIP=By Time ByTimeValue=50 ConnectionTimeout=10
UIAddWANNAT AddWANNATDict=${AddWANNATDict} VPNAccountDict=${VPNAccountDict} TranslatedPacketDict=${TranslatedPacketDict}
${PolicyName} set variable ${AddWANNATDict}[Wannatname]
${ObjName} Create Dictionary VPN Accounts=${VPNAccounName} SNAT IP Pools=${IPPoolsName}
CreateWANNATCase-002
${AddWANNATDict} Create Dictionary Wannatname=${TEST NAME}_Wannat WannatAction=DNAT WannatAccessMode=Layer2 PrivateNetworkAddress=192.168.50.17 Enabled=open
${sip1} Create Dictionary Sordtype=Source Type1=Ip CreateOrSearch=Create Add=Address Name=${TEST NAME}_IP1 Ipclienttext1=192.168.40.11-192.168.40.110 Port=1-65535
${sourceAddIpList} Create List ${sip1}
${sourceInfo} Create Dictionary sourceAddIpList=${sourceAddIpList}
${ip_name1} create list ${TEST NAME}_IP1
${dip1} Create Dictionary Sordtype=Destination Type1=Ip CreateOrSearch=Search ObjectName=${ip_name1}
${destinationAddIpList} Create List ${dip1}
${destinationInfo} Create Dictionary sourceAddIpList=${destinationAddIpList}
${TranslatedPacketDict} Create Dictionary TranslatePort=10 Failover=Forward to original destination
UIAddWANNAT AddWANNATDict=${AddWANNATDict} SourceInfo=${sourceInfo} DestinationInfo=${destinationInfo} TranslatedPacketDict=${TranslatedPacketDict}
${PolicyName} set variable ${AddWANNATDict}[Wannatname]
${ObjName} Create Dictionary
EditWANNATCase-003
${AddWANNATDict} Create Dictionary Wannatname=${TEST NAME}_Wannat WannatAction=DNAT WannatAccessMode=Layer2 PrivateNetworkAddress=192.168.50.17 Enabled=open
${sip1} Create Dictionary Sordtype=Source Type1=Ip CreateOrSearch=Create Add=Address Name=${TEST NAME}_IP1 Ipclienttext1=192.168.40.11-192.168.40.110 Port=1-65535
${sourceAddIpList} Create List ${sip1}
${sourceInfo} Create Dictionary sourceAddIpList=${sourceAddIpList}
${ip_name1} create list ${TEST NAME}_IP1
${dip1} Create Dictionary Sordtype=Destination Type1=Ip CreateOrSearch=Search ObjectName=${ip_name1}
${destinationAddIpList} Create List ${dip1}
${destinationInfo} Create Dictionary sourceAddIpList=${destinationAddIpList}
${TranslatedPacketDict} Create Dictionary TranslatePort=10 Failover=Forward to original destination
UIAddWANNAT AddWANNATDict=${AddWANNATDict} SourceInfo=${sourceInfo} DestinationInfo=${destinationInfo} TranslatedPacketDict=${TranslatedPacketDict}
${EditWANNATDict} Create Dictionary Wannatname=${TEST NAME}_Wannat Edittcpname=${TEST NAME}_Edit WannatAction=SNAT WannatAccessMode=VPN Enabled=open
${VPNAccountDict1} Create Dictionary CreateOrSearch=Create VPNAccountName=${TEST NAME}_VPN1 VPNAccountPassword=123456
${VPNAccounName} create list ${TEST NAME}_VPN1
${IPPoolsName} create list ${TEST NAME}_IPPools1
${IPPoolsValue} create list 192.168.50.17
${TranslatedPacketDict1} Create Dictionary CreateOrSearch=Create IPPoolsName=${IPPoolsName} IPPoolsValue=${IPPoolsValue} ChangeSourceIP=By Time ByTimeValue=50 ConnectionTimeout=10
UIUpdateWANNAT UpdateWANNATDict=${EditWANNATDict} VPNAccountDict=${VPNAccountDict1} TranslatedPacketDict=${TranslatedPacketDict1}
${PolicyName} set variable ${AddWANNATDict}[Edittcpname]
${ObjName} Create Dictionary VPN Accounts=${VPNAccounName} SNAT IP Pools=${IPPoolsName}

View File

@@ -3,10 +3,10 @@ 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
[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}
@@ -17,19 +17,72 @@ UIAddWANNAT
${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} ${TranslatedPacketDict} ${VPNAccountDict} ${SourceInfo} ${DestinationInfo} ${PrivateNetworkAddress}
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}
@@ -45,14 +98,14 @@ Edit-WANNAT
sleep ${sleep}
Menu policys WAN NAT
sleep ${sleep}
Proxy-TCP-Options-Search ${Wannatname} Name #搜索策略
WANNAT-Search ${Wannatname} Name #搜索策略
sleep ${sleep}
click element id=appEdit #点击Edit按钮
sleep ${sleep}
Edit-Proxy-TCP-Name
[Arguments] ${Edittcpname}
input text id=advancedAdd_policyName ${Edittcpname} #输入name
input text id=WANNATADD_name1 ${Edittcpname} #输入name
Wannat-Action
[Arguments] ${WannatAction}
@@ -69,9 +122,9 @@ Wannat-AccessMode
... ELSE log 不操作
Wannat-OriginalPacket
[Arguments] ${WannatAction} ${WannatAccessMode} ${TranslatedPacketDict} ${VPNAccountDict} ${SourceInfo} ${DestinationInfo} ${PrivateNetworkAddress}
[Arguments] ${WannatAction} ${WannatAccessMode} ${VPNAccountDict} ${TranslatedPacketDict} ${SourceInfo} ${DestinationInfo} ${PrivateNetworkAddress}
Run Keyword If "${WannatAction}"=="SNAT" and "${WannatAccessMode}"=="VPN" run keywords sleep ${sleep}
... AND Wannat-SANT-VPNAccount ${VPNAccountDict} #添加vpnaccount
... AND Wannat-Edit-SANT-VPNAccount ${VPNAccountDict} #判断是否添加vpnaccount
... AND WANNAT-IPPools ${TranslatedPacketDict}
... AND ChangeSourceIP ${TranslatedPacketDict}
... AND Connection Timeout ${TranslatedPacketDict}
@@ -84,18 +137,23 @@ Wannat-OriginalPacket
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-DANT-VPNAccount ${VPNAccountDict} #添加vpnaccount
... 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::from/div/div/div/input ${PrivateNetworkAddress}
... 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
@@ -111,29 +169,36 @@ Wannat-SANT-VPNAccount
... ELSE set variable ${VPNAccountPassword}
click element xpath=//*[@id="policy_paper_left"]/div[5]/form/div[1][contains(text(), "Original Packet")]/following-sibling::div[2]/div/div/div #点击VPN Account 加号按钮
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[2]/div[2]/div[2]/div/div/div/div/button #点击VPN Account 加号按钮
... 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[2]/div[3]/div/div[2]/div/div[2]/div/div/div/from/div[2]/div/div/div/input ${VPNAccountName} #输入vpn的name
... 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[2]/div[3]/div/div[2]/div/div[2]/div/div/div/from/div[3]/div/div/input ${VPNAccountPassword} #输入vpn的password
... 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[2]/div[3]/div/div[3]/button #点击OK
... 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[2]/div[2]/div[2]/div[3]/div/button #点击close
... 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[2]/div[2]/div[2]/div/div/div/input ${VPNAccountName} #输入vpn的name
... 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[2]/div[2]/div[2]/div/div/div/input ENTER
... 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[2]/div[2]/div[2]/div/div/div[3]/div/div/ul/li
... 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[2]/div[2]/div[2]/div[3]/div/button #点击close
... 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
@@ -149,27 +214,27 @@ Wannat-DANT-VPNAccount
... ELSE set variable ${VPNAccountPassword}
click element xpath=//*[@id="policy_paper_left"]/div[6]/div[4][contains(text(), "Other Options")]/following-sibling::div[5]/div/div/div #点击VPN Account 加号按钮
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[5]/div[2]/div[2]/div/div/div/div/button #点击VPN Account 加号按钮
... 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[5]/div[3]/div/div[2]/div/div[2]/div/div/div/from/div[2]/div/div/div/input ${VPNAccountName} #输入vpn的name
... 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[5]/div[3]/div/div[2]/div/div[2]/div/div/div/from/div[3]/div/div/input ${VPNAccountPassword} #输入vpn的password
... 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[5]/div[3]/div/div[3]/button #点击OK
... 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[5]/div[2]/div[2]/div[3]/div/button #点击close
... 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[5]/div[2]/div[2]/div/div/div/input ${VPNAccountName} #输入vpn的name
... 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[5]/div[2]/div[2]/div/div/div/input ENTER
... 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[5]/div[2]/div[2]/div/div/div[3]/div/div/ul/li
... 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[5]/div[2]/div[2]/div[3]/div/button #点击close
... 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
@@ -185,9 +250,9 @@ Create-Source-Button
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[2]/div[1]/div/div #点击添加源ip
... 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 ${SourceInfo}
... AND CreateEditDeleteSources ${DestinationInfo}
... ELSE log there is no DestinationInfo
@@ -463,7 +528,7 @@ SourceIPGroupAdd
SourceCreate-name
[Arguments] ${PolicyType} ${ObjName}
sleep ${sleep}
input text ${PolicyType}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[1]/div/div[1]/input ${ObjName}
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}
@@ -488,14 +553,14 @@ WANNAT-IPPools
sleep ${sleep}
click element id=WANNAT_ipPool #点击ipPool 的加号按钮
run keyword if "${CreateOrSearch}"=="Create" run keywords sleep ${sleep}
... AND click element di=WANNAT_proaddadd
... 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 ${sleep}
... 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}
@@ -521,10 +586,10 @@ SearchIPPoolsFor
END
ChangeSourceIP
[Arguments] ${TranslatedPacketDict} # ${ChangeSourceIP} ${ByTimeValue} ${ByConnectionsValue}
[Arguments] ${TranslatedPacketDict}
${return} ${ChangeSourceIP} Run Keyword And Ignore Error Get From Dictionary ${TranslatedPacketDict} ChangeSourceIP
${ChangeSourceIP} Run Keyword If "${return}"=="FAIL" or "${IPPoolsValue}"=="${EMPTY}" set variable null
${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
@@ -536,15 +601,15 @@ ChangeSourceIP
... ELSE set variable ${ByConnectionsValue}
run keyword if "${ChangeSourceIP}"=="Never" run keywords sleep ${sleep}
... AND click element di=WANNAT_snat_algorithm_Never
... AND click element id=WANNAT_snat_algorithm_Never
... AND sleep ${sleep}
run keyword if "${ChangeSourceIP}"=="By Time" run keywords sleep ${sleep}
... AND click element di=WANNAT_snat_algorithm_By Time
... 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 di=WANNAT_snat_algorithm_By Connections
... AND click element id=WANNAT_snat_algorithm_By Connections
... AND sleep ${sleep}
... AND input text id=WANNATADD_Time_count1 ${ByConnectionsValue}
... AND sleep ${sleep}
@@ -565,7 +630,7 @@ TranslatePort
${TranslatePort} Run Keyword If "${return}"=="FAIL" or "${TranslatePort}"=="${EMPTY}" set variable null
... ELSE set variable ${TranslatePort}
input text id=WANNATADD_connectionTimeout1 ${TranslatePort}
input text id=WANNATADD_dnat_destination_port1 ${TranslatePort}
Failover
[Arguments] ${TranslatedPacketDict} # ${ChangeSourceIP} ${ByTimeValue} ${ByConnectionsValue}
@@ -576,16 +641,19 @@ Failover
run keyword if "${Failover}"=="Drop Packet" run keywords sleep ${sleep}
... AND click element di=WANNAT_failoverlist_Drop Packet
... 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 di=WANNAT_failoverlist_Forward to original destination
... AND click element id=WANNAT_failoverlist_Forward to original destination
WANNAT-Enabled
[Arguments] ${Enabled}
run keyword if "${Enabled}"=="open" run keywords sleep ${sleep}
... AND click element di=addlabel_isValid
... ELSE log 不开启
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
@@ -596,7 +664,8 @@ WANNAT-OK
WANNAT-Assertion
[Arguments] ${name} ${search}=Name
Proxy-TCP-Options-Search ${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} #断言
@@ -631,13 +700,13 @@ Delete-Proxy-estimate
... ELSE log go on
Delete-Proxy
[Arguments] ${securityname}
[Arguments] ${name}
Menu settings Advanced
Menu policys WAN NAT
sleep ${sleep}
Proxy-TCP-Options-Search ${securityname} Name
WANNAT-Search ${name} Name
sleep ${sleep}
Run Keyword And Ignore Error click element id=proxyTCPDel
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}
@@ -657,21 +726,40 @@ Delete-object
Forname
[Arguments] ${objectname} ${key}
FOR ${i} IN @{objectname}
Menu objects ${key}
sleep ${sleep}
click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[1]/span/div/div/div[2]/div/div/div/input #点击输入框
sleep ${sleep}
click element xpath=/html/body/div/div[1]/div[1]/ul/li[3] #点击name为搜索类型
sleep ${sleep}
input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[1]/span/div/div/div[2]/div/div[1]/div[3]/div/input ${i} #输入搜索内容
sleep ${sleep}
click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[1]/span/div/i #点击搜索按钮
sleep ${sleep}
Run Keyword And Ignore Error click element xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span #选择搜索到的列表
sleep ${sleep}
sleep ${sleep}
Run Keyword And Ignore Error click element id=objectDel #点击删除按钮
sleep ${sleep}
Run Keyword And Ignore Error click element xpath=/html/body/div/div/div[3]/button[2]
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