From 97f922b41ebcac6f2e800b138f6ec4933fc9611c Mon Sep 17 00:00:00 2001 From: lyf Date: Tue, 26 Jan 2021 18:36:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E5=AE=89=E5=85=A8=E7=AD=96?= =?UTF-8?q?=E7=95=A5=E5=85=B3=E9=94=AE=E5=AD=97=E5=92=8C=E9=83=A8=E5=88=86?= =?UTF-8?q?=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 01-TestCase/tsg_ui/ui_security/Security.robot | 246 +++++++++++++++- .../securityPolicy/SecurityPolicy.robot | 275 ++++++++++++++++-- 2 files changed, 493 insertions(+), 28 deletions(-) diff --git a/01-TestCase/tsg_ui/ui_security/Security.robot b/01-TestCase/tsg_ui/ui_security/Security.robot index 0c1977d..0279ed4 100644 --- a/01-TestCase/tsg_ui/ui_security/Security.robot +++ b/01-TestCase/tsg_ui/ui_security/Security.robot @@ -3,16 +3,254 @@ Force Tags tsg-ui objects tags Resource ../../../02-Keyword/tsg_ui/securityPolicy/SecurityPolicy.robot Library OperatingSystem Resource ../../../02-Keyword/tsg_ui/Menu.robot +Resource ../../../02-Keyword/tsg_ui/objects/NewObjectPages.robot +Resource ../../../02-Keyword/tsg_ui/objects/NewObject.robot +Resource ../../../03-Variable/bifangapivariable.txt *** Test Cases *** -case001 +SecurityPolicy-Deny-HTTP-MaxCombination-Drop + #新建对象fqdn + Comment 新建对象fqdn + CreatePage FQDN single zdhfqdn keywordtext=*www.baidu.com + #新建对象url + Comment 新建对象url + CreatePage URL single zdhurl keywordtext=*.com + #新建Request Header + Comment Request Header + #新建cookie + CreatePage HTTPSignature single zdhreqck reqrestype=req reqresheader=ck keywordtext=1234@#% + #新建ua + CreatePage HTTPSignature single zdhrequa reqrestype=req reqresheader=ua keywordtext=*скрипцияк + #新建Response Header + Comment Response Header + #新建set cookie + CreatePage HTTPSignature single zdhressck reqrestype=res reqresheader=sck keywordtext=1234@#% + #新建ct + CreatePage HTTPSignature single zdhresct reqrestype=res reqresheader=ct keywordtext=text* + #新建Request Content + Comment Request Content + #新建Request Content + CreatePage Key single zdhreqcontent keywordtext=*pppp + #新建策略 + Comment 新建策略 Menu policys Security Policy SecurityPolicy.CreateButton - SecurityPolicy.Create-name case001 + SecurityPolicy.Create-name SecurityPolicy-Deny-HTTP-MaxCombination SecurityPolicy.Create-action deny - #SecurityPolicy.Create-Source-Button - #SecurityPolicy.Create-Source type1=Ip CreateOrSearch=Create Add=Address name=zdhip001 ipclienttext1=192.168.100.1 post=1 + SecurityPolicy.Create-Source-Button + SecurityPolicy.Create-Source type1=Ip CreateOrSearch=Create Add=Address name=zdhip001 ipclienttext1=192.168.100.1 post=1 SecurityPolicy.Create-Destination-Button SecurityPolicy.Create-Destination type1=Ip CreateOrSearch=Create Add=Address name=zdhip001 ipclienttext1=192.168.100.1 post=1 + ${hostname} create list zdhfqdn + ${urlname} create list zdhurl + ${RequestHeadername} create list zdhreqck zdhrequa + ${ResponseHeadername} create list zdhressck zdhresct + ${RequestContentname} create list zdhreqcontent + ${filter} create list Host URL Request Header Response Header Request Content + Create-Application-Button + ApplicationSearch HTTP + Create-Filter-judge Application=HTTP Filter=${filter} Hostname=${hostname} URLname=${urlname} Request Headername=${RequestHeadername} + ... Response Headername=${ResponseHeadername} Request Contentname=${RequestContentname} + Deny-subaction action=deny subaction=Drop + LogSession 1 + Enabled open + Security-Policies-OK + +SecurityPolicy-Deny-HTTP-MaxCombination-RST + #新建对象fqdn + Comment 新建对象fqdn + CreatePage FQDN single zdhfqdn keywordtext=*www.baidu.com + #新建对象url + Comment 新建对象url + CreatePage URL single zdhurl keywordtext=*.com + #新建Request Header + Comment Request Header + #新建cookie + CreatePage HTTPSignature single zdhreqck reqrestype=req reqresheader=ck keywordtext=1234@#% + #新建ua + CreatePage HTTPSignature single zdhrequa reqrestype=req reqresheader=ua keywordtext=*скрипцияк + #新建Response Header + Comment Response Header + #新建set cookie + CreatePage HTTPSignature single zdhressck reqrestype=res reqresheader=sck keywordtext=1234@#% + #新建ct + CreatePage HTTPSignature single zdhresct reqrestype=res reqresheader=ct keywordtext=text* + #新建Request Content + Comment Request Content + #新建Request Content + CreatePage Key single zdhreqcontent keywordtext=*pppp + #Response Content + Comment Response Content + #新建Response Content + CreatePage Key single zdhrescontent keywordtext=*pppp + #新建策略 + Comment 新建策略 + Menu policys Security Policy + SecurityPolicy.CreateButton + SecurityPolicy.Create-name SecurityPolicy-Deny-HTTP-MaxCombination + SecurityPolicy.Create-action deny + SecurityPolicy.Create-Source-Button + SecurityPolicy.Create-Source type1=Ip CreateOrSearch=Create Add=Address name=zdhip001 ipclienttext1=192.168.100.1 post=1 + #SecurityPolicy.Create-Destination-Button + #SecurityPolicy.Create-Destination type1=Ip CreateOrSearch=Create Add=Address name=zdhip001 ipclienttext1=192.168.100.1 post=1 + ${hostname} create list zdhfqdn + ${urlname} create list zdhurl + ${RequestHeadername} create list zdhreqck zdhrequa + ${ResponseHeadername} create list zdhressck zdhresct + ${RequestContentname} create list zdhreqcontent + ${ResponseContentname} create list zdhrescontent + ${filter} create list Host URL Request Header Response Header Request Content + Create-Application-Button + ApplicationSearch HTTP + Create-Filter-judge Application=HTTP Filter=${filter} Hostname=${hostname} URLname=${urlname} Request Headername=${RequestHeadername} + ... Response Headername=${ResponseHeadername} Request Contentname=${RequestContentname} Response Contentname=${ResponseContentname} + Deny-subaction action=deny subaction=RST + LogSession 1 + Enabled open + Security-Policies-OK + +SecurityPolicy-Deny-HTTP-Host-Block403TEXT + #新建对象fqdn + Comment 新建对象fqdn + CreatePage FQDN single zdhfqdn keywordtext=*www.baidu.com + #新建策略 + Comment 新建策略 + Menu policys Security Policy + SecurityPolicy.CreateButton + SecurityPolicy.Create-name SecurityPolicy-Deny-HTTP-MaxCombination + SecurityPolicy.Create-action deny + SecurityPolicy.Create-Source-Button + SecurityPolicy.Create-Source type1=Ip CreateOrSearch=Create Add=Address name=zdhip001 ipclienttext1=192.168.100.1 post=1 + #SecurityPolicy.Create-Destination-Button + #SecurityPolicy.Create-Destination type1=Ip CreateOrSearch=Create Add=Address name=zdhip001 ipclienttext1=192.168.100.1 post=1 + ${hostname} create list zdhfqdn + ${filter} create list Host + Create-Application-Button + ApplicationSearch HTTP + Create-Filter-judge Application=HTTP Filter=${filter} Hostname=${hostname} + Deny-subaction action=deny subaction=Block code=403 Content=TEXT block-text=123456 + LogSession 1 + Enabled open + Security-Policies-OK + +SecurityPolicy-Deny-HTTP-Host-Block403ProfileCreate + #新建对象fqdn + Comment 新建对象fqdn + CreatePage FQDN single zdhfqdn keywordtext=*www.baidu.com + #新建策略 + Comment 新建策略 + Menu policys Security Policy + SecurityPolicy.CreateButton + SecurityPolicy.Create-name SecurityPolicy-Deny-HTTP-MaxCombination + SecurityPolicy.Create-action deny + SecurityPolicy.Create-Source-Button + SecurityPolicy.Create-Source type1=Ip CreateOrSearch=Create Add=Address name=zdhip001 ipclienttext1=192.168.100.1 post=1 + #SecurityPolicy.Create-Destination-Button + #SecurityPolicy.Create-Destination type1=Ip CreateOrSearch=Create Add=Address name=zdhip001 ipclienttext1=192.168.100.1 post=1 + ${hostname} create list zdhfqdn + ${filter} create list Host + Create-Application-Button + ApplicationSearch HTTP + Create-Filter-judge Application=HTTP Filter=${filter} Hostname=${hostname} + Deny-subaction action=deny subaction=Block code=403 SearchorCreate=Create ProfileName=zdhprofilehtml file=${path}response_pages_files\\Create-ResponsePages-test.html + LogSession 1 + Enabled open + Security-Policies-OK + +SecurityPolicy-Deny-HTTP-Host-Block403ProfileSearch + #新建对象fqdn + Comment 新建对象fqdn + CreatePage FQDN single zdhfqdn keywordtext=*www.baidu.com + #新建策略 + Comment 新建策略 + Menu policys Security Policy + SecurityPolicy.CreateButton + SecurityPolicy.Create-name SecurityPolicy-Deny-HTTP-MaxCombination + SecurityPolicy.Create-action deny + SecurityPolicy.Create-Source-Button + SecurityPolicy.Create-Source type1=Ip CreateOrSearch=Create Add=Address name=zdhip001 ipclienttext1=192.168.100.1 post=1 + #SecurityPolicy.Create-Destination-Button + #SecurityPolicy.Create-Destination type1=Ip CreateOrSearch=Create Add=Address name=zdhip001 ipclienttext1=192.168.100.1 post=1 + ${hostname} create list zdhfqdn + ${filter} create list Host + Create-Application-Button + ApplicationSearch HTTP + Create-Filter-judge Application=HTTP Filter=${filter} Hostname=${hostname} + Deny-subaction action=deny subaction=Block code=403 SearchorCreate=Search ProfileName=zdhprofilehtml + LogSession 1 + Enabled open + Security-Policies-OK + +SecurityPolicy-Deny-HTTP-Host-Block404TEXT + #新建对象fqdn + Comment 新建对象fqdn + CreatePage FQDN single zdhfqdn keywordtext=*www.baidu.com + #新建策略 + Comment 新建策略 + Menu policys Security Policy + SecurityPolicy.CreateButton + SecurityPolicy.Create-name SecurityPolicy-Deny-HTTP-MaxCombination + SecurityPolicy.Create-action deny + SecurityPolicy.Create-Source-Button + SecurityPolicy.Create-Source type1=Ip CreateOrSearch=Create Add=Address name=zdhip001 ipclienttext1=192.168.100.1 post=1 + #SecurityPolicy.Create-Destination-Button + #SecurityPolicy.Create-Destination type1=Ip CreateOrSearch=Create Add=Address name=zdhip001 ipclienttext1=192.168.100.1 post=1 + ${hostname} create list zdhfqdn + ${filter} create list Host + Create-Application-Button + ApplicationSearch HTTP + Create-Filter-judge Application=HTTP Filter=${filter} Hostname=${hostname} + Deny-subaction action=deny subaction=Block code=404 Content=TEXT block-text=123456 + LogSession 1 + Enabled open + Security-Policies-OK + +SecurityPolicy-Deny-HTTP-Host-Block404ProfileCreate + #新建对象fqdn + Comment 新建对象fqdn + CreatePage FQDN single zdhfqdn keywordtext=*www.baidu.com + #新建策略 + Comment 新建策略 + Menu policys Security Policy + SecurityPolicy.CreateButton + SecurityPolicy.Create-name SecurityPolicy-Deny-HTTP-MaxCombination + SecurityPolicy.Create-action deny + SecurityPolicy.Create-Source-Button + SecurityPolicy.Create-Source type1=Ip CreateOrSearch=Create Add=Address name=zdhip001 ipclienttext1=192.168.100.1 post=1 + #SecurityPolicy.Create-Destination-Button + #SecurityPolicy.Create-Destination type1=Ip CreateOrSearch=Create Add=Address name=zdhip001 ipclienttext1=192.168.100.1 post=1 + ${hostname} create list zdhfqdn + ${filter} create list Host + Create-Application-Button + ApplicationSearch HTTP + Create-Filter-judge Application=HTTP Filter=${filter} Hostname=${hostname} + Deny-subaction action=deny subaction=Block code=404 SearchorCreate=Create ProfileName=zdhprofilehtml file=${path}response_pages_files\\Create-ResponsePages-test.html + LogSession 1 + Enabled open + Security-Policies-OK + +SecurityPolicy-Deny-HTTP-Host-Block404ProfileSearch + #新建对象fqdn + Comment 新建对象fqdn + CreatePage FQDN single zdhfqdn keywordtext=*www.baidu.com + #新建策略 + Comment 新建策略 + Menu policys Security Policy + SecurityPolicy.CreateButton + SecurityPolicy.Create-name SecurityPolicy-Deny-HTTP-MaxCombination + SecurityPolicy.Create-action deny + SecurityPolicy.Create-Source-Button + SecurityPolicy.Create-Source type1=Ip CreateOrSearch=Create Add=Address name=zdhip001 ipclienttext1=192.168.100.1 post=1 + #SecurityPolicy.Create-Destination-Button + #SecurityPolicy.Create-Destination type1=Ip CreateOrSearch=Create Add=Address name=zdhip001 ipclienttext1=192.168.100.1 post=1 + ${hostname} create list zdhfqdn + ${filter} create list Host + Create-Application-Button + ApplicationSearch HTTP + Create-Filter-judge Application=HTTP Filter=${filter} Hostname=${hostname} + Deny-subaction action=deny subaction=Block code=404 SearchorCreate=Search ProfileName=zdhprofilehtml + LogSession 1 + Enabled open + Security-Policies-OK \ No newline at end of file diff --git a/02-Keyword/tsg_ui/securityPolicy/SecurityPolicy.robot b/02-Keyword/tsg_ui/securityPolicy/SecurityPolicy.robot index 17927a1..1bfe520 100644 --- a/02-Keyword/tsg_ui/securityPolicy/SecurityPolicy.robot +++ b/02-Keyword/tsg_ui/securityPolicy/SecurityPolicy.robot @@ -53,12 +53,12 @@ ApplicationSearch sleep 1 press keys xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[5]/div[2]/div[2]/div/div[1]/input ENTER sleep 1 - click element xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[5]/div[2]/div[2]/div/div[2]/div/div/ul/li[1] + click element xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[5]/div[2]/div[2]/div/div[3]/div/div/ul/li[1] sleep 1 Create-Filter-judge - [Arguments] ${Application} ${Filter} ${Hostname} ${URLname} ${Request Headername} ${Response Headername} ${Request Contentname} - ... ${Response Contentname} ${SSLSNIname} ${CNname} ${SANname} ${QNAMEname} ${Subjectname} ${MAILContentname} ${Attachment Namename} - ... ${Attachment Contentname} ${Fromname} ${Toname} ${MAILAccountname} ${URIname} ${FTPContentname} ${FTPAccountname} ${QUICSNIname} + [Arguments] ${Application}=null ${Filter}=null ${Hostname}=null ${URLname}=null ${Request Headername}=null ${Response Headername}=null ${Request Contentname}=null + ... ${Response Contentname}=null ${SSLSNIname}=null ${CNname}=null ${SANname}=null ${QNAMEname}=null ${Subjectname}=null ${MAILContentname}=null ${Attachment Namename}=null + ... ${Attachment Contentname}=null ${Fromname}=null ${Toname}=null ${MAILAccountname}=null ${URIname}=null ${FTPContentname}=null ${FTPAccountname}=null ${QUICSNIname}=null [Documentation] 调用次关键字前需要添加必填参数: ... ${Application}:填入是Application的内容,例如SSL或HTTP ... ${Filter}:是一个列表,列表中填入filter类型,例如Host或URL等 @@ -67,7 +67,7 @@ Create-Filter-judge ${class}= Get Element Attribute xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[8]/div[1]/div/div[1] class run keyword if "${class}"=="addobject addobject-long-list obj-content-null filter-width-style cursor addobject-long-list-disabled" log filter不可点击,不可添加filter run keyword if "${class}"=="addobject addobject-long-list obj-content-null filter-width-style cursor" run keywords sleep 1 - ... AND click element Create-Filter ${Application} ${Filter} ${Hostname} ${URLname} ${Request Headername} ${Response Headername} ${Request Contentname} + ... AND Create-Filter ${Application} ${Filter} ${Hostname} ${URLname} ${Request Headername} ${Response Headername} ${Request Contentname} ... ${Response Contentname} ${SSLSNIname} ${CNname} ${SANname} ${QNAMEname} ${Subjectname} ${MAILContentname} ${Attachment Namename} ... ${Attachment Contentname} ${Fromname} ${Toname} ${MAILAccountname} ${URIname} ${FTPContentname} ${FTPAccountname} ${QUICSNIname} @@ -150,7 +150,8 @@ Create-Filter ... AND Create-Object-Search ${QUICSNIname} ${i} END Deny-subaction - [Arguments] ${action} ${subaction} ${code} ${Content} ${block-text} ${SearchorCreate} ${ProfileName} ${file} ${QType} ${Avalue} ${Attl} ${CNAMEvalue} ${CNAMEttl} + [Arguments] ${action}=null ${subaction}=null ${code}=null ${Content}=null ${block-text}=null ${SearchorCreate}=null + ... ${ProfileName}=null ${file}=null ${QType}=null ${Avalue}=null ${Attl}=null ${CNAMEvalue}=null ${CNAMEttl}=null [Documentation] 调用次关键字前需要添加必填参数: ... ${code}:填入403或404 ... ${Content}:填入TEXT或Profile @@ -260,6 +261,232 @@ Deny-Redirect ... AND input text id=ttl01 ${CNAMEttl} sleep 1 click element id=interceptionadd_shezhidns +Intercept-SSL-Keyring-SearchorCreate + [Arguments] ${KeySearchorCreate} ${keyname} ${file}=null ${file1}=null ${ExpiryHours1or2}=null ${type}=null ${type1}=null + ... ${shift}=close ${PrivateKeyType}=PrivateKeyFile + [Documentation] 引用次关键字,填入必填参数 + ... 必填参数: + ... ${KeySearchorCreate}:填入Create或Search + ... ${name}:新建页面name输入框里的内容 + ... ${file}:上传文件所在本地的路径 + ... ${file1}:上传文件所在本地的路径 + ... ${ExpiryHours1or2}:根证书时间填入1:自定义定义 2:原时间 + ... ${type}:上传证书类型的元素 + ... ${type1}:上传证书加密解密算法的元素 + ... ${shift}:是否打开客户端包含证书按钮 + ... ${PrivateKeyType}:私钥类型 + sleep 1 + click element id=interceptionadd_eventkeying1 + sleep 1 + run keyword if "${KeySearchorCreate}"=="Create" run keywords sleep 1 + ... AND click element id=interceptionadd_keyadd + ... AND sleep 2 + ... AND Create-Keyring ${keyname} ${file} ${file1} ${ExpiryHours1or2} ${type} ${type1} + ... ${shift}=close ${PrivateKeyType}=PrivateKeyFile + run keyword if "${KeySearchorCreate}"=="Search" run keywords sleep 1 + ... AND input text id=card_keyringName1 ${keyname} + ... AND sleep 1 + ... AND press keys id=card_keyringName1 ENTER + ... AND sleep 1 + ... AND clcik element id=card_keylist0 + +Create-Keyring + [Arguments] ${name} ${file} ${file1} ${ExpiryHours1or2} ${type} ${type1} + ... ${shift}=close ${PrivateKeyType}=PrivateKeyFile + [Documentation] 引用次关键字,填入必填参数 + ... 必填参数: + ... ${name}:新建页面name输入框里的内容 + ... ${file}:上传文件所在本地的路径 + ... ${file1}:上传文件所在本地的路径 + ... ${ExpiryHours1or2}:根证书时间填入1:自定义定义 2:原时间 + ... ${type}:上传证书类型的元素 + ... ${type1}:上传证书加密解密算法的元素 + ... ${shift}:是否打开客户端包含证书按钮 + ... ${PrivateKeyType}:私钥类型 + Sleep 2 + input id=keyringsadd_name ${name} #输入name + Sleep 2 + Choose File xpath=//*[@id="app"]/div/div[3]/div[2]/div/div/div[2]/div[2]/form/div[2]/div/div/div/input ${file} #上传文件 + Sleep 2 + Choose File xpath=//*[@id="app"]/div/div[3]/div[2]/div/div/div[2]/div[2]/form/div[3]/div/div[2]/div/div/input ${file1} #上传文件 + ${select} Set Variable ${ExpiryHours1or2} + Run Keyword If '${select}'=='1' click element id=keyringsadd_customized + Run Keyword If '${select}'=='1' input text id=reissueExpiryDate 10 + sleep 1 + click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div/div[2]/div[2]/form/div[6]/div/div/div[1]/span/span/i #点击下拉框 + sleep 1 + click element ${type} #选择证书类型 + sleep 1 + click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div/div[2]/div[2]/form/div[7]/div/div/div[1]/span/span/i #点击下拉框 + sleep 1 + click element ${type1} #选择加密解密类型 + sleep 1 + ${root} Set Variable ${shift} + run keyword if "${root}"=="open" run keywords sleep 1 + ... AND click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div/div[2]/div[2]/form/div[9]/div/div/span + ... ELSE IF "${root}"=="close" log "go on" + Run Keyword If '${PrivateKeyType}'=='HSM' run keywords sleep 1 + ... AND click element id=privateHSM + ... AND sleep 1 + ... AND input text id=keyringsadd_slotid 10 + sleep 1 + click id=keyringsadd_sub #点击OK缇交 +Intercept-SSL-MirrorDecryptedTraffic-Open + [Arguments] ${MirrorDecryptedTraffic}=null ${MirrorDecryptedTrafficSearchorCreate}=null ${MirrorDecryptedTrafficname}=null ${type}=null ${shuru}=null + [Documentation] 引用次关键字,填入必填参数 + ... 必填参数: + ... ${MirrorDecryptedTraffic}:输入open代表开启按钮,其他代表不开启 + ... ${MirrorDecryptedTrafficSearchorCreate}:填入Create或Search + ... ${MirrorDecryptedTrafficname}:解密流量文件的name + ... ${type}:是mac还是vlan的定位元素 + ... ${shuru}:输入mac或vlan的值 + sleep 1 + run keyword if "${MirrorDecryptedTraffic}"=="open" run keywords sleep 1 + ... AND click element xpath=///*[@id="policy_paper_left"]/div[10]/div[2]/label[contains(text(), "Mirror Decrypted Traffic")]/following-sibling::div/div + ... AND sleep 1 + ... AND clcik element id=mirror_profile + ... AND MirrorDecryptedTraffic-SearchorCreate ${MirrorDecryptedTrafficSearchorCreate} ${MirrorDecryptedTrafficname} ${type} ${shuru} + ... ELSE log 不开启 +MirrorDecryptedTraffic-SearchorCreate + [Arguments] ${MirrorDecryptedTrafficSearchorCreate} ${MirrorDecryptedTrafficname} ${type} ${shuru} + [Documentation] 引用次关键字,填入必填参数 + ... 必填参数: + ... ${MirrorDecryptedTrafficSearchorCreate}:填入Create或Search + ... ${MirrorDecryptedTrafficname}:解密流量文件的name + ... ${type}:是mac还是vlan的定位元素 + ... ${shuru}:输入mac或vlan的值 + sleep 1 + run keyword if "${MirrorDecryptedTrafficSearchorCreate}"=="Create" run keywords sleep 1 + ... AND click element id=interceptionadd_trarightadd + ... AND sleep 2 + ... AND Create-MirrorDecryptedTraffic ${MirrorDecryptedTrafficname} ${type} ${shuru} + run keyword if "${MirrorDecryptedTrafficSearchorCreate}"=="Search" run keywords sleep 1 + ... AND input text id=tradata_profileName ${MirrorDecryptedTrafficname} + ... AND sleep 1 + ... AND press keys id=tradata_profileName ENTER + ... AND sleep 1 + ... AND clcik element id=tralist_length0 +Create-MirrorDecryptedTraffic + [Arguments] ${MirrorDecryptedTrafficname} ${type} ${shuru} + [Documentation] 引用次关键字,填入必填参数 + ... 必填参数: + ... ${MirrorDecryptedTrafficname}:解密流量文件的name + ... ${type}:是mac还是vlan的定位元素 + ... ${shuru}:输入mac或vlan的值 + Sleep 2 + input id=trafficmirror_profileName ${MirrorDecryptedTrafficname} #输入name + Sleep 2 + click id=addrTypeChoose #点击下拉框 + Sleep 2 + click ${type} #选择vlan或者mac + Sleep 1 + input id=trafficmirror_addrArray0 ${shuru} + sleep 2 + click xpath=//*[@id="app"]/div/div[3]/div[2]/div/div/div[2]/button[1] #点击OK +DecryptionProfile-SearchorCreate + [Arguments] ${DecryptionProfileSearchorCreate}=null ${DecryptionProfilename}=null ${dict1}=null ${fail1}=null ${min1}=null ${max1}=null + [Documentation] 引用次关键字,填入必填参数 + ... 必填参数: + ... ${DecryptionProfileSearchorCreate}:填入Create或Search + ... ${DecryptionProfilename}:文件name + ... ${dict1}:是个字典,等于1为开启,等于0为关闭,例如:Common Name=1 Issuer=1 Self-signed=1 Expiry Date=1 EV Certificat=1 + ... Certificate Transparency=1 Mutual Authentication=1 On Protocol Errors=1 Certificate Pinning=1 Certificate Not Installed=1 Mirror Client Versions=1 + ... Allow HTTP/2=1 + ... ${fail1} :输入Fail-close或Pass-through + ... ${min1}:输入协议版本, + ... ${max1}:输入协议版本, + sleep 1 + click element id=interceptionadd_eventkeying + sleep 1 + run keyword if "${DecryptionProfileSearchorCreate}"=="Create" run keywords sleep 1 + ... AND click element id=interceptionadd_decryptionProfileId + ... AND sleep 2 + ... AND Create-DecryptionProfile ${DecryptionProfilename} ${dict1} ${fail1} ${min1} ${max1} + run keyword if "${DecryptionProfileSearchorCreate}"=="Search" run keywords sleep 1 + ... AND input text id=card_keyringName ${DecryptionProfilename} + ... AND sleep 1 + ... AND press keys id=card_keyringName ENTER + ... AND sleep 1 + ... AND clcik element xpath=//*[@id="decryptionProfileList"]/following-sibling::li[2] +Create-DecryptionProfile + [Arguments] ${name} ${dict1} ${fail1} ${min1} ${max1} + Sleep 1 + input id=insert_profileName ${name} + Sleep 1 + DecryptionProfileButtonSwitch ${dict1} //*[@id="policy_Manipulation_create8"]/div[2]/form/div/div/label[contains(text(), " ")]/following-sibling::div/div el-switch is-checked el-switch + ${fail} Set Variable ${fail1} + run keyword if "${fail}"=="Fail-close" Run Keywords sleep 1 + ... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[3]/div[5]/div/div/label[1]/span + ... ELSE IF "${fail}"=="Pass-through" Run Keywords sleep 1 + ... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[3]/div[5]/div/div/label[2]/span + ... ELSE log 1111 + ${min} Set Variable ${min1} + ${max} Set Variable ${max1} + run keyword if "${min}"=="TLSv1.0" Run Keywords sleep 1 + ... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[7]/div[2]/div/div/div/span/span/i + ... AND sleep 1 + ... AND click id=pro_min1 + ... ELSE IF "${min}"=="TLSv1.1" Run Keywords sleep 1 + ... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[7]/div[2]/div/div/div/span/span/i + ... AND sleep 1 + ... AND click id=pro_min2 + ... ELSE IF "${min}"=="TLSv1.2" Run Keywords sleep 1 + ... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[7]/div[2]/div/div/div/span/span/i + ... AND sleep 1 + ... AND click id=pro_min3 + ... ELSE IF "${min}"=="TLSv1.3" Run Keywords sleep 1 + ... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[7]/div[2]/div/div/div/span/span/i + ... AND sleep 1 + ... AND click id=pro_min4 + ... ELSE IF "${min}"=="SSLv3.0" Run Keywords sleep 1 + ... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[7]/div[2]/div/div/div/span/span/i + ... AND sleep 1 + ... AND click id=pro_min0 + ... ELSE log 错误 + run keyword if "${max}"=="TLSv1.0" Run Keywords sleep 1 + ... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[7]/div[3]/div/div/div/span/span/i + ... AND sleep 1 + ... AND click id=pro_max1 + ... ELSE IF "${max}"=="TLSv1.1" Run Keywords sleep 1 + ... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[7]/div[3]/div/div/div/span/span/i + ... AND sleep 1 + ... AND click id=pro_max2 + ... ELSE IF "${max}"=="TLSv1.2" Run Keywords sleep 1 + ... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[7]/div[3]/div/div/div/span/span/i + ... AND sleep 1 + ... AND click id=pro_max3 + ... ELSE IF "${max}"=="TLSv1.3" Run Keywords sleep 1 + ... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[7]/div[3]/div/div/div/span/span/i + ... AND sleep 1 + ... AND click id=pro_max4 + ... ELSE IF "${max}"=="SSLv3.0" Run Keywords sleep 1 + ... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[7]/div[3]/div/div/div/span/span/i + ... AND sleep 1 + ... AND click id=pro_max0 + ... ELSE log 错误 + sleep 2 + click id=decryption-ok + sleep 2 + Settings-Search ${name} ${search} #搜索框的关键字 + sleep 2 + ${name1} get text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[3]/div/div/div[2]/div/div[3]/table/tbody/tr/td[2]/div/div/span + Should Be Equal As Strings ${name1} ${name} + + +DecryptionProfileButtonSwitch + [Arguments] ${dict1} ${xpath1} ${xpath2} ${open} ${close} + ${dict} Set Variable ${dict1} + FOR ${list} ${key} IN ENUMERATE @{dict} + ${class}= Get Element Attribute xpath=${xpath1}${key}${xpath2} class + run keyword if "${class}"=="${open}" and "${dict}[${key}]"=="1" log 默认开启,不进行操作 + run keyword if "${class}"=="${open}" and "${dict}[${key}]"=="0" Run Keywords log 默认开启,但需求需要关闭,进行点击关闭按钮 + ... AND sleep 1 + ... AND click xpath=${xpath1}${key}${xpath2}/span + run keyword if "${class}"=="${close}" and "${dict}[${key}]"=="1" Run Keywords log 默认关闭,但需求需要开启,进行点击开启按钮 + ... AND sleep 1 + ... AND click xpath=${xpath1}${key}${xpath2}/span + run keyword if "${class}"=="${close}" and "${dict}[${key}]"=="0" log 默认关闭,不进行操作 + END LogSession [Arguments] ${LogSession} [Documentation] 调用次关键字前需要添加必填参数: @@ -272,9 +499,9 @@ Enabled [Documentation] 调用次关键字前需要添加必填参数: ... ${Enabled}:填入open或其他 run keyword if "${Enabled}"=="open" run keywords sleep 1 - ... AND click element id=enablencheck - ... AND sleep 1 - ... AND click element xpath=/html/body/div[6]/div/div[3]/button[2] + ... AND click element xpath=//*[@id="policy_paper_left"]/div[18]/label[contains(text(), "Enabled")]/following-sibling::div/div + ... AND sleep 2 + ... AND click element xpath=/html/body/div/div/div[3]/button[2] ... ELSE log 开启日志 Security-Policies-OK @@ -284,9 +511,9 @@ Create-Object-Search [Arguments] ${name} ${filter} [Documentation] 调用次关键字前需要添加必填参数: ... ${name}:填入是一个列表,列表内容为object的name - ... 选择search对象 + ... 选择search对象 sleep 1 - click element xpath=//*[@id="policy_paper_left"]/div[8]/div[1]/div[1]/label[contains(text(), "${filter}")]/following-sibling::div/div + click element xpath=//*[@id="policy_paper_left"]/div[8]/div/div[1]/label[contains(text(), "${filter}")]/following-sibling::div/div sleep 1 FOR ${i} IN @{name} input text xpath=//*[@id="condistions_protocol"]/div[2]/p[contains(text(), "${filter}")]/following-sibling::div[2]/div/div[1]/input ${i} @@ -323,7 +550,7 @@ Create-Source ... AND click element xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[4]/div[2]/div[1]/div[2]/div[1]/div/div/div/div[1]/div/div/div/div[1] ... AND sleep 1 ... AND sleep 1 - ... AND SourceSourceIPCreateOrSearch ${CreateOrSearch} ${Add} ${type1} ${name} ${object_name} ${ipclienttext1} ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits} + ... AND SourceIPCreateOrSearch ${CreateOrSearch} ${Add} ${type1} ${name} ${object_name} ${ipclienttext1} ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits} ... ELSE IF "${type1}"=="SUBID" run keywords sleep 1 ... AND click element xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[4]/div[2]/div[1]/div[2]/div[1]/div/div/div/div[1]/div/div/div/div[2] ... AND sleep 1 @@ -569,11 +796,11 @@ DestinationIPAdd ... ${ip_type}:填入IP或者Geography或者IPLearning ... 判断是新建ip还是新建ip分组 run keyword if "${Add}"=="Address" run keywords sleep 1 - ... AND click element xpath=/html/body/ul/li[1] + ... AND click element xpath=/html/body/ul[contains(@id,'dropdown-menu' )and @x-placement='bottom-start']/child::li[1] ... AND sleep 1 ... AND DestinationIPAddress ${name} ${ip_type} ${ipclienttext1} ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits} ... ELSE IF "${Add}"=="Group" run keywords sleep 1 - ... AND click element xpath=/html/body/ul/li[2] + ... AND click element xpath=/html/body/ul[contains(@id,'dropdown-menu' )and @x-placement='bottom-start']/child::li[2] ... AND sleep 1 ... AND IPGroupAdd ${name} ${ip_type} ${object_name} DestinationIPAddress @@ -593,12 +820,12 @@ DestinationIPAddress ... 判断 新建选择用什么样的类型,并进行新建 DestinationCreate-name ${name} sleep 1 - run keyword if "${ip_type}"=="Ip" run keywords click element xpath=//*[@id="policy_Manipulation2"]/div[1]/div[1]/div[2]/form/div[4]/div/div[1] + run keyword if "${ip_type}"=="Ip" run keywords click element xpath=/html/body/div/div/div[3]/div[2]/div/div[1]/form/div/div[5]/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[4]/div/div[1] ... AND sleep 1 ... AND NewObject.Create-ip-ClientIP-text ${ipclienttext1} ${post} run keyword if "${ip_type}"=="Geography" run keywords click element xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[5]/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[3]/div/div/label[2] ... AND sleep 1 - ... AND click element xpath=//*[@id="policy_Manipulation2"]/div[1]/div[1]/div[2]/form/div[4]/div/div[1]/div[2] + ... AND click element xpath=/html/body/div/div/div[3]/div[2]/div/div[1]/form/div/div[5]/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[4]/div/div[1]/div[2] ... AND sleep 1 ... AND NewObject.Create-Geography ${Country} ${City} ... AND sleep 1 @@ -606,20 +833,20 @@ DestinationIPAddress ... AND sleep 1 run keyword if "${ip_type}"=="IPLearning" run keywords click element xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[5]/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[3]/div/div/label[3] ... AND sleep 1 - ... AND click element xpath=//*[@id="policy_Manipulation2"]/div[1]/div[1]/div[2]/form/div[4]/div/div[1] + ... AND click element xpath=/html/body/div/div/div[3]/div[2]/div/div[1]/form/div/div[5]/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[4]/div/div[1] ... AND sleep 1 - ... AND input text xpath=//*[@id="policy_Manipulation2"]/div[1]/div[1]/div[2]/form/div[4]/div/div[4]/div/div[1]/div[2]/div[1]/div[1]/form/div[1]/div/div[1]/input ${fqdn} + ... AND input text xpath=/html/body/div/div/div[3]/div[2]/div/div[1]/form/div/div[5]/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 1 - ... AND click element xpath=//*[@id="policy_Manipulation2"]/div[1]/div[1]/div[2]/form/div[5]/div[1]/div/div/div[2] + ... AND click element xpath=/html/body/div/div/div[3]/div[2]/div/div[1]/form/div/div[5]/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[5]/div[1]/div/div/div[2] ... AND sleep 1 ... AND Learn-From-Protocols ${Protocols1} ... AND Learning-Depth ${Degree} ... AND sleep 1 - ... AND input text xpath=//*[@id="policy_Manipulation2"]/div[1]/div[1]/div[2]/form/div[5]/div[3]/div/div[1]/input ${times} + ... AND input text xpath=/html/body/div/div/div[3]/div[2]/div/div[1]/form/div/div[5]/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[5]/div[3]/div/div[1]/input ${times} ... AND sleep 1 - ... AND input text xpath=//*[@id="policy_Manipulation2"]/div[1]/div[1]/div[2]/form/div[5]/div[4]/div/div[1]/input ${numbers} + ... AND input text xpath=/html/body/div/div/div[3]/div[2]/div/div[1]/form/div/div[5]/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[5]/div[4]/div/div[1]/input ${numbers} ... AND sleep 1 - ... AND input text xpath=//*[@id="policy_Manipulation2"]/div[1]/div[1]/div[2]/form/div[5]/div[5]/div/div[1]/input ${limits} + ... AND input text xpath=/html/body/div/div/div[3]/div[2]/div/div[1]/form/div/div[5]/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[5]/div[5]/div/div[1]/input ${limits} ... AND sleep 1 DestinationCreate-ok Learn-From-Protocols @@ -642,9 +869,9 @@ Learning-Depth ... ${Degree}:填入1Degree或2Degree ... 判断是用1Degree或2Degree run keyword if "${Degree}"=="1Degree" run keywords sleep 1 - ... AND click element xpath=//*[@id="policy_Manipulation2"]/div[1]/div[1]/div[2]/form/div[5]/div[2]/div/div/label[1] + ... AND click element xpath=/html/body/div/div/div[3]/div[2]/div/div[1]/form/div/div[5]/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 1 - ... AND click element xpath=//*[@id="policy_Manipulation2"]/div[1]/div[1]/div[2]/form/div[5]/div[2]/div/div/label[2] + ... AND click element xpath=/html/body/div/div/div[3]/div[2]/div/div[1]/form/div/div[5]/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[5]/div[2]/div/div/label[2] IPGroupAdd [Arguments] ${name} ${ip_type} ${object_name}