提交wannat新增、查询关键字

This commit is contained in:
lyf
2021-03-11 10:14:13 +08:00
parent a1ad76fb96
commit 63dd1d9e80

View File

@@ -6,83 +6,30 @@ Resource ../objects/NewObject.robot
*** Keywords ***
UIAddWANNAT
[Arguments] ${TCPProxy} ${TCPClientDict} ${TCPServerDict} ${SourceInfo}=null ${DestinationInfo}=null ${FilterInfo}=null
${return} ${Tcpname} Run Keyword And Ignore Error Get From Dictionary ${TCPProxy} Tcpname
${Tcpname} Run Keyword If "${return}"=="FAIL" or "${Tcpname}"=="${EMPTY}" set variable null
... ELSE set variable ${Tcpname}
[Arguments] ${AddWANNATDict} ${VPNAccountDict}=null ${SourceInfo}=null ${DestinationInfo}=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} ${EnableTCPPassthrough} Run Keyword And Ignore Error Get From Dictionary ${TCPProxy} EnableTCPPassthrough
${EnableTCPPassthrough} Run Keyword If "${return}"=="FAIL" or "${EnableTCPPassthrough}}"=="${EMPTY}" set variable null
... ELSE set variable ${EnableTCPPassthrough}
${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} ${BypassDuplicatedPacket} Run Keyword And Ignore Error Get From Dictionary ${TCPProxy} BypassDuplicatedPacket
${BypassDuplicatedPacket} Run Keyword If "${return}"=="FAIL" or "${BypassDuplicatedPacket}}"=="${EMPTY}" set variable null
... ELSE set variable ${BypassDuplicatedPacket}
${return} ${WannatAccessMode} Run Keyword And Ignore Error Get From Dictionary ${AddWANNATDict} WannatAccessMode
${WannatAccessMode} Run Keyword If "${return}"=="FAIL" or "${WannatAccessMode}"=="${EMPTY}" set variable null
Comment 打开菜单新建策略输入name
Create-Proxy-TCP-Options ${Tcpname}
#Create-Source-Button
Run Keyword If "${SourceInfo}"=="${EMPTY}" or "${SourceInfo}"=="null" log there is no SourceInfoDict
... ELSE Create-Source-Button
Run Keyword If "${SourceInfo}"=="${EMPTY}" or "${SourceInfo}"=="null" log there is no SourceInfoDict
... ELSE CreateEditDeleteSources ${SourceInfo}
Run Keyword If "${DestinationInfo}"=="${EMPTY}" or "${DestinationInfo}"=="null" log there is no DestinationInfo
... ELSE Create-Destination-Button
Run Keyword If "${DestinationInfo}"=="${EMPTY}" or "${DestinationInfo}"=="null" log there is no DestinationInfo
... ELSE CreateEditDeleteDestination ${DestinationInfo}
Run Keyword If "${FilterInfo}"=="${EMPTY}" log there is no FilterInfo
... ELSE Filter-create ${FilterInfo}
Run Keyword If "${EnableTCPPassthrough}"=="${EMPTY}" or "${EnableTCPPassthrough}"=="null" log there is no EnableTCPPassthrough
... ELSE TCP-Enable-TCP-Passthrough ${EnableTCPPassthrough}
Run Keyword If "${BypassDuplicatedPacket}"=="${EMPTY}" or "${BypassDuplicatedPacket}"=="null" log there is no BypassDuplicatedPacket
... ELSE TCP-Bypass-Duplicated-Packet ${BypassDuplicatedPacket}
TCP-Client-side-Parameters ${TCPClientDict}
TCP-Server-side-Parameters ${TCPServerDict}
TCP-OK
TCP-Assertion ${Tcpname}
UIUpdateWANNAT
[Arguments] ${TCPProxy} ${TCPClientDict} ${TCPServerDict} ${SourceInfo}=null ${DestinationInfo}=null ${FilterInfo}=null
${return} ${Tcpname} Run Keyword And Ignore Error Get From Dictionary ${TCPProxy} Tcpname
${Tcpname} Run Keyword If "${return}"=="FAIL" or "${Tcpname}"=="${EMPTY}" set variable null
... ELSE set variable ${Tcpname}
${return} ${Edittcpname} Run Keyword And Ignore Error Get From Dictionary ${TCPProxy} Edittcpname
${Edittcpname} Run Keyword If "${return}"=="FAIL" or "${Edittcpname}"=="${EMPTY}" set variable ${Tcpname}
... ELSE set variable ${Edittcpname}
${return} ${EnableTCPPassthrough} Run Keyword And Ignore Error Get From Dictionary ${TCPProxy} EnableTCPPassthrough
${EnableTCPPassthrough} Run Keyword If "${return}"=="FAIL" or "${EnableTCPPassthrough}}"=="${EMPTY}" set variable null
... ELSE set variable ${EnableTCPPassthrough}
${return} ${BypassDuplicatedPacket} Run Keyword And Ignore Error Get From Dictionary ${TCPProxy} BypassDuplicatedPacket
${BypassDuplicatedPacket} Run Keyword If "${return}"=="FAIL" or "${BypassDuplicatedPacket}}"=="${EMPTY}" set variable null
... ELSE set variable ${BypassDuplicatedPacket}
Edit-Proxy-TCP-Options ${Tcpname}
Run Keyword If "${Edittcpname}"=="${EMPTY}" or "${Edittcpname}"=="null" log there is no Edittcpname
... ELSE Edit-Proxy-TCP-Name ${Edittcpname}
Run Keyword If "${SourceInfo}"=="${EMPTY}" or "${SourceInfo}"=="null" log there is no SourceInfoDict
... ELSE Create-Source-Button
Run Keyword If "${SourceInfo}"=="${EMPTY}" or "${SourceInfo}"=="null" log there is no SourceInfoDict
... ELSE CreateEditDeleteSources ${SourceInfo}
Run Keyword If "${DestinationInfo}"=="${EMPTY}" or "${DestinationInfo}"=="null" log there is no DestinationInfo
... ELSE Create-Destination-Button
Run Keyword If "${DestinationInfo}"=="${EMPTY}" or "${DestinationInfo}"=="null" log there is no DestinationInfo
... ELSE CreateEditDeleteDestination ${DestinationInfo}
Run Keyword If "${FilterInfo}"=="${EMPTY}" log there is no FilterInfo
... ELSE Filter-create ${FilterInfo}
Run Keyword If "${EnableTCPPassthrough}"=="${EMPTY}" or "${EnableTCPPassthrough}"=="null" log there is no EnableTCPPassthrough
... ELSE TCP-Enable-TCP-Passthrough ${EnableTCPPassthrough}
Run Keyword If "${BypassDuplicatedPacket}"=="${EMPTY}" or "${BypassDuplicatedPacket}"=="null" log there is no BypassDuplicatedPacket
... ELSE TCP-Bypass-Duplicated-Packet ${BypassDuplicatedPacket}
TCP-Client-side-Parameters ${TCPClientDict}
TCP-Server-side-Parameters ${TCPServerDict}
TCP-OK
TCP-Assertion ${Edittcpname}
${return} ${PrivateNetworkAddress} Run Keyword And Ignore Error Get From Dictionary ${AddWANNATDict} PrivateNetworkAddress
${PrivateNetworkAddress} Run Keyword If "${return}"=="FAIL" or "${PrivateNetworkAddress}"=="${EMPTY}" set variable null
Create-WANNAT ${Wannatname}
Wannat-Action ${WannatAction}
Wannat-AccessMode ${WannatAccessMode}
Wannat-OriginalPacket ${WannatAction} ${WannatAccessMode} ${TranslatedPacketDict} ${VPNAccountDict} ${SourceInfo} ${DestinationInfo} ${PrivateNetworkAddress}
WANNAT-Enabled ${Enabled}
WANNAT-OK
Create-WANNAT
[Arguments] ${Wannatname}
sleep ${sleep}
@@ -122,21 +69,34 @@ Wannat-AccessMode
... ELSE log 不操作
Wannat-OriginalPacket
[Arguments] ${WannatAction} ${WannatAccessMode} ${VPNAccountDict} ${SourceInfo} ${DestinationInfo}
[Arguments] ${WannatAction} ${WannatAccessMode} ${TranslatedPacketDict} ${VPNAccountDict} ${SourceInfo} ${DestinationInfo} ${PrivateNetworkAddress}
Run Keyword If "${WannatAction}"=="SNAT" and "${WannatAccessMode}"=="VPN" run keywords sleep ${sleep}
... AND Wannat-VPNAccount ${VPNAccountDict} #添加vpnaccount
... AND Wannat-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-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 sleep ${sleep}
... AND TranslatePort ${TranslatedPacketDict}
... AND Failover ${TranslatedPacketDict}
Wannat-VPNAccount
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
@@ -151,7 +111,7 @@ Wannat-VPNAccount
... ELSE set variable ${VPNAccountPassword}
click element id=wannat_vpn #点击VPN Account 加号按钮
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 加号按钮
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 加号按钮
@@ -165,15 +125,53 @@ Wannat-VPNAccount
... 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 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[2]/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[2]/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[2]/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
... ELSE log 不操作
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[5]/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 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 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 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 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 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 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 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 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
... ELSE log 不操作
Create-Source-Button
[Arguments] ${SourceInfo}
Run Keyword If "${SourceInfo}"!="${EMPTY}" or "${SourceInfo}"!="null" run keywords sleep ${sleep}
@@ -473,19 +471,36 @@ SourceCreate-ok
click button xpath=${PolicyType}/div[2]/div[2]/div/div[2]/button[1]
WANNAT-IPPools
[Arguments] ${CreateOrSearch} ${CreateOrSearch} ${IPPoolsValue}
[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 di=WANNAT_proaddadd
... AND sleep ${sleep}
... AND input text xpath=//*[@id="wannat_vpn_color"]/form/div[1]/div/div[1]/div[1]/input ${CreateOrSearch} #输入name
... 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 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}
@@ -494,264 +509,92 @@ IPPoolsFor
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
Filter-create
[Arguments] ${FilterInfo}
${return} ${Filtercreate} Run Keyword And Ignore Error Get From Dictionary ${FilterInfo} Filtercreate
${Filtercreate} Run Keyword If "${return}"=="FAIL" or "${Filtercreate}"=="${EMPTY}" set variable null
... ELSE set variable ${Filtercreate}
${return} ${SNIname} Run Keyword And Ignore Error Get From Dictionary ${FilterInfo} SNIname
${SNIname} Run Keyword If "${return}"=="FAIL" or "${SNIname}"=="${EMPTY}" set variable null
... ELSE set variable ${SNIname}
FOR ${i} IN @{Filtercreate}
SearchIPPoolsFor
[Arguments] ${IPPoolsName}
FOR ${i} IN @{IPPoolsName}
input text id=objectName_seach_IPPool ${i}
sleep ${sleep}
click element id=interceptionadd_add_filter
press keys id=objectName_seach_IPPool ENTER
sleep ${sleep}
run keyword if "${i}"=="SNI" run keywords sleep ${sleep}
... AND click element id=interceptionadd_checkappshow0
... AND Create-Object-Search ${SNIname} ${i}
... AND sleep ${sleep}
${class}= Get Element Attribute xpath=//*[@id="policy_paper_left"]/div[2]/form/div[5]/div[1]/div[1]/label[contains(text(), "${i}")]/following-sibling::div/div class
run keyword if "${class}"=="addobject addobject-long-list float-left" log 不操作
run keyword if "${class}"=="addobject addobject-long-list float-left obj-content-null" run keywords sleep ${sleep}
... AND click element xpath=//*[@id="policy_paper_left"]/div[2]/form/div[5]/div[1]/div[1]/label[contains(text(), "${i}")]/following-sibling::div/div[2]/i
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
Create-Object-Search
[Arguments] ${name} ${filter}
[Documentation] 调用次关键字前需要添加必填参数:
... ${name}:填入是一个列表列表内容为object的name
... 选择search对象
sleep ${sleep}
click element xpath=//*[@id="policy_paper_left"]/div[2]/form/div[5]/div[1]/div[1]/label[contains(text(), "${filter}")]/following-sibling::div/div
sleep ${sleep}
FOR ${i} IN @{name}
input text xpath=//*[@id="condistions_protocol"]/div[2]/p[contains(text(), "${filter}")]/following-sibling::div[2]/div/div[1]/input ${i}
sleep ${sleep}
press keys xpath=//*[@id="condistions_protocol"]/div[2]/p[contains(text(), "${filter}")]/following-sibling::div[2]/div/div[1]/input ENTER
sleep ${sleep}
click element xpath=//*[@id="condistions_protocol"]/div[2]/p[contains(text(), "${filter}")]/following-sibling::div[2]/div/div[2]/div/div/ul/li[1]
sleep ${sleep}
END
TCP-Enable-TCP-Passthrough
[Arguments] ${Enable-TCP-Passthrough}
#判断是否开启Enable TCP Passthrough按钮${Enable-TCP-Passthrough}=open,为开启,否则不添开启
run keyword if "${Enable-TCP-Passthrough}"=="open" run keywords sleep ${sleep}
... AND click element xpath=//*[@id="proxytcpThrough"]/label[contains(text(), "Enable TCP Passthrough")]/following-sibling::div/div #点击Enable-TCP-Passthrough按钮开启
... AND sleep ${sleep}
... ELSE log 不开启
TCP-Bypass-Duplicated-Packet
[Arguments] ${Bypass-Duplicated-Packet}
#判断是否开启Bypass Duplicated Packet按钮${Bypass-Duplicated-Packet}=open,为开启,否则不添开启
run keyword if "${Bypass-Duplicated-Packet}"=="open" run keywords sleep ${sleep}
... AND click element xpath=//*[@id="proxyduplicatedPacket"]/label[contains(text(), "Bypass Duplicated Packet")]/following-sibling::div/div #点击Bypass-Duplicated-Packet按钮开启
... AND sleep ${sleep}
... ELSE log 不开启
TCP-Client-side-Parameters
[Arguments] ${TCPClientDict}
${Clientelement} set variable /html/body/div[1]/div/div[3]/div[2]/div/div/div[1]/div[1]/div/div[2]/form/div[9]/div[2]/div[1]
ChangeSourceIP
[Arguments] ${TranslatedPacketDict} # ${ChangeSourceIP} ${ByTimeValue} ${ByConnectionsValue}
${return} ${ClientOverrideMSS} Run Keyword And Ignore Error Get From Dictionary ${TCPClientDict} ClientOverrideMSS
${ClientOverrideMSS} Run Keyword If "${return}"=="FAIL" or "${ClientOverrideMSS}"=="${EMPTY}" set variable null
... ELSE set variable ${ClientOverrideMSS}
${return} ${ChangeSourceIP} Run Keyword And Ignore Error Get From Dictionary ${TranslatedPacketDict} ChangeSourceIP
${ChangeSourceIP} Run Keyword If "${return}"=="FAIL" or "${IPPoolsValue}"=="${EMPTY}" set variable null
... ELSE set variable ${ChangeSourceIP}
${return} ${ClientMSSvalue} Run Keyword And Ignore Error Get From Dictionary ${TCPClientDict} ClientMSSvalue
${ClientMSSvalue} Run Keyword If "${return}"=="FAIL" or "${ClientMSSvalue}"=="${EMPTY}" set variable null
... ELSE set variable ${ClientMSSvalue}
${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} ${ClientNoDelay} Run Keyword And Ignore Error Get From Dictionary ${TCPClientDict} ClientNoDelay
${ClientNoDelay} Run Keyword If "${return}"=="FAIL" or "${ClientNoDelay}"=="${EMPTY}" set variable null
... ELSE set variable ${ClientNoDelay}
${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}
${return} ${Clientttlvalue} Run Keyword And Ignore Error Get From Dictionary ${TCPClientDict} Clientttlvalue
${Clientttlvalue} Run Keyword If "${return}"=="FAIL" or "${Clientttlvalue}"=="${EMPTY}" set variable null
... ELSE set variable ${Clientttlvalue}
${return} ${ClientKeepalive} Run Keyword And Ignore Error Get From Dictionary ${TCPClientDict} ClientKeepalive
${ClientKeepalive} Run Keyword If "${return}"=="FAIL" or "${ClientKeepalive}"=="${EMPTY}" set variable null
... ELSE set variable ${ClientKeepalive}
${return} ${ClientProbeNumber} Run Keyword And Ignore Error Get From Dictionary ${TCPClientDict} ClientProbeNumber
${ClientProbeNumber} Run Keyword If "${return}"=="FAIL" or "${ClientProbeNumber}"=="${EMPTY}" set variable null
... ELSE set variable ${ClientProbeNumber}
${return} ${ClientIdleTime} Run Keyword And Ignore Error Get From Dictionary ${TCPClientDict} ClientIdleTime
${ClientIdleTime} Run Keyword If "${return}"=="FAIL" or "${ClientIdleTime}"=="${EMPTY}" set variable null
... ELSE set variable ${ClientIdleTime}
${return} ${ClientInterval} Run Keyword And Ignore Error Get From Dictionary ${TCPClientDict} ClientInterval
${ClientInterval} Run Keyword If "${return}"=="FAIL" or "${ClientInterval}"=="${EMPTY}" set variable null
... ELSE set variable ${ClientInterval}
${return} ${ClientUserTimeout} Run Keyword And Ignore Error Get From Dictionary ${TCPClientDict} ClientUserTimeout
${ClientUserTimeout} Run Keyword If "${return}"=="FAIL" or "${ClientUserTimeout}"=="${EMPTY}" set variable null
... ELSE set variable ${ClientUserTimeout}
run keyword if "${ChangeSourceIP}"=="Never" run keywords sleep ${sleep}
... AND click element di=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 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 sleep ${sleep}
... AND input text id=WANNATADD_Time_count1 ${ByConnectionsValue}
... AND sleep ${sleep}
Connection Timeout
[Arguments] ${TranslatedPacketDict}
sleep ${sleep}
click element id=tab-first #点击Client-side Parameters
sleep ${sleep}
${class}= Get Element Attribute xpath=${Clientelement}/div/form/div/label[contains(text(), "Override MSS")]/following-sibling::div/div class
#判断是否开启Override MSS按钮${Override-MSS}=open,为开启,否则不添开启
run keyword if "${class}"=="el-switch" and "${ClientOverrideMSS}"=="open" run keywords sleep ${sleep}
... AND click element xpath=${Clientelement}/div/form/div/label[contains(text(), "Override MSS")]/following-sibling::div/div #点击Override-MSS按钮开启
... AND sleep ${sleep}
... AND input text xpath=${Clientelement}/div/form/div[2]/div/div/input ${ClientMSSvalue} #输入MSS内容
... AND sleep ${sleep}
... ELSE log 不开启
run keyword if "${class}"=="el-switch is-checked" and "${ClientOverrideMSS}"=="open" run keywords sleep ${sleep}
... AND input text xpath=${Clientelement}/div/form/div[2]/div/div/input ${ClientMSSvalue} #输入MSS内容
... AND sleep ${sleep}
... ELSE log 不操作
run keyword if "${class}"=="el-switch is-checked" and "${ClientOverrideMSS}"!="open" run keywords sleep ${sleep}
... AND click element xpath=${Clientelement}/div/form/div/label[contains(text(), "Override MSS")]/following-sibling::div/div #点击Override-MSS按钮关闭
... AND sleep ${sleep}
... ELSE log 不操作
#判断是否开启No Delay按钮${No-Delay}=open,为开启,否则不添开启
${class1}= Get Element Attribute xpath=${Clientelement}/div/form/div/label[contains(text(), "No Delay")]/following-sibling::div/div class
run keyword if "${class1}"=="el-switch" and "${ClientNoDelay}"=="open" run keywords sleep ${sleep}
... AND click element xpath=${Clientelement}/div/form/div/label[contains(text(), "No Delay")]/following-sibling::div/div #点击No-Delay按钮开启
... AND sleep ${sleep}
... ELSE log 不开启
run keyword if "${class1}"=="el-switch is-checked" and "${ClientNoDelay}"!="open" run keywords sleep ${sleep}
... AND click element xpath=${Clientelement}/div/form/div/label[contains(text(), "No Delay")]/following-sibling::div/div #点击No-Delay按钮关闭
... AND sleep ${sleep}
... ELSE log 不操作
input text xpath=${Clientelement}/div/form/div/label[contains(text(), "TTL")]/following-sibling::div/div/input ${Clientttlvalue} #输入ttl内容
sleep ${sleep}
#判断是否开启Keepalive按钮${Keepalive}=open,为开启,否则不添开启
${class2}= Get Element Attribute xpath=${Clientelement}/div/form/div/label[contains(text(), "Keepalive")]/following-sibling::div/div class
run keyword if "${class2}"=="el-switch" and "${ClientKeepalive}"=="open" run keywords sleep ${sleep}
... AND click element xpath=${Clientelement}/div/form/div/label[contains(text(), "Keepalive")]/following-sibling::div/div #点击Keepalive按钮开启
... AND sleep ${sleep}
... AND input text xpath=${Clientelement}/div/form/div/div/form/div[1]/label[contains(text(), "Probe Number")]/following-sibling::div/div/input ${ClientProbeNumber} #输入Probe Number内容
... AND sleep ${sleep}
... AND input text xpath=${Clientelement}/div/form/div/div/form/div[2]/label[contains(text(), "Idle Time")]/following-sibling::div/div/input ${ClientIdleTime} #输入Idle Time内容
... AND sleep ${sleep}
... AND input text xpath=${Clientelement}/div/form/div/div/form/div[3]/label[contains(text(), "Interval")]/following-sibling::div/div/input ${ClientInterval} #输入Interval内容
... AND sleep ${sleep}
... ELSE log 不开启
run keyword if "${class2}"=="el-switch is-checked" and "${ClientKeepalive}"=="open" run keywords sleep ${sleep}
... AND input text xpath=${Clientelement}/div/form/div/div/form/div[1]/label[contains(text(), "Probe Number")]/following-sibling::div/div/input ${ClientProbeNumber} #输入Probe Number内容
... AND sleep ${sleep}
... AND input text xpath=${Clientelement}/div/form/div/div/form/div[2]/label[contains(text(), "Idle Time")]/following-sibling::div/div/input ${ClientIdleTime} #输入Idle Time内容
... AND sleep ${sleep}
... AND input text xpath=${Clientelement}/div/form/div/div/form/div[3]/label[contains(text(), "Interval")]/following-sibling::div/div/input ${ClientInterval} #输入Interval内容
... AND sleep ${sleep}
... ELSE log 不开启
run keyword if "${class2}"=="el-switch is-checked" and "${ClientKeepalive}"!="open" run keywords sleep ${sleep}
... AND click element xpath=${Clientelement}/div/form/div/label[contains(text(), "Keepalive")]/following-sibling::div/div #点击Keepalive按钮关闭
... AND sleep ${sleep}
... ELSE log 不开启
input text xpath=${Clientelement}/div/form/div/label[contains(text(), "User Timeout")]/following-sibling::div/div/input ${ClientUserTimeout} #输入User Timeout内容
sleep ${sleep}
TCP-Server-side-Parameters
[Arguments] ${TCPServerDict}
${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}
${Serverelement} set variable /html/body/div[1]/div/div[3]/div[2]/div/div/div[1]/div[1]/div/div[2]/form/div[9]/div[2]/div[2]
input text id=WANNATADD_connectionTimeout1 ${ConnectionTimeout}
TranslatePort
[Arguments] ${TranslatedPacketDict}
${return} ${ServerOverrideMSS} Run Keyword And Ignore Error Get From Dictionary ${TCPServerDict} ServerOverrideMSS
${ServerOverrideMSS} Run Keyword If "${return}"=="FAIL" or "${ServerOverrideMSS}"=="${EMPTY}" set variable null
... ELSE set variable ${ServerOverrideMSS}
${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_connectionTimeout1 ${TranslatePort}
Failover
[Arguments] ${TranslatedPacketDict} # ${ChangeSourceIP} ${ByTimeValue} ${ByConnectionsValue}
${return} ${ServerMSSvalue} Run Keyword And Ignore Error Get From Dictionary ${TCPServerDict} ServerMSSvalue
${ServerMSSvalue} Run Keyword If "${return}"=="FAIL" or "${ServerMSSvalue}"=="${EMPTY}" set variable null
... ELSE set variable ${ServerMSSvalue}
${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}
${return} ${ServerNoDelay} Run Keyword And Ignore Error Get From Dictionary ${TCPServerDict} ServerNoDelay
${ServerNoDelay} Run Keyword If "${return}"=="FAIL" or "${ServerNoDelay}"=="${EMPTY}" set variable null
... ELSE set variable ${ServerNoDelay}
${return} ${Serverttlvalue} Run Keyword And Ignore Error Get From Dictionary ${TCPServerDict} Serverttlvalue
${Serverttlvalue} Run Keyword If "${return}"=="FAIL" or "${Serverttlvalue}"=="${EMPTY}" set variable null
... ELSE set variable ${Serverttlvalue}
${return} ${ServerKeepalive} Run Keyword And Ignore Error Get From Dictionary ${TCPServerDict} ServerKeepalive
${ServerKeepalive} Run Keyword If "${return}"=="FAIL" or "${ServerKeepalive}"=="${EMPTY}" set variable null
... ELSE set variable ${ServerKeepalive}
${return} ${ServerProbeNumber} Run Keyword And Ignore Error Get From Dictionary ${TCPServerDict} ServerProbeNumber
${ServerProbeNumber} Run Keyword If "${return}"=="FAIL" or "${ServerProbeNumber}"=="${EMPTY}" set variable null
... ELSE set variable ${ServerProbeNumber}
${return} ${ServerIdleTime} Run Keyword And Ignore Error Get From Dictionary ${TCPServerDict} ServerIdleTime
${ServerIdleTime} Run Keyword If "${return}"=="FAIL" or "${ServerIdleTime}"=="${EMPTY}" set variable null
... ELSE set variable ${ServerIdleTime}
${return} ${ServerInterval} Run Keyword And Ignore Error Get From Dictionary ${TCPServerDict} ServerInterval
${ServerInterval} Run Keyword If "${return}"=="FAIL" or "${ServerInterval}"=="${EMPTY}" set variable null
... ELSE set variable ${ServerInterval}
${return} ${ServerUserTimeout} Run Keyword And Ignore Error Get From Dictionary ${TCPServerDict} ServerUserTimeout
${ServerUserTimeout} Run Keyword If "${return}"=="FAIL" or "${ServerUserTimeout}"=="${EMPTY}" set variable null
... ELSE set variable ${ServerUserTimeout}
click element id=tab-second #点击Server-side Parameters
sleep ${sleep}
#判断是否开启Override MSS按钮${Override-MSS}=open,为开启,否则不添开启
${class}= Get Element Attribute xpath=${Serverelement}/div/form/div/label[contains(text(), "Override MSS")]/following-sibling::div/div class
#判断是否开启Override MSS按钮${Override-MSS}=open,为开启,否则不添开启
run keyword if "${class}"=="el-switch" and "${ServerOverrideMSS}"=="open" run keywords sleep ${sleep}
... AND click element xpath=${Serverelement}/div/form/div/label[contains(text(), "Override MSS")]/following-sibling::div/div #点击Override-MSS按钮开启
... AND sleep ${sleep}
... AND input text xpath=${Serverelement}/div/form/div[2]/div/div/input ${ServerMSSvalue} #输入MSS内容
run keyword if "${Failover}"=="Drop Packet" run keywords sleep ${sleep}
... AND click element di=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
WANNAT-Enabled
[Arguments] ${Enabled}
run keyword if "${Enabled}"=="open" run keywords sleep ${sleep}
... AND click element di=addlabel_isValid
... ELSE log 不开启
run keyword if "${class}"=="el-switch is-checked" and "${ServerOverrideMSS}"=="open" run keywords sleep ${sleep}
... AND input text xpath=${Serverelement}/div/form/div[2]/div/div/input ${ServerMSSvalue} #输入MSS内容
... AND sleep ${sleep}
... ELSE log 不操作
run keyword if "${class}"=="el-switch is-checked" and "${ServerOverrideMSS}"!="open" run keywords sleep ${sleep}
... AND click element xpath=${Serverelement}/div/form/div/label[contains(text(), "Override MSS")]/following-sibling::div/div #点击Override-MSS按钮关闭
... AND sleep ${sleep}
... ELSE log 不操作
#判断是否开启No Delay按钮${No-Delay}=open,为开启,否则不添开启
${class1}= Get Element Attribute xpath=${Serverelement}/div/form/div/label[contains(text(), "No Delay")]/following-sibling::div/div class
run keyword if "${class1}"=="el-switch" and "${ServerNoDelay}"=="open" run keywords sleep ${sleep}
... AND click element xpath=${Serverelement}/div/form/div/label[contains(text(), "No Delay")]/following-sibling::div/div #点击No-Delay按钮开启
... AND sleep ${sleep}
... ELSE log 不开启
run keyword if "${class1}"=="el-switch is-checked" and "${ServerNoDelay}"!="open" run keywords sleep ${sleep}
... AND click element xpath=${Serverelement}/div/form/div/label[contains(text(), "No Delay")]/following-sibling::div/div #点击No-Delay按钮关闭
... AND sleep ${sleep}
... ELSE log 不操作
input text xpath=${Serverelement}/div/form/div/label[contains(text(), "TTL")]/following-sibling::div/div/input ${Serverttlvalue} #输入ttl内容
sleep ${sleep}
#判断是否开启Keepalive按钮${Keepalive}=open,为开启,否则不添开启
${class2}= Get Element Attribute xpath=${Serverelement}/div/form/div/label[contains(text(), "Keepalive")]/following-sibling::div/div class
run keyword if "${class2}"=="el-switch" and "${ServerKeepalive}"=="open" run keywords sleep ${sleep}
... AND click element xpath=${Serverelement}/div/form/div/label[contains(text(), "Keepalive")]/following-sibling::div/div #点击Keepalive按钮开启
... AND sleep ${sleep}
... AND input text xpath=${Serverelement}/div/form/div/div/form/div[1]/label[contains(text(), "Probe Number")]/following-sibling::div/div/input ${ServerProbeNumber} #输入Probe Number内容
... AND sleep ${sleep}
... AND input text xpath=${Serverelement}/div/form/div/div/form/div[2]/label[contains(text(), "Idle Time")]/following-sibling::div/div/input ${ServerIdleTime} #输入Idle Time内容
... AND sleep ${sleep}
... AND input text xpath=${Serverelement}/div/form/div/div/form/div[3]/label[contains(text(), "Interval")]/following-sibling::div/div/input ${ServerInterval} #输入Interval内容
... AND sleep ${sleep}
... ELSE log 不开启
run keyword if "${class2}"=="el-switch is-checked" and "${ServerKeepalive}"=="open" run keywords sleep ${sleep}
... AND input text xpath=${Serverelement}/div/form/div/div/form/div[1]/label[contains(text(), "Probe Number")]/following-sibling::div/div/input ${ServerProbeNumber} #输入Probe Number内容
... AND sleep ${sleep}
... AND input text xpath=${Serverelement}/div/form/div/div/form/div[2]/label[contains(text(), "Idle Time")]/following-sibling::div/div/input ${ServerIdleTime} #输入Idle Time内容
... AND sleep ${sleep}
... AND input text xpath=${Serverelement}/div/form/div/div/form/div[3]/label[contains(text(), "Interval")]/following-sibling::div/div/input ${ServerInterval} #输入Interval内容
... AND sleep ${sleep}
... ELSE log 不开启
run keyword if "${class2}"=="el-switch is-checked" and "${ServerKeepalive}"!="open" run keywords sleep ${sleep}
... AND click element xpath=${Serverelement}/div/form/div/label[contains(text(), "Keepalive")]/following-sibling::div/div #点击Keepalive按钮关闭
... AND sleep ${sleep}
... ELSE log 不开启
sleep ${sleep}
input text xpath=${Serverelement}/div/form/div/label[contains(text(), "User Timeout")]/following-sibling::div/div/input ${ServerUserTimeout} #输入User Timeout内容
sleep ${sleep}
TCP-OK
sleep ${sleep}
click element id=proxyManipulationSuccess #点击OK
sleep ${sleep}
TCP-Assertion
WANNAT-OK
click element id=tagAddOk1 #点击ok
WANNAT-Assertion
[Arguments] ${name} ${search}=Name
Proxy-TCP-Options-Search ${name} ${search} #搜索刚新建的name
${text1} Get Text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/p #获取点击后页面文本信息
@@ -759,23 +602,23 @@ TCP-Assertion
Proxy-TCP-Options-Search
WANNAT-Search
[Arguments] ${value} ${search}
sleep ${sleep}
click element id=sidebarAdvanced
sleep ${sleep}
Wait Until Element Is Visible xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[3]/div[1]/div/div[1]/span/div/div/div[2]/div/div/div/input 20
click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[3]/div[1]/div/div[1]/span/div/div/div[2]/div/div/div/input #点击搜索框
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[3]/div[1]/div/div[1]/span/div/div/div[2]/div/div[1]/div[3]/div/input ${value}
... 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[3]/div[1]/div/div[1]/span/div/div/div[2]/div/div[1]/div[3]/div/input ${value}
... 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[3]/div[1]/div/div[1]/span/div/i #点击搜索按钮
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}