From 59fc3dc84da085d8f0345534a47376791f9b0387 Mon Sep 17 00:00:00 2001 From: lyf Date: Sat, 20 Feb 2021 15:05:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BC=98=E5=8C=96=E7=AD=96?= =?UTF-8?q?=E7=95=A5=E5=85=B3=E9=94=AE=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 01-TestCase/tsg_ui/ui_proxy/Proxy.robot | 4 +- 01-TestCase/tsg_ui/ui_security/Security.robot | 5 +- 02-Keyword/tsg_ui/Menu.robot | 10 +- .../SecurityPolicy/SecurityPolicy.robot | 386 +++++++++--------- .../SecurityPolicy/SourceAndDestination.robot | 166 ++++---- .../tsg_ui/proxyPolicy/ProxyPolicy.robot | 360 ++++++++-------- .../proxyTCPOptions/ProxyTCPOptions.robot | 154 +++---- 03-Variable/BifangApiVariable.txt | 12 +- 8 files changed, 549 insertions(+), 548 deletions(-) diff --git a/01-TestCase/tsg_ui/ui_proxy/Proxy.robot b/01-TestCase/tsg_ui/ui_proxy/Proxy.robot index 64b9223..aa79d47 100644 --- a/01-TestCase/tsg_ui/ui_proxy/Proxy.robot +++ b/01-TestCase/tsg_ui/ui_proxy/Proxy.robot @@ -61,7 +61,7 @@ ProxyPolicy-Deny-HTTP-MaxCombination-Drop-403 LogOptions 1 Enabled open Proxy-Policies-OK - sleep 1 + sleep ${sleep} #修改策略,修改策略相当于再进行一遍新增 Comment 修改策略 Proxy-Source Name ProxyPolicy-Deny-HTTP-MaxCombination @@ -86,5 +86,5 @@ ProxyPolicy-Deny-HTTP-MaxCombination-Drop-403 Proxy-Source Name ProxyPolicy-Deny-MaxCombination-403 ${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr/td[2]/div/div/div/p Should Be Equal As Strings ${text} ProxyPolicy-Deny-MaxCombination-403 - ${PolicyName} set variable SecurityPolicy-Deny-HTTP-MaxCombination + ${PolicyName} set variable ProxyPolicy-Deny-MaxCombination-403 diff --git a/01-TestCase/tsg_ui/ui_security/Security.robot b/01-TestCase/tsg_ui/ui_security/Security.robot index 2667022..f620f25 100644 --- a/01-TestCase/tsg_ui/ui_security/Security.robot +++ b/01-TestCase/tsg_ui/ui_security/Security.robot @@ -51,7 +51,6 @@ SecurityPolicy-Deny-HTTP-MaxCombination-Drop ${ResponseHeadername} create list zdhressck zdhresct ${RequestContentname} create list zdhreqcontent ${ObjName} create dictionary FQDN=${hostname} URL=${urlname} HTTPSignature=${RequestHeadername} HTTPSignature=${ResponseHeadername} Key=${RequestContentname} IP=${ipname} - ${PolicyName} set variable SecurityPolicy-Deny-HTTP-MaxCombination ${filter} create list Host URL Request Header Response Header Request Content Create-Application-Button ApplicationSearch HTTP @@ -61,7 +60,7 @@ SecurityPolicy-Deny-HTTP-MaxCombination-Drop LogSession 1 Enabled open Security-Policies-OK - sleep 1 + sleep ${sleep} #修改策略,修改策略相当于再进行一遍新增 Comment 修改策略 Menu policys Security Policy @@ -88,7 +87,7 @@ SecurityPolicy-Deny-HTTP-MaxCombination-Drop Security-Source Name SecurityPolicy-Deny-SSL-MaxCombination-Drop ${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr/td[2]/div/div/p Should Be Equal As Strings ${text} SecurityPolicy-Deny-SSL-MaxCombination-Drop - + ${PolicyName} set variable SecurityPolicy-Deny-SSL-MaxCombination-Drop #一下用例没有进行Teardown清理,可以根据上面用例完善一下 # SecurityPolicy-Deny-HTTP-MaxCombination-RST # #新建对象fqdn diff --git a/02-Keyword/tsg_ui/Menu.robot b/02-Keyword/tsg_ui/Menu.robot index 12ee809..1659235 100644 --- a/02-Keyword/tsg_ui/Menu.robot +++ b/02-Keyword/tsg_ui/Menu.robot @@ -15,14 +15,14 @@ Menu ${settings} create dictionary Proxy Profiles=sidebarProxy_Profiles WAN NAT Profiles=sidebarSetting_Wannat Certificate Managements=sidebarProxy_CertificateManagement Trouble Shooting=sidebarTrouble_shooting Advanced=sidebarAdvanced # 遍历一级菜单 FOR ${list} ${num} IN ENUMERATE @{dict} - run keyword if "${num}"=="${menuOne}" run keywords sleep 2 + run keyword if "${num}"=="${menuOne}" run keywords sleep ${sleep} ... AND click element id=${dict}[${num}] ... AND LeavePrompt ${OkorCancel} END # 遍历二级菜单 FOR ${list} ${num} IN ENUMERATE @{${menuOne}} run keyword if "${num}"=="dashboard" Exit For Loop - ... ELSE IF "${num}"=="${menuTwo}" run keywords sleep 2 + ... ELSE IF "${num}"=="${menuTwo}" run keywords sleep ${sleep} ... AND click element id=${${menuOne}}[${num}] ... AND LeavePrompt ${OkorCancel} END @@ -31,9 +31,9 @@ LeavePrompt [Arguments] ${OkorCancel} [Documentation] 调用次关键字前需要添加必填参数: ... ${OkorCancel}:填入OK或Cancel - sleep 1 + sleep ${sleep} ${status} Run Keyword And Return Status Page Should Contain Changes you made are not saved. #判断页面是否包含该文本 - sleep 1 + sleep ${sleep} run keyword if "${status}"=="True" Existence ${OkorCancel} run keyword if "${status}"=="False" log go on Existence @@ -48,6 +48,6 @@ ClickOkorCancel [Arguments] ${OkorCancel} [Documentation] 调用次关键字前需要添加必填参数: ... ${OkorCancel}:填入OK或Cancel - sleep 1 + sleep ${sleep} run keyword if "${OkorCancel}"=="OK" click element xpath=//button[@class='el-button el-button--default el-button--small el-button--primary '] run keyword if "${OkorCancel}"=="Cancel" click element xpath=/html/body/div/div/div[3]/button[1] \ 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 1a735c8..c00008d 100644 --- a/02-Keyword/tsg_ui/SecurityPolicy/SecurityPolicy.robot +++ b/02-Keyword/tsg_ui/SecurityPolicy/SecurityPolicy.robot @@ -6,13 +6,13 @@ Resource SourceAndDestination.robot CreateButton [Documentation] 点击安全策略中的Create按钮 Wait Until Element Is Enabled id=app_create - sleep 3 + sleep ${sleep} click element id=app_create Create-name [Arguments] ${name} [Documentation] 输入name - sleep 2 + sleep ${sleep} input text id=interceptionadd_name ${name} Create-action @@ -20,26 +20,26 @@ Create-action [Documentation] 调用次关键字前需要添加必填参数: ... ${action}:填入allow或deny或monitor或intercept ... 判断要创建什么动作的策略 - sleep 1 - run keyword if "${action}"=="allow" run keywords sleep 1 + sleep ${sleep} + run keyword if "${action}"=="allow" run keywords sleep ${sleep} ... AND click element id=security_action_allow - ... ELSE IF "${action}"=="deny" run keywords sleep 1 + ... ELSE IF "${action}"=="deny" run keywords sleep ${sleep} ... AND click element id=security_action_deny - ... ELSE IF "${action}"=="monitor" run keywords sleep 1 + ... ELSE IF "${action}"=="monitor" run keywords sleep ${sleep} ... AND click element id=security_action_monitor - ... ELSE IF "${action}"=="intercept" run keywords sleep 1 + ... ELSE IF "${action}"=="intercept" run keywords sleep ${sleep} ... AND click element id=security_action_intercept Create-Source-Button [Documentation] 点击Source的加号 - sleep 2 + sleep ${sleep} click element xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[4]/div[1]/div/div Create-Destination-Button [Documentation] 点击Destination的加号 - sleep 2 + sleep ${sleep} click element xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[5]/div[1]/div/div - sleep 2 + sleep ${sleep} Create-Application-Button [Documentation] 点击Application的加号 Wait Until Element Is Enabled id=interceptionadd_application 10 @@ -51,11 +51,11 @@ ApplicationSearch ... ${Application}:填入是Application的内容,例如SSL或HTTP ... 选择search对象 input text xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[5]/div[2]/div[2]/div/div[1]/input ${Application} - sleep 1 + sleep ${sleep} 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 + sleep ${sleep} 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 + sleep ${sleep} Create-Filter-judge [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 @@ -67,7 +67,7 @@ Create-Filter-judge ... 判断filter是否可以点击 ${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 + run keyword if "${class}"=="addobject addobject-long-list obj-content-null filter-width-style cursor" run keywords sleep ${sleep} ... 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} @@ -81,72 +81,72 @@ Create-Filter ... ${Filter}:是一个列表,列表中填入filter类型,例如Host或URL等 ... name:各个对象名称的列表 ... 判断添加filter类型 - sleep 2 + sleep ${sleep} FOR ${i} IN @{Filter} - sleep 1 + sleep ${sleep} click element id=interceptionadd_add_filter - sleep 1 - run keyword if "${Application}"=="HTTP" and "${i}"=="Host" run keywords sleep 1 + sleep ${sleep} + run keyword if "${Application}"=="HTTP" and "${i}"=="Host" run keywords sleep ${sleep} ... AND click element xpath=//*[@id="condistions_protocol"]/div/div[1]/div/div/div/ul/li[1] ... AND Create-Object-Search ${Hostname} ${i} - run keyword if "${Application}"=="HTTP" and "${i}"=="URL" run keywords sleep 1 + run keyword if "${Application}"=="HTTP" and "${i}"=="URL" run keywords sleep ${sleep} ... AND click element xpath=//*[@id="condistions_protocol"]/div/div[1]/div/div/div/ul/li[2] ... AND Create-Object-Search ${URLname} ${i} - run keyword if "${Application}"=="HTTP" and "${i}"=="Request Header" run keywords sleep 1 + run keyword if "${Application}"=="HTTP" and "${i}"=="Request Header" run keywords sleep ${sleep} ... AND click element xpath=//*[@id="condistions_protocol"]/div/div[1]/div/div/div/ul/li[3] ... AND Create-Object-Search ${Request Headername} ${i} - run keyword if "${Application}"=="HTTP" and "${i}"=="Response Header" run keywords sleep 1 + run keyword if "${Application}"=="HTTP" and "${i}"=="Response Header" run keywords sleep ${sleep} ... AND click element xpath=//*[@id="condistions_protocol"]/div/div[1]/div/div/div/ul/li[4] ... AND Create-Object-Search ${Response Headername} ${i} - run keyword if "${Application}"=="HTTP" and "${i}"=="Request Content" run keywords sleep 1 + run keyword if "${Application}"=="HTTP" and "${i}"=="Request Content" run keywords sleep ${sleep} ... AND click element xpath=//*[@id="condistions_protocol"]/div/div[1]/div/div/div/ul/li[5] ... AND Create-Object-Search ${Request Contentname} ${i} - run keyword if "${Application}"=="HTTP" and "${i}"=="Response Content" run keywords sleep 1 + run keyword if "${Application}"=="HTTP" and "${i}"=="Response Content" run keywords sleep ${sleep} ... AND click element xpath=//*[@id="condistions_protocol"]/div/div[1]/div/div/div/ul/li[6] ... AND Create-Object-Search ${Response Contentname} ${i} - run keyword if "${Application}"=="SSL" and "${i}"=="SNI" run keywords sleep 1 + run keyword if "${Application}"=="SSL" and "${i}"=="SNI" run keywords sleep ${sleep} ... AND click element xpath=//*[@id="condistions_protocol"]/div/div[1]/div/div/div/ul/li[1] ... AND Create-Object-Search ${SSLSNIname} ${i} - run keyword if "${Application}"=="SSL" and "${i}"=="CN" run keywords sleep 1 + run keyword if "${Application}"=="SSL" and "${i}"=="CN" run keywords sleep ${sleep} ... AND click element xpath=//*[@id="condistions_protocol"]/div/div[1]/div/div/div/ul/li[2] ... AND Create-Object-Search ${CNname} ${i} - run keyword if "${Application}"=="SSL" and "${i}"=="SAN" run keywords sleep 1 + run keyword if "${Application}"=="SSL" and "${i}"=="SAN" run keywords sleep ${sleep} ... AND click element xpath=//*[@id="condistions_protocol"]/div/div[1]/div/div/div/ul/li[3] ... AND Create-Object-Search ${SANname} ${i} - run keyword if "${Application}"=="DNS" and "${i}"=="QNAME" run keywords sleep 1 + run keyword if "${Application}"=="DNS" and "${i}"=="QNAME" run keywords sleep ${sleep} ... AND click element xpath=//*[@id="condistions_protocol"]/div/div[1]/div/div/div/ul/li[1] ... AND Create-Object-Search ${QNAMEname} ${i} - run keyword if "${Application}"=="MAIL" and "${i}"=="Subject" run keywords sleep 1 + run keyword if "${Application}"=="MAIL" and "${i}"=="Subject" run keywords sleep ${sleep} ... AND click element xpath=//*[@id="condistions_protocol"]/div/div[1]/div/div/div/ul/li[1] ... AND Create-Object-Search ${Subjectname} ${i} - run keyword if "${Application}"=="MAIL" and "${i}"=="Content" run keywords sleep 1 + run keyword if "${Application}"=="MAIL" and "${i}"=="Content" run keywords sleep ${sleep} ... AND click element xpath=//*[@id="condistions_protocol"]/div/div[1]/div/div/div/ul/li[2] ... AND Create-Object-Search ${MAILContentname} ${i} - run keyword if "${Application}"=="MAIL" and "${i}"=="Attachment Name" run keywords sleep 1 + run keyword if "${Application}"=="MAIL" and "${i}"=="Attachment Name" run keywords sleep ${sleep} ... AND click element xpath=//*[@id="condistions_protocol"]/div/div[1]/div/div/div/ul/li[3] ... AND Create-Object-Search ${Attachment Namename} ${i} - run keyword if "${Application}"=="MAIL" and "${i}"=="Attachment Content" run keywords sleep 1 + run keyword if "${Application}"=="MAIL" and "${i}"=="Attachment Content" run keywords sleep ${sleep} ... AND click element xpath=//*[@id="condistions_protocol"]/div/div[1]/div/div/div/ul/li[4] ... AND Create-Object-Search ${Attachment Contentname} ${i} - run keyword if "${Application}"=="MAIL" and "${i}"=="From" run keywords sleep 1 + run keyword if "${Application}"=="MAIL" and "${i}"=="From" run keywords sleep ${sleep} ... AND click element xpath=//*[@id="condistions_protocol"]/div/div[1]/div/div/div/ul/li[5] ... AND Create-Object-Search ${Fromname} ${i} - run keyword if "${Application}"=="MAIL" and "${i}"=="To" run keywords sleep 1 + run keyword if "${Application}"=="MAIL" and "${i}"=="To" run keywords sleep ${sleep} ... AND click element xpath=//*[@id="condistions_protocol"]/div/div[1]/div/div/div/ul/li[6] ... AND Create-Object-Search ${Toname} ${i} - run keyword if "${Application}"=="MAIL" and "${i}"=="Account" run keywords sleep 1 + run keyword if "${Application}"=="MAIL" and "${i}"=="Account" run keywords sleep ${sleep} ... AND click element xpath=//*[@id="condistions_protocol"]/div/div[1]/div/div/div/ul/li[7] ... AND Create-Object-Search ${MAILAccountname} ${i} - run keyword if "${Application}"=="FTP" and "${i}"=="URI" run keywords sleep 1 + run keyword if "${Application}"=="FTP" and "${i}"=="URI" run keywords sleep ${sleep} ... AND click element xpath=//*[@id="condistions_protocol"]/div/div[1]/div/div/div/ul/li[1] ... AND Create-Object-Search ${URIname} ${i} - run keyword if "${Application}"=="FTP" and "${i}"=="Content" run keywords sleep 1 + run keyword if "${Application}"=="FTP" and "${i}"=="Content" run keywords sleep ${sleep} ... AND click element xpath=//*[@id="condistions_protocol"]/div/div[1]/div/div/div/ul/li[2] ... AND Create-Object-Search ${FTPContentname} ${i} - run keyword if "${Application}"=="FTP" and "${i}"=="Account" run keywords sleep 1 + run keyword if "${Application}"=="FTP" and "${i}"=="Account" run keywords sleep ${sleep} ... AND click element xpath=//*[@id="condistions_protocol"]/div/div[1]/div/div/div/ul/li[3] ... AND Create-Object-Search ${FTPAccountname} ${i} - run keyword if "${Application}"=="QUIC" and "${i}"=="SNI" run keywords sleep 1 + run keyword if "${Application}"=="QUIC" and "${i}"=="SNI" run keywords sleep ${sleep} ... AND click element xpath=//*[@id="condistions_protocol"]/div/div[1]/div/div/div/ul/li[1] ... AND Create-Object-Search ${QUICSNIname} ${i} END @@ -166,21 +166,21 @@ Deny-subaction ... ${CNAMEvalue}:根据${QType}填入A的CNAME的域名值或AAAA的CNAME域名值 ... ${CNAMEttl}:根据${QType}填入A的CNAME的ttl值或AAAA的CNAME的ttl值 ... 添加subaction - run keyword if "${action}"=="deny" and "${subaction}"=="Drop" run keywords sleep 1 + run keyword if "${action}"=="deny" and "${subaction}"=="Drop" run keywords sleep ${sleep} ... AND click element id=denyUserRegionBlock_method0 - run keyword if "${action}"=="deny" and "${subaction}"=="RST" run keywords sleep 1 + run keyword if "${action}"=="deny" and "${subaction}"=="RST" run keywords sleep ${sleep} ... AND click element id=denyUserRegionBlock_method1 - run keyword if "${action}"=="deny" and "${subaction}"=="Block" run keywords sleep 1 + run keyword if "${action}"=="deny" and "${subaction}"=="Block" run keywords sleep ${sleep} ... AND click element id=denyUserRegionBlock_method2 ... AND Deny-Block ${code} ${Content} ${block-text} ${SearchorCreate} ${ProfileName} ${file} - run keyword if "${action}"=="deny" and "${subaction}"=="Alert" run keywords sleep 1 + run keyword if "${action}"=="deny" and "${subaction}"=="Alert" run keywords sleep ${sleep} ... AND click element id=denyUserRegionBlock_method3 ... AND Deny-Block ${code} ${Content} ${block-text} ${SearchorCreate} ${ProfileName} ${file} - run keyword if "${action}"=="deny" and "${subaction}"=="Redirect" run keywords sleep 1 + run keyword if "${action}"=="deny" and "${subaction}"=="Redirect" run keywords sleep ${sleep} ... AND click element id=denyUserRegionBlock_method4 - ... AND sleep 1 + ... AND sleep ${sleep} ... AND click element id=interceptionadd_rightdetails - ... AND sleep 1 + ... AND sleep ${sleep} ... AND Deny-Redirect ${QType} ${Avalue} ${Attl} ${CNAMEvalue} ${CNAMEttl} Deny-Block @@ -193,25 +193,25 @@ Deny-Block ... ${ProfileName}:Profile的名字 ... ${file}:上传文件路径 ... 添加block数据内容 - sleep 1 + sleep ${sleep} click element id=denyUserRegionBlock_code - run keyword if "${code}"=="403" or "${code}"=="200" run keywords sleep 1 + run keyword if "${code}"=="403" or "${code}"=="200" run keywords sleep ${sleep} ... AND click element id=denyUserRegionBlock_code_select0 - ... AND sleep 1 + ... AND sleep ${sleep} ... AND click element id=blockselect - ... ELSE IF "${code}"=="404" run keywords sleep 1 + ... ELSE IF "${code}"=="404" run keywords sleep ${sleep} ... AND click element id=denyUserRegionBlock_code_select1 - ... AND sleep 1 + ... AND sleep ${sleep} ... AND click element id=blockselect - ... ELSE IF "${code}"=="204" run keywords sleep 1 + ... ELSE IF "${code}"=="204" run keywords sleep ${sleep} ... AND click element id=denyUserRegionBlock_code_select1 - run keyword if "${Content}"=="TEXT" run keywords sleep 1 + run keyword if "${Content}"=="TEXT" run keywords sleep ${sleep} ... AND click element id=blockselect_select0 - ... AND sleep 1 + ... AND sleep ${sleep} ... AND input text id=denyUserRegionBlock_message ${block-text} - ... ELSE IF "${Content}"=="Profile" run keywords sleep 1 + ... ELSE IF "${Content}"=="Profile" run keywords sleep ${sleep} ... AND click element id=blockselect_select1 - ... AND sleep 1 + ... AND sleep ${sleep} ... AND Profile-SearchorCreate ${SearchorCreate} ${ProfileName} ${file} Profile-SearchorCreate [Arguments] ${SearchorCreate} ${ProfileName} ${file} @@ -220,22 +220,22 @@ Profile-SearchorCreate ... ${ProfileName}:Profile的名字 ... ${file}:上传文件路径 ... 判断是新建还是搜索profile - sleep 1 + sleep ${sleep} click element id=html_profile - sleep 1 - run keyword if "${SearchorCreate}"=="Search" run keywords sleep 1 + sleep ${sleep} + run keyword if "${SearchorCreate}"=="Search" run keywords sleep ${sleep} ... AND input text id=filedata_profileName ${ProfileName} - ... AND sleep 1 + ... AND sleep ${sleep} ... AND press keys id=filedata_profileName ENTER - ... AND sleep 1 + ... AND sleep ${sleep} ... AND click element id=filelist_select0 - ... ELSE IF "${SearchorCreate}"=="Create" run keywords sleep 1 + ... ELSE IF "${SearchorCreate}"=="Create" run keywords sleep ${sleep} ... AND click element id=interceptionadd_fileadd - ... AND sleep 1 + ... AND sleep ${sleep} ... AND input text id=responsepages_profileName ${ProfileName} - ... AND sleep 1 + ... AND sleep ${sleep} ... AND Choose File xpath=//*[@id="policy_Manipulation_create6"]/div[2]/form/div[2]/div/div/div/input ${file} #上传文件 - ... AND sleep 1 + ... AND sleep ${sleep} ... AND clcik element id=responseAddOk1 ... ELSE log 传入参数错误 Deny-Redirect @@ -247,28 +247,28 @@ Deny-Redirect ... ${CNAMEvalue}:根据${QType}填入A的CNAME的域名值或AAAA的CNAME域名值 ... ${CNAMEttl}:根据${QType}填入A的CNAME的ttl值或AAAA的CNAME的ttl值 ... 新建Redirect - run keyword if "${QType}"=="A" run keywords sleep 1 + run keyword if "${QType}"=="A" run keywords sleep ${sleep} ... AND input text id=A00 ${Avalue} - ... AND sleep 1 + ... AND sleep ${sleep} ... AND input text id=ttl00 ${Attl} - ... AND sleep 1 + ... AND sleep ${sleep} ... AND click element id=interceptionadd_addForm - ... AND sleep 1 + ... AND sleep ${sleep} ... AND input text id=Cname01 ${CNAMEvalue} - ... AND sleep 1 + ... AND sleep ${sleep} ... AND input text id=ttl01 ${CNAMEttl} - run keyword if "${QType}"=="AAAA" run keywords sleep 1 + run keyword if "${QType}"=="AAAA" run keywords sleep ${sleep} ... AND click element id=dns_qtype_radio01 ... AND input text id=AAAA00 ${Avalue} - ... AND sleep 1 + ... AND sleep ${sleep} ... AND input text id=ttl00 ${Attl} - ... AND sleep 1 + ... AND sleep ${sleep} ... AND click element id=interceptionadd_addForm - ... AND sleep 1 + ... AND sleep ${sleep} ... AND input text id=Cname01 ${CNAMEvalue} - ... AND sleep 1 + ... AND sleep ${sleep} ... AND input text id=ttl01 ${CNAMEttl} - sleep 1 + sleep ${sleep} click element id=interceptionadd_shezhidns Intercept-SSL-Keyring-SearchorCreate [Arguments] ${KeySearchorCreate} ${keyname} ${file}=null ${file1}=null ${ExpiryHours1or2}=null ${type}=null ${type1}=null @@ -284,19 +284,19 @@ Intercept-SSL-Keyring-SearchorCreate ... ${type1}:上传证书加密解密算法的元素 ... ${shift}:是否打开客户端包含证书按钮 ... ${PrivateKeyType}:私钥类型 - sleep 1 + sleep ${sleep} click element id=interceptionadd_eventkeying1 - sleep 1 - run keyword if "${KeySearchorCreate}"=="Create" run keywords sleep 1 + sleep ${sleep} + run keyword if "${KeySearchorCreate}"=="Create" run keywords sleep ${sleep} ... AND click element id=interceptionadd_keyadd - ... AND sleep 2 + ... AND sleep ${sleep} ... AND Create-Keyring ${keyname} ${file} ${file1} ${ExpiryHours1or2} ${type} ${type1} ... ${shift}=close ${PrivateKeyType}=PrivateKeyFile - run keyword if "${KeySearchorCreate}"=="Search" run keywords sleep 1 + run keyword if "${KeySearchorCreate}"=="Search" run keywords sleep ${sleep} ... AND input text id=card_keyringName1 ${keyname} - ... AND sleep 1 + ... AND sleep ${sleep} ... AND press keys id=card_keyringName1 ENTER - ... AND sleep 1 + ... AND sleep ${sleep} ... AND clcik element id=card_keylist0 Create-Keyring @@ -312,33 +312,33 @@ Create-Keyring ... ${type1}:上传证书加密解密算法的元素 ... ${shift}:是否打开客户端包含证书按钮 ... ${PrivateKeyType}:私钥类型 - Sleep 2 + sleep ${sleep} input id=keyringsadd_name ${name} #输入name - Sleep 2 + sleep ${sleep} 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 + sleep ${sleep} 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 + sleep ${sleep} 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 + sleep ${sleep} click element ${type} #选择证书类型 - sleep 1 + sleep ${sleep} 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 + sleep ${sleep} click element ${type1} #选择加密解密类型 - sleep 1 + sleep ${sleep} ${root} Set Variable ${shift} - run keyword if "${root}"=="open" run keywords sleep 1 + run keyword if "${root}"=="open" run keywords sleep ${sleep} ... 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 + Run Keyword If '${PrivateKeyType}'=='HSM' run keywords sleep ${sleep} ... AND click element id=privateHSM - ... AND sleep 1 + ... AND sleep ${sleep} ... AND input text id=keyringsadd_slotid 10 - sleep 1 + sleep ${sleep} click id=keyringsadd_sub #点击OK缇交 Intercept-SSL-MirrorDecryptedTraffic-Open [Arguments] ${MirrorDecryptedTraffic}=null ${MirrorDecryptedTrafficSearchorCreate}=null ${MirrorDecryptedTrafficname}=null ${type}=null ${shuru}=null @@ -349,10 +349,10 @@ Intercept-SSL-MirrorDecryptedTraffic-Open ... ${MirrorDecryptedTrafficname}:解密流量文件的name ... ${type}:是mac还是vlan的定位元素 ... ${shuru}:输入mac或vlan的值 - sleep 1 - run keyword if "${MirrorDecryptedTraffic}"=="open" run keywords sleep 1 + sleep ${sleep} + run keyword if "${MirrorDecryptedTraffic}"=="open" run keywords sleep ${sleep} ... 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 sleep ${sleep} ... AND clcik element id=mirror_profile ... AND MirrorDecryptedTraffic-SearchorCreate ${MirrorDecryptedTrafficSearchorCreate} ${MirrorDecryptedTrafficname} ${type} ${shuru} ... ELSE log 不开启 @@ -364,16 +364,16 @@ MirrorDecryptedTraffic-SearchorCreate ... ${MirrorDecryptedTrafficname}:解密流量文件的name ... ${type}:是mac还是vlan的定位元素 ... ${shuru}:输入mac或vlan的值 - sleep 1 - run keyword if "${MirrorDecryptedTrafficSearchorCreate}"=="Create" run keywords sleep 1 + sleep ${sleep} + run keyword if "${MirrorDecryptedTrafficSearchorCreate}"=="Create" run keywords sleep ${sleep} ... AND click element id=interceptionadd_trarightadd - ... AND sleep 2 + ... AND sleep ${sleep} ... AND Create-MirrorDecryptedTraffic ${MirrorDecryptedTrafficname} ${type} ${shuru} - run keyword if "${MirrorDecryptedTrafficSearchorCreate}"=="Search" run keywords sleep 1 + run keyword if "${MirrorDecryptedTrafficSearchorCreate}"=="Search" run keywords sleep ${sleep} ... AND input text id=tradata_profileName ${MirrorDecryptedTrafficname} - ... AND sleep 1 + ... AND sleep ${sleep} ... AND press keys id=tradata_profileName ENTER - ... AND sleep 1 + ... AND sleep ${sleep} ... AND clcik element id=tralist_length0 Create-MirrorDecryptedTraffic [Arguments] ${MirrorDecryptedTrafficname} ${type} ${shuru} @@ -382,15 +382,15 @@ Create-MirrorDecryptedTraffic ... ${MirrorDecryptedTrafficname}:解密流量文件的name ... ${type}:是mac还是vlan的定位元素 ... ${shuru}:输入mac或vlan的值 - Sleep 2 + sleep ${sleep} input id=trafficmirror_profileName ${MirrorDecryptedTrafficname} #输入name - Sleep 2 + sleep ${sleep} click id=addrTypeChoose #点击下拉框 - Sleep 2 + sleep ${sleep} click ${type} #选择vlan或者mac - Sleep 1 + sleep ${sleep} input id=trafficmirror_addrArray0 ${shuru} - sleep 2 + sleep ${sleep} 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 @@ -404,80 +404,80 @@ DecryptionProfile-SearchorCreate ... ${fail1} :输入Fail-close或Pass-through ... ${min1}:输入协议版本, ... ${max1}:输入协议版本, - sleep 1 + sleep ${sleep} click element id=interceptionadd_eventkeying - sleep 1 - run keyword if "${DecryptionProfileSearchorCreate}"=="Create" run keywords sleep 1 + sleep ${sleep} + run keyword if "${DecryptionProfileSearchorCreate}"=="Create" run keywords sleep ${sleep} ... AND click element id=interceptionadd_decryptionProfileId - ... AND sleep 2 + ... AND sleep ${sleep} ... AND Create-DecryptionProfile ${DecryptionProfilename} ${dict1} ${fail1} ${min1} ${max1} - run keyword if "${DecryptionProfileSearchorCreate}"=="Search" run keywords sleep 1 + run keyword if "${DecryptionProfileSearchorCreate}"=="Search" run keywords sleep ${sleep} ... AND input text id=card_keyringName ${DecryptionProfilename} - ... AND sleep 1 + ... AND sleep ${sleep} ... AND press keys id=card_keyringName ENTER - ... AND sleep 1 + ... AND sleep ${sleep} ... AND clcik element xpath=//*[@id="decryptionProfileList"]/following-sibling::li[2] Create-DecryptionProfile [Arguments] ${name} ${dict1} ${fail1} ${min1} ${max1} - Sleep 1 + sleep ${sleep} input id=insert_profileName ${name} - Sleep 1 + sleep ${sleep} 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 + run keyword if "${fail}"=="Fail-close" Run Keywords sleep ${sleep} ... 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 + ... ELSE IF "${fail}"=="Pass-through" Run Keywords sleep ${sleep} ... 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 + run keyword if "${min}"=="TLSv1.0" Run Keywords sleep ${sleep} ... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[7]/div[2]/div/div/div/span/span/i - ... AND sleep 1 + ... AND sleep ${sleep} ... AND click id=pro_min1 - ... ELSE IF "${min}"=="TLSv1.1" Run Keywords sleep 1 + ... ELSE IF "${min}"=="TLSv1.1" Run Keywords sleep ${sleep} ... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[7]/div[2]/div/div/div/span/span/i - ... AND sleep 1 + ... AND sleep ${sleep} ... AND click id=pro_min2 - ... ELSE IF "${min}"=="TLSv1.2" Run Keywords sleep 1 + ... ELSE IF "${min}"=="TLSv1.2" Run Keywords sleep ${sleep} ... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[7]/div[2]/div/div/div/span/span/i - ... AND sleep 1 + ... AND sleep ${sleep} ... AND click id=pro_min3 - ... ELSE IF "${min}"=="TLSv1.3" Run Keywords sleep 1 + ... ELSE IF "${min}"=="TLSv1.3" Run Keywords sleep ${sleep} ... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[7]/div[2]/div/div/div/span/span/i - ... AND sleep 1 + ... AND sleep ${sleep} ... AND click id=pro_min4 - ... ELSE IF "${min}"=="SSLv3.0" Run Keywords sleep 1 + ... ELSE IF "${min}"=="SSLv3.0" Run Keywords sleep ${sleep} ... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[7]/div[2]/div/div/div/span/span/i - ... AND sleep 1 + ... AND sleep ${sleep} ... AND click id=pro_min0 ... ELSE log 错误 - run keyword if "${max}"=="TLSv1.0" Run Keywords sleep 1 + run keyword if "${max}"=="TLSv1.0" Run Keywords sleep ${sleep} ... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[7]/div[3]/div/div/div/span/span/i - ... AND sleep 1 + ... AND sleep ${sleep} ... AND click id=pro_max1 - ... ELSE IF "${max}"=="TLSv1.1" Run Keywords sleep 1 + ... ELSE IF "${max}"=="TLSv1.1" Run Keywords sleep ${sleep} ... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[7]/div[3]/div/div/div/span/span/i - ... AND sleep 1 + ... AND sleep ${sleep} ... AND click id=pro_max2 - ... ELSE IF "${max}"=="TLSv1.2" Run Keywords sleep 1 + ... ELSE IF "${max}"=="TLSv1.2" Run Keywords sleep ${sleep} ... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[7]/div[3]/div/div/div/span/span/i - ... AND sleep 1 + ... AND sleep ${sleep} ... AND click id=pro_max3 - ... ELSE IF "${max}"=="TLSv1.3" Run Keywords sleep 1 + ... ELSE IF "${max}"=="TLSv1.3" Run Keywords sleep ${sleep} ... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[7]/div[3]/div/div/div/span/span/i - ... AND sleep 1 + ... AND sleep ${sleep} ... AND click id=pro_max4 - ... ELSE IF "${max}"=="SSLv3.0" Run Keywords sleep 1 + ... ELSE IF "${max}"=="SSLv3.0" Run Keywords sleep ${sleep} ... AND click xpath=//*[@id="policy_Manipulation_create8"]/div[2]/form/div[7]/div[3]/div/div/div/span/span/i - ... AND sleep 1 + ... AND sleep ${sleep} ... AND click id=pro_max0 ... ELSE log 错误 - sleep 2 + sleep ${sleep} click id=decryption-ok - sleep 2 + sleep ${sleep} Settings-Search ${name} ${search} #搜索框的关键字 - sleep 2 + sleep ${sleep} ${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} @@ -489,10 +489,10 @@ DecryptionProfileButtonSwitch ${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 sleep ${sleep} ... AND click xpath=${xpath1}${key}${xpath2}/span run keyword if "${class}"=="${close}" and "${dict}[${key}]"=="1" Run Keywords log 默认关闭,但需求需要开启,进行点击开启按钮 - ... AND sleep 1 + ... AND sleep ${sleep} ... AND click xpath=${xpath1}${key}${xpath2}/span run keyword if "${class}"=="${close}" and "${dict}[${key}]"=="0" log 默认关闭,不进行操作 END @@ -500,37 +500,37 @@ LogSession [Arguments] ${LogSession} [Documentation] 调用次关键字前需要添加必填参数: ... ${LogSession}:填入clcos或其他 - run keyword if "${LogSession}"=="close" run keywords sleep 1 + run keyword if "${LogSession}"=="close" run keywords sleep ${sleep} ... AND click element id=addlabel_labels_log ... ELSE log 开启日志 Enabled [Arguments] ${Enabled} [Documentation] 调用次关键字前需要添加必填参数: ... ${Enabled}:填入open或其他 - run keyword if "${Enabled}"=="open" run keywords sleep 1 + run keyword if "${Enabled}"=="open" run keywords sleep ${sleep} ... AND click element xpath=//*[@id="policy_paper_left"]/div/label[contains(text(), "Enabled")]/following-sibling::div/div - ... AND sleep 2 + ... AND sleep ${sleep} ... AND click element xpath=/html/body/div/div/div[3]/button[2] ... ELSE log 开启日志 Security-Policies-OK - sleep 1 + sleep ${sleep} click element id=interceptionadd_sub Create-Object-Search [Arguments] ${name} ${filter} [Documentation] 调用次关键字前需要添加必填参数: ... ${name}:填入是一个列表,列表内容为object的name ... 选择search对象 - sleep 1 + sleep ${sleep} click element xpath=//*[@id="policy_paper_left"]/div[8]/div/div[1]/label[contains(text(), "${filter}")]/following-sibling::div/div - sleep 1 + 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 1 + sleep ${sleep} press keys xpath=//*[@id="condistions_protocol"]/div[2]/p[contains(text(), "${filter}")]/following-sibling::div[2]/div/div[1]/input ENTER - sleep 1 + 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 1 + sleep ${sleep} END @@ -538,55 +538,55 @@ Security-Source [Arguments] ${SourceType} ${SourceValue} Wait Until Element Is Enabled xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[1]/span/div/div/div[2]/div/div 10 click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[1]/span/div/div/div[2]/div/div - sleep 1 - run keyword if "${SourceType}"=="ID" run keywords sleep 1 + sleep ${sleep} + run keyword if "${SourceType}"=="ID" run keywords sleep ${sleep} ... AND click element xpath=/html/body/div/div[1]/div[1]/ul/li[2] - run keyword if "${SourceType}"=="Name" run keywords sleep 1 + run keyword if "${SourceType}"=="Name" run keywords sleep ${sleep} ... AND click element xpath=/html/body/div/div[1]/div[1]/ul/li[3] - run keyword if "${SourceType}"=="Action" run keywords sleep 1 + run keyword if "${SourceType}"=="Action" run keywords sleep ${sleep} ... AND click element xpath=/html/body/div/div[1]/div[1]/ul/li[4] - sleep 1 + 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 ${SourceValue} - sleep 1 + sleep ${sleep} click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[1]/span/div/i - sleep 1 + sleep ${sleep} click element xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1] - sleep 1 + sleep ${sleep} EditButton - sleep 1 + sleep ${sleep} click element xpath=//*[@id="appEdit"]/span/div/div[2] - sleep 1 + sleep ${sleep} Initialize-Policie [Arguments] ${InitializeAction} [Documentation] 调用次关键字前需要添加必填参数: ... ${InitializeAction}:根据用例进行填写,意思就是是那一个action就不要点击哪一个,以免初始化失败 - run keyword if "${InitializeAction}"=="Allow" run keywords sleep 1 + run keyword if "${InitializeAction}"=="Allow" run keywords sleep ${sleep} ... AND click element id=security_action_deny - ... AND sleep 1 - ... ELSE IF "${InitializeAction}"=="Deny" run keywords sleep 1 + ... AND sleep ${sleep} + ... ELSE IF "${InitializeAction}"=="Deny" run keywords sleep ${sleep} ... AND click element id=security_action_allow - ... ELSE IF "${InitializeAction}"=="Monitor" run keywords sleep 1 + ... ELSE IF "${InitializeAction}"=="Monitor" run keywords sleep ${sleep} ... AND click element id=security_action_deny - ... ELSE IF "${InitializeAction}"=="Intercept" run keywords sleep 1 + ... ELSE IF "${InitializeAction}"=="Intercept" run keywords sleep ${sleep} ... AND click element id=security_action_deny ... ELSE log 不修改 - sleep 1 + sleep ${sleep} ${status} Run Keyword And Return Status Page should contain element xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form[1]/div/div[4]/div[1]/div/div/div #判断页面是否包含该元素 run keyword if "${status}"=="False" log go on - run keyword if "${status}"=="True" run keywords sleep 1 + run keyword if "${status}"=="True" run keywords sleep ${sleep} ... AND click element xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form[1]/div/div[4]/div[1]/div/div/div/p/span/span/i[2] - ... AND sleep 1 + ... AND sleep ${sleep} ${status1} Run Keyword And Return Status Page should contain element xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form[1]/div/div[5]/div[1]/div/div/div #判断页面是否包含该元素 run keyword if "${status1}"=="False" log go on - run keyword if "${status1}"=="True" run keywords sleep 1 + run keyword if "${status1}"=="True" run keywords sleep ${sleep} ... AND click element xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form[1]/div/div[5]/div[1]/div/div/div/p/span/span/i[2] - ... AND sleep 1 + ... AND sleep ${sleep} Delete-Security-estimate [Arguments] ${securityname} - run keyword if "${securityname}"!="null" run keywords sleep 1 + run keyword if "${securityname}"!="null" run keywords sleep ${sleep} ... AND Delete-Security ${securityname} ... ELSE log go on @@ -594,27 +594,27 @@ Delete-Security [Arguments] ${securityname} Menu policys Security Policy - sleep 2 + sleep ${sleep} Wait Until Element Is Enabled xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[1]/span/div/div/div[2]/div/div 10 click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[1]/span/div/div/div[2]/div/div - sleep 1 + sleep ${sleep} click element xpath=/html/body/div/div[1]/div[1]/ul/li[3] - sleep 1 + 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 ${securityname} - sleep 1 + sleep ${sleep} click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[1]/span/div/i - sleep 1 + sleep ${sleep} Run Keyword And Ignore Error click element xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1] - sleep 2 - sleep 1 + sleep ${sleep} + sleep ${sleep} Run Keyword And Ignore Error click element id=appDel - sleep 1 + sleep ${sleep} Run Keyword And Ignore Error click element xpath=/html/body/div/div/div[3]/button[2] - sleep 1 + sleep ${sleep} Delete-object-estimate [Arguments] ${obj} - run keyword if "${obj}"!="null" run keywords sleep 1 + run keyword if "${obj}"!="null" run keywords sleep ${sleep} ... AND Delete-object ${obj} ... ELSE log go on Delete-object @@ -628,20 +628,20 @@ Forname [Arguments] ${objectname} ${key} FOR ${i} IN @{objectname} Menu objects ${key} - sleep 2 + 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 2 + sleep ${sleep} click element xpath=/html/body/div/div[1]/div[1]/ul/li[3] #点击name为搜索类型 - sleep 2 + 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 2 + sleep ${sleep} click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[1]/span/div/i #点击搜索按钮 - sleep 2 + 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 2 - sleep 1 + sleep ${sleep} + sleep ${sleep} Run Keyword And Ignore Error click element id=objectDel #点击删除按钮 - sleep 1 + sleep ${sleep} Run Keyword And Ignore Error click element xpath=/html/body/div/div/div[3]/button[2] - sleep 1 + sleep ${sleep} END diff --git a/02-Keyword/tsg_ui/SecurityPolicy/SourceAndDestination.robot b/02-Keyword/tsg_ui/SecurityPolicy/SourceAndDestination.robot index 30d7a43..47c492f 100644 --- a/02-Keyword/tsg_ui/SecurityPolicy/SourceAndDestination.robot +++ b/02-Keyword/tsg_ui/SecurityPolicy/SourceAndDestination.robot @@ -29,22 +29,22 @@ Create-Source ... ${keywordtext}:填入新建subid的内容 ... 判断新建source选择用什么样的类型数据 ... - run keyword if "${type1}"=="Ip" run keywords sleep 2 + run keyword if "${type1}"=="Ip" run keywords sleep ${sleep} ... AND click element xpath=${policytype}/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 sleep ${sleep} + ... AND sleep ${sleep} ... AND SourceIPCreateOrSearch ${policytype} ${CreateOrSearch} ${Add} ${type1} ${name} ${object_name} ${ipclienttext1} ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits} - ... ELSE IF "${type1}"=="SUBID" run keywords sleep 2 + ... ELSE IF "${type1}"=="SUBID" run keywords sleep ${sleep} ... AND click element xpath=${policytype}/div[2]/div[1]/div[2]/div[1]/div/div/div/div[1]/div/div/div/div[2] - ... AND sleep 1 + ... AND sleep ${sleep} ... AND SUBIDCreateOrSearch ${policytype} ${name} ${keywordtext} ${object_name} - ... ELSE IF "${type1}"=="Geography" run keywords sleep 2 + ... ELSE IF "${type1}"=="Geography" run keywords sleep ${sleep} ... AND click element xpath=${policytype}/div[2]/div[1]/div[2]/div[1]/div/div/div/div[1]/div/div/div/div[3] - ... AND sleep 1 + ... AND sleep ${sleep} ... AND SourceIPCreateOrSearch ${policytype} ${CreateOrSearch} ${Add} ${type1} ${name} ${object_name} ${ipclienttext1} ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits} - ... ELSE IF "${type1}"=="IPLearning" run keywords sleep 2 + ... ELSE IF "${type1}"=="IPLearning" run keywords sleep ${sleep} ... AND click element xpath=${policytype}/div[2]/div[1]/div[2]/div[1]/div/div/div/div[1]/div/div/div/div[4] - ... AND sleep 1 + ... AND sleep ${sleep} ... AND SourceIPCreateOrSearch ${policytype} ${CreateOrSearch} ${Add} ${type1} ${name} ${object_name} ${ipclienttext1} ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits} Create-Destination @@ -69,18 +69,18 @@ Create-Destination ... ${object_name}:列表形式,列表中是对象的名字 ... ${keywordtext}:填入新建subid的内容 ... 判断新建source选择用什么样的类型数据 - run keyword if "${type1}"=="Ip" run keywords sleep 1 + run keyword if "${type1}"=="Ip" run keywords sleep ${sleep} ... AND click element xpath=${policytype}/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 sleep ${sleep} + ... AND sleep ${sleep} ... AND DestinationIPCreateOrSearch ${policytype} ${CreateOrSearch} ${Add} ${type1} ${name} ${object_name} ${ipclienttext1} ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits} - ... ELSE IF "${type1}"=="Geography" run keywords sleep 1 + ... ELSE IF "${type1}"=="Geography" run keywords sleep ${sleep} ... AND click element xpath=${policytype}/div[2]/div[1]/div[2]/div[1]/div/div/div/div[1]/div/div/div/div[3] - ... AND sleep 1 + ... AND sleep ${sleep} ... AND DestinationIPCreateOrSearch ${policytype} ${CreateOrSearch} ${Add} ${type1} ${name} ${object_name} ${ipclienttext1} ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits} - ... ELSE IF "${type1}"=="IPLearning" run keywords sleep 1 + ... ELSE IF "${type1}"=="IPLearning" run keywords sleep ${sleep} ... AND click element xpath=${policytype}/div[2]/div[1]/div[2]/div[1]/div/div/div/div[1]/div/div/div/div[4] - ... AND sleep 1 + ... AND sleep ${sleep} ... AND DestinationIPCreateOrSearch ${policytype} ${CreateOrSearch} ${Add} ${type1} ${name} ${object_name} ${ipclienttext1} ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits} @@ -103,10 +103,10 @@ SourceIPCreateOrSearch ... ${limits}:填入数值,例如1或10000 ... ${object_name}:列表形式,列表中是对象的名字 ... 判断是新建ip还是搜索添加ip - run keyword if "${CreateOrSearch}"=="Create" run keywords sleep 1 + run keyword if "${CreateOrSearch}"=="Create" run keywords sleep ${sleep} ... AND click element id=interceptionadd_proaddaddSource ... AND SourceIPAdd ${policytype} ${Add} ${ip_type} ${name} ${object_name} ${ipclienttext1} ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits} - ... ELSE IF "${CreateOrSearch}"=="Search" run keywords sleep 1 + ... ELSE IF "${CreateOrSearch}"=="Search" run keywords sleep ${sleep} ... AND SourceSearch ${policytype} ${object_name} SUBIDCreateOrSearch [Arguments] ${policytype} ${name} ${keywordtext} ${object_name} @@ -116,10 +116,10 @@ SUBIDCreateOrSearch ... ${keywordtext}:填入新建subid的内容 ... ${object_name}:列表形式,列表中是对象的名字 ... 判断是新建subid还是搜索添加subid - run keyword if "${CreateOrSearch}"=="Create" run keywords sleep 1 + run keyword if "${CreateOrSearch}"=="Create" run keywords sleep ${sleep} ... AND click element id=interceptionadd_proaddaddSource ... AND SUBIDAdd ${policytype} ${Add} ${name} ${keywordtext} ${object_name} - ... ELSE IF "${CreateOrSearch}"=="Search" run keywords sleep 1 + ... ELSE IF "${CreateOrSearch}"=="Search" run keywords sleep ${sleep} ... AND SourceSearch ${object_name} DestinationIPCreateOrSearch [Arguments] ${policytype} ${CreateOrSearch} ${Add} ${ip_type} ${name} ${object_name} ${ipclienttext1} @@ -140,10 +140,10 @@ DestinationIPCreateOrSearch ... ${limits}:填入数值,例如1或10000 ... ${object_name}:列表形式,列表中是对象的名字 ... 判断是新建ip还是搜索添加ip - run keyword if "${CreateOrSearch}"=="Create" run keywords sleep 1 + run keyword if "${CreateOrSearch}"=="Create" run keywords sleep ${sleep} ... AND click element id=interceptionadd_proaddaddDestination ... AND DestinationIPAdd ${policytype} ${Add} ${ip_type} ${name} ${object_name} ${ipclienttext1} ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits} - ... ELSE IF "${CreateOrSearch}"=="Search" run keywords sleep 1 + ... ELSE IF "${CreateOrSearch}"=="Search" run keywords sleep ${sleep} ... AND DestinationSearch ${policytype} ${object_name} SourceSearch [Arguments] ${policytype} ${name} @@ -152,11 +152,11 @@ SourceSearch ... 选择search对象 FOR ${i} IN @{name} input text xpath=${policytype}/div[2]/div[1]/div[2]/div[2]/div/div[1]/input ${i} - sleep 1 + sleep ${sleep} press keys xpath=${policytype}/div[2]/div[1]/div[2]/div[2]/div/div[1]/input ENTER - sleep 1 + sleep ${sleep} click element xpath=${policytype}/div[2]/div[1]/div[2]/div[2]/div/div[2]/div/div/ul/li[1] - sleep 1 + sleep ${sleep} END DestinationSearch [Arguments] ${policytype} ${name} @@ -165,11 +165,11 @@ DestinationSearch ... 选择search对象 FOR ${i} IN @{name} input text xpath=${policytype}/div[2]/div[1]/div[2]/div[2]/div/div[1]/input ${i} - sleep 1 + sleep ${sleep} press keys xpath=${policytype}/div[2]/div[1]/div[2]/div[2]/div/div[1]/input ENTER - sleep 1 + sleep ${sleep} click element xpath=${policytype}/div[2]/div[1]/div[2]/div[2]/div/div[2]/div/div/ul/li[1] - sleep 1 + sleep ${sleep} END SUBIDAdd @@ -180,13 +180,13 @@ SUBIDAdd ... ${keywordtext}:填入新建subid的内容 ... ${object_name}:列表形式,列表中是对象的名字 ... 判断是新建subid还是新建subid分组 - run keyword if "${Add}"=="Address" run keywords sleep 1 + run keyword if "${Add}"=="Address" run keywords sleep ${sleep} ... AND click element xpath=/html/body/ul/li[1] - ... AND sleep 1 + ... AND sleep ${sleep} ... AND SUBAddress ${policytype}${name} ${keywordtext} - ... ELSE IF "${Add}"=="Group" run keywords sleep 1 + ... ELSE IF "${Add}"=="Group" run keywords sleep ${sleep} ... AND click element xpath=/html/body/ul/li[2] - ... AND sleep 1 + ... AND sleep ${sleep} ... AND SUBGroupAdd ${policytype} ${name} ${object_name} SUBAddress [Arguments] ${policytype} ${name} ${keywordtext} @@ -196,9 +196,9 @@ SUBAddress ... 新建subid SourceCreate-name ${name} click element xpath=${policytype}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[3]/div/div[1] - sleep 1 + sleep ${sleep} Create-SubscriberID-text ${keywordtext} - sleep 1 + sleep ${sleep} SUBGroupAdd [Arguments] ${policytype} ${name} ${object_name} @@ -208,7 +208,7 @@ SUBGroupAdd ... 新建subid分组 SourceCreate-name ${name} click element xpath=${policytype}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[3]/div/div/div[2] - sleep 1 + sleep ${sleep} Create-Sub-Objects ${object_name} NewObject.Create-ok SourceIPAdd @@ -217,13 +217,13 @@ SourceIPAdd ... ${Add}:填入Address或Group ... ${ip_type}:填入IP或者Geography或者IPLearning ... 判断是新建ip还是新建ip分组 - run keyword if "${Add}"=="Address" run keywords sleep 1 + run keyword if "${Add}"=="Address" run keywords sleep ${sleep} ... AND click element xpath=/html/body/ul/li[1] - ... AND sleep 1 + ... AND sleep ${sleep} ... AND SourceIPAddress ${policytype} ${name} ${ip_type} ${ipclienttext1} ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits} - ... ELSE IF "${Add}"=="Group" run keywords sleep 1 + ... ELSE IF "${Add}"=="Group" run keywords sleep ${sleep} ... AND click element xpath=/html/body/ul/li[2] - ... AND sleep 1 + ... AND sleep ${sleep} ... AND SourceIPGroupAdd ${policytype} ${name} ${ip_type} ${object_name} SourceIPAddress [Arguments] ${policytype} ${name} ${ip_type} ${ipclienttext1} ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits} @@ -241,36 +241,36 @@ SourceIPAddress ... ${limits}:填入数值,例如1或10000 ... 判断 新建选择用什么样的类型,并进行新建 SourceCreate-name ${name} - sleep 1 + sleep ${sleep} run keyword if "${ip_type}"=="Ip" run keywords click element xpath=${policytype}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[4]/div/div[1] - ... AND sleep 1 + ... AND sleep ${sleep} ... AND NewObject.Create-ip-ClientIP-text ${ipclienttext1} ${post} run keyword if "${ip_type}"=="Geography" run keywords click element xpath=${policytype}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[3]/div/div/label[2] - ... AND sleep 1 + ... AND sleep ${sleep} ... AND click element xpath=${policytype}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[4]/div/div[1]/div[2] - ... AND sleep 1 + ... AND sleep ${sleep} ... AND NewObject.Create-Geography ${Country} ${City} - ... AND sleep 1 + ... AND sleep ${sleep} ... AND click element xpath=${policytype}/div[2]/div[2]/div/div[1]/div[10]/div/div/div/div[4]/button - ... AND sleep 1 + ... AND sleep ${sleep} run keyword if "${ip_type}"=="IPLearning" run keywords click element xpath=${policytype}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[3]/div/div/label[3] - ... AND sleep 1 + ... AND sleep ${sleep} ... AND click element xpath=${policytype}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[4]/div/div[1] - ... AND sleep 1 + ... AND sleep ${sleep} ... AND input text xpath=${policytype}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[4]/div/div[3]/div/div[1]/div[2]/div[1]/div[1]/form/div[1]/div/div[1]/input ${fqdn} - ... AND sleep 1 + ... AND sleep ${sleep} ... AND click element xpath=//*[@id="policy_Manipulation2"]/div[1]/div[1]/div[2]/form/div[5]/div[1]/div/div/div[2] - ... AND sleep 1 + ... AND sleep ${sleep} ... AND Learn-From-Protocols ${Protocols1} ... AND Learning-Depth ${policytype} ${Degree} - ... AND sleep 1 + ... AND sleep ${sleep} ... AND input text xpath=//*[@id="policy_Manipulation2"]/div[1]/div[1]/div[2]/form/div[5]/div[3]/div/div[1]/input ${times} - ... AND sleep 1 + ... AND sleep ${sleep} ... AND input text xpath=//*[@id="policy_Manipulation2"]/div[1]/div[1]/div[2]/form/div[5]/div[4]/div/div[1]/input ${numbers} - ... AND sleep 1 + ... AND sleep ${sleep} ... AND input text xpath=//*[@id="policy_Manipulation2"]/div[1]/div[1]/div[2]/form/div[5]/div[5]/div/div[1]/input ${limits} - ... AND sleep 1 - sleep 3 + ... AND sleep ${sleep} + sleep ${sleep} SourceCreate-ok DestinationIPAdd @@ -279,13 +279,13 @@ DestinationIPAdd ... ${Add}:填入Address或Group ... ${ip_type}:填入IP或者Geography或者IPLearning ... 判断是新建ip还是新建ip分组 - run keyword if "${Add}"=="Address" run keywords sleep 1 + run keyword if "${Add}"=="Address" run keywords sleep ${sleep} ... AND click element xpath=/html/body/ul[contains(@id,'dropdown-menu' )and @x-placement='bottom-start']/child::li[1] - ... AND sleep 1 + ... AND sleep ${sleep} ... AND DestinationIPAddress ${policytype} ${name} ${ip_type} ${ipclienttext1} ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits} - ... ELSE IF "${Add}"=="Group" run keywords sleep 1 + ... ELSE IF "${Add}"=="Group" run keywords sleep ${sleep} ... AND click element xpath=/html/body/ul[contains(@id,'dropdown-menu' )and @x-placement='bottom-start']/child::li[2] - ... AND sleep 1 + ... AND sleep ${sleep} ... AND DestinationIPGroupAdd ${policytype} ${name} ${ip_type} ${object_name} DestinationIPAddress [Arguments] ${policytype} ${name} ${ip_type} ${ipclienttext1} ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits} @@ -303,48 +303,48 @@ DestinationIPAddress ... ${limits}:填入数值,例如1或10000 ... 判断 新建选择用什么样的类型,并进行新建 DestinationCreate-name ${policytype} ${name} - sleep 1 + sleep ${sleep} run keyword if "${ip_type}"=="Ip" run keywords click element xpath=${policytype}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[4]/div/div[1] - ... AND sleep 1 + ... AND sleep ${sleep} ... AND NewObject.Create-ip-ClientIP-text ${ipclienttext1} ${post} run keyword if "${ip_type}"=="Geography" run keywords click element xpath=${policytype}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[3]/div/div/label[2] - ... AND sleep 1 + ... AND sleep ${sleep} ... AND click element xpath=${policytype}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[4]/div/div[1]/div[2] - ... AND sleep 1 + ... AND sleep ${sleep} ... AND NewObject.Create-Geography ${Country} ${City} - ... AND sleep 1 + ... AND sleep ${sleep} ... AND click element id=interceptionadd_allcancelobjec3t - ... AND sleep 1 + ... AND sleep ${sleep} run keyword if "${ip_type}"=="IPLearning" run keywords click element xpath=${policytype}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[3]/div/div/label[3] - ... AND sleep 1 + ... AND sleep ${sleep} ... AND click element xpath=${policytype}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[4]/div/div[1] - ... AND sleep 1 + ... AND sleep ${sleep} ... AND input text xpath=${policytype}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[4]/div/div[3]/div/div[1]/div[2]/div[1]/div[1]/form/div[1]/div/div[1]/input ${fqdn} - ... AND sleep 1 + ... AND sleep ${sleep} ... AND click element xpath=${policytype}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[5]/div[1]/div/div/div[2] - ... AND sleep 1 + ... AND sleep ${sleep} ... AND Learn-From-Protocols ${Protocols1} ... AND Learning-Depth ${policytype} ${Degree} - ... AND sleep 1 + ... AND sleep ${sleep} ... AND input text xpath=${policytype}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[5]/div[3]/div/div[1]/input ${times} - ... AND sleep 1 + ... AND sleep ${sleep} ... AND input text xpath=${policytype}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[5]/div[4]/div/div[1]/input ${numbers} - ... AND sleep 1 + ... AND sleep ${sleep} ... AND input text xpath=${policytype}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[5]/div[5]/div/div[1]/input ${limits} - ... AND sleep 1 + ... AND sleep ${sleep} DestinationCreate-ok ${policytype} Learn-From-Protocols [Arguments] ${Protocols1} [Documentation] 调用次关键字前需要添加必填参数: ... ${Protocols1}:填入HTTP或SSL或者HTTPSSL ... 判断选择用什么样的协议 - run keyword if "${Protocols1}"=="HTTP" run keywords sleep 1 + run keyword if "${Protocols1}"=="HTTP" run keywords sleep ${sleep} ... AND click element xpath=/html/body/div/div[1]/div[1]/ul/li[1] - run keyword if "${Protocols1}"=="SSL" run keywords sleep 1 + run keyword if "${Protocols1}"=="SSL" run keywords sleep ${sleep} ... AND click element xpath=/html/body/div/div[1]/div[1]/ul/li[2] - run keyword if "${Protocols1}"=="HTTPSSL" run keywords sleep 1 + run keyword if "${Protocols1}"=="HTTPSSL" run keywords sleep ${sleep} ... AND click element xpath=/html/body/div/div[1]/div[1]/ul/li[1] - ... AND sleep 1 + ... AND sleep ${sleep} ... AND click element xpath=/html/body/div/div[1]/div[1]/ul/li[2] Learning-Depth @@ -352,9 +352,9 @@ Learning-Depth [Documentation] 调用次关键字前需要添加必填参数: ... ${Degree}:填入1Degree或2Degree ... 判断是用1Degree或2Degree - run keyword if "${Degree}"=="1Degree" run keywords sleep 1 + run keyword if "${Degree}"=="1Degree" run keywords sleep ${sleep} ... AND click element xpath=${policytype}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[5]/div[2]/div/div/label[1] - run keyword if "${Degree}"=="2Degree" run keywords sleep 1 + run keyword if "${Degree}"=="2Degree" run keywords sleep ${sleep} ... AND click element xpath=${policytype}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[5]/div[2]/div/div/label[2] SourceIPGroupAdd @@ -365,7 +365,7 @@ SourceIPGroupAdd ... ${object_name}:列表形式,列表中是对象的名字 SourceCreate-name ${name} Select-ip_type ${ip_type} - sleep 1 + sleep ${sleep} click element xpath=${policytype}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[4]/div/div/div[2] Create-Sub-Objects ${object_name} NewObject.Create-ok @@ -377,18 +377,18 @@ DestinationIPGroupAdd ... ${object_name}:列表形式,列表中是对象的名字 SourceCreate-name ${name} Select-ip_type ${ip_type} - sleep 1 + sleep ${sleep} click element xpath=${policytype}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[4]/div/div/div[2] Create-Sub-Objects ${object_name} NewObject.Create-ok SourceCreate-name [Arguments] ${objName} - sleep 2 + sleep ${sleep} input text id=objectAdd_name ${objName} SourceCreate-ok - sleep 2 + sleep ${sleep} click button id=objectAdd_ok DestinationCreate-name @@ -397,5 +397,5 @@ DestinationCreate-name DestinationCreate-ok [Arguments] ${policytype} - sleep 2 + sleep ${sleep} click button xpath=${policytype}/div[2]/div[2]/div/div[2]/button[1] diff --git a/02-Keyword/tsg_ui/proxyPolicy/ProxyPolicy.robot b/02-Keyword/tsg_ui/proxyPolicy/ProxyPolicy.robot index c88a9cf..20aa325 100644 --- a/02-Keyword/tsg_ui/proxyPolicy/ProxyPolicy.robot +++ b/02-Keyword/tsg_ui/proxyPolicy/ProxyPolicy.robot @@ -6,13 +6,13 @@ Resource ../objects/NewObject.robot CreateButton [Documentation] 点击安全策略中的Create按钮 Wait Until Element Is Enabled id=app_create - sleep 3 + sleep ${sleep} click element id=app_create Create-name [Arguments] ${name} [Documentation] 输入name - sleep 2 + sleep ${sleep} input text id=manipulation_elInput_policyName ${name} Create-action @@ -20,31 +20,31 @@ Create-action [Documentation] 调用次关键字前需要添加必填参数: ... ${action}:填入allow或deny或monitor或intercept ... 判断要创建什么动作的策略 - sleep 1 - run keyword if "${action}"=="allow" run keywords sleep 1 + sleep ${sleep} + run keyword if "${action}"=="allow" run keywords sleep ${sleep} ... AND click element id=proxyManipulationallow - ... ELSE IF "${action}"=="deny" run keywords sleep 1 + ... ELSE IF "${action}"=="deny" run keywords sleep ${sleep} ... AND click element id=proxyManipulationdeny - ... ELSE IF "${action}"=="monitor" run keywords sleep 1 + ... ELSE IF "${action}"=="monitor" run keywords sleep ${sleep} ... AND click element id=proxyManipulationmonitor - ... ELSE IF "${action}"=="redirect" run keywords sleep 1 + ... ELSE IF "${action}"=="redirect" run keywords sleep ${sleep} ... AND click element id=proxyManipulationredirect - ... ELSE IF "${action}"=="replace" run keywords sleep 1 + ... ELSE IF "${action}"=="replace" run keywords sleep ${sleep} ... AND click element id=proxyManipulationreplace - ... ELSE IF "${action}"=="hijack" run keywords sleep 1 + ... ELSE IF "${action}"=="hijack" run keywords sleep ${sleep} ... AND click element id=proxyManipulationhijack - ... ELSE IF "${action}"=="insert" run keywords sleep 1 + ... ELSE IF "${action}"=="insert" run keywords sleep ${sleep} ... AND click element id=proxyManipulationinsert Create-Source-Button [Documentation] 点击Source的加号 - sleep 2 + sleep ${sleep} click element xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[4]/div[1]/div/div Create-Destination-Button [Documentation] 点击Destination的加号 Wait Until Element Is Enabled xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[5]/div[1]/div/div 10 - sleep 2 + sleep ${sleep} click element xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[5]/div[1]/div/div @@ -53,9 +53,9 @@ ApplicationSearch [Documentation] 调用次关键字前需要添加必填参数: ... ${Application}:填入是Application的内容,例如SSL或HTTP ... 选择search对象 - run keyword if "${Application}"=="redirect" run keywords sleep 1 + run keyword if "${Application}"=="redirect" run keywords sleep ${sleep} ... AND click element id=interceptionadd_application - ... AND sleep 1 + ... AND sleep ${sleep} ... AND HttpOrDoh ${HttpOrDoh} ... ELSE log 不操作 HttpOrDoh @@ -63,13 +63,13 @@ HttpOrDoh [Documentation] 调用次关键字前需要添加必填参数: ... ${HttpOrDoh}:填入是Application的内容,例如SSL或HTTP ... 选择search对象 - run keyword if "${HttpOrDoh}"=="HTTP" run keywords sleep 1 + run keyword if "${HttpOrDoh}"=="HTTP" run keywords sleep ${sleep} ... AND click element id=interceptionadd_checkappshow1 - ... AND sleep 1 + ... AND sleep ${sleep} ... AND click element xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[7]/div[3]/div/button - ... ELSE IF "${HttpOrDoh}"=="Doh" run keywords sleep 1 + ... ELSE IF "${HttpOrDoh}"=="Doh" run keywords sleep ${sleep} ... AND click element id=interceptionadd_checkappshow0 - ... AND sleep 1 + ... AND sleep ${sleep} ... AND click element xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[7]/div[3]/div/button @@ -81,33 +81,33 @@ Create-Filter ... ${Filter}:是一个列表,列表中填入filter类型,例如Host或URL等 ... name:各个对象名称的列表 ... 判断添加filter类型 xpath=//*[@id="policy_paper_left"]/div[8]/div/div[1]/label[contains(text(), "${filter}")]/following-sibling::div/div //*[@id="interceptionadd_checkappshow0"][contains(text(), "${filter}")] - sleep 2 + sleep ${sleep} FOR ${i} IN @{Filter} - sleep 1 + sleep ${sleep} click element id=interceptionadd_add_filter - sleep 1 - run keyword if "${Application}"=="HTTP" and "${i}"=="Host" run keywords sleep 1 + sleep ${sleep} + run keyword if "${Application}"=="HTTP" and "${i}"=="Host" run keywords sleep ${sleep} ... AND click element xpath=//*[@id="interceptionadd_checkappshow0"][contains(text(), "${i}")] ... AND Create-Object-Search ${Hostname} ${i} - run keyword if "${Application}"=="HTTP" and "${i}"=="URL" run keywords sleep 1 + run keyword if "${Application}"=="HTTP" and "${i}"=="URL" run keywords sleep ${sleep} ... AND click element xpath=//*[@id="interceptionadd_checkappshow1"][contains(text(), "${i}")] ... AND Create-Object-Search ${URLname} ${i} - run keyword if "${Application}"=="HTTP" and "${i}"=="Request Header" run keywords sleep 1 + run keyword if "${Application}"=="HTTP" and "${i}"=="Request Header" run keywords sleep ${sleep} ... AND click element xpath=//*[@id="interceptionadd_checkappshow2"][contains(text(), "${i}")] ... AND Create-Object-Search ${Request Headername} ${i} - run keyword if "${Application}"=="HTTP" and "${i}"=="Response Header" run keywords sleep 1 + run keyword if "${Application}"=="HTTP" and "${i}"=="Response Header" run keywords sleep ${sleep} ... AND click element xpath=//*[@id="interceptionadd_checkappshow3"][contains(text(), "${i}")] ... AND Create-Object-Search ${Response Headername} ${i} - run keyword if "${Application}"=="HTTP" and "${i}"=="Request Content" run keywords sleep 1 + run keyword if "${Application}"=="HTTP" and "${i}"=="Request Content" run keywords sleep ${sleep} ... AND click element xpath=//*[@id="interceptionadd_checkappshow4"][contains(text(), "${i}")] ... AND Create-Object-Search ${Request Contentname} ${i} - run keyword if "${Application}"=="HTTP" and "${i}"=="Response Content" run keywords sleep 1 + run keyword if "${Application}"=="HTTP" and "${i}"=="Response Content" run keywords sleep ${sleep} ... AND click element xpath=//*[@id="interceptionadd_checkappshow5"][contains(text(), "${i}")] ... AND Create-Object-Search ${Response Contentname} ${i} - run keyword if "${Application}"=="Doh" and "${i}"=="Host" run keywords sleep 1 + run keyword if "${Application}"=="Doh" and "${i}"=="Host" run keywords sleep ${sleep} ... AND click element xpath=//*[@id="interceptionadd_checkappshow0"][contains(text(), "${i}")] ... AND Create-Object-Search ${DohHostname} ${i} - run keyword if "${Application}"=="Doh" and "${i}"=="QNAME" run keywords sleep 1 + run keyword if "${Application}"=="Doh" and "${i}"=="QNAME" run keywords sleep ${sleep} ... AND click element xpath=//*[@id="interceptionadd_checkappshow1"][contains(text(), "${i}")] ... AND Create-Object-Search ${QNAMEname} ${i} END @@ -117,21 +117,21 @@ Deny-subaction ... ${denycode}:填入403或404或451 ... ${action}:填入deny ... 添加subaction - run keyword if "${action}"=="deny" and "${denycode}"=="403" run keywords sleep 1 + run keyword if "${action}"=="deny" and "${denycode}"=="403" run keywords sleep ${sleep} ... AND click element id=manipulation_select_addAction - ... AND sleep 1 + ... AND sleep ${sleep} ... AND click element //span[.="${denycode}"] - ... AND sleep 1 - run keyword if "${action}"=="deny" and "${denycode}"=="404" run keywords sleep 1 + ... AND sleep ${sleep} + run keyword if "${action}"=="deny" and "${denycode}"=="404" run keywords sleep ${sleep} ... AND click element id=manipulation_select_addAction - ... AND sleep 1 + ... AND sleep ${sleep} ... AND click element //span[.="${denycode}"] - ... AND sleep 1 - run keyword if "${action}"=="deny" and "${denycode}"=="451" run keywords sleep 1 + ... AND sleep ${sleep} + run keyword if "${action}"=="deny" and "${denycode}"=="451" run keywords sleep ${sleep} ... AND click element id=manipulation_select_addAction - ... AND sleep 1 + ... AND sleep ${sleep} ... AND click element //span[.="${denycode}"] - ... AND sleep 1 + ... AND sleep ${sleep} ... AND Deny-content [Arguments] ${contenttype}=File ${SearchorCreate}=null ${ProfileName}=null ${file}=null ${textvalue}=null @@ -144,22 +144,22 @@ Deny-content ... ${file}:上传文件路径 ... ${textvalue}:填入text输入框内容 ... 添加block数据内容 - sleep 1 - run keyword if "${contenttype}"=="File" run keywords sleep 1 + sleep ${sleep} + run keyword if "${contenttype}"=="File" run keywords sleep ${sleep} ... AND click element id=manipulation_select_blockInfo - ... AND sleep 1 + ... AND sleep ${sleep} ... AND click element id=ResponseContentFile - ... AND sleep 1 + ... AND sleep ${sleep} ... AND click element id=manipulation_select_htmlProfile - ... AND sleep 1 + ... AND sleep ${sleep} ... AND Profile-SearchorCreate ${SearchorCreate} ${ProfileName} ${file} - run keyword if "${contenttype}"=="Text" run keywords sleep 1 + run keyword if "${contenttype}"=="Text" run keywords sleep ${sleep} ... AND click element id=manipulation_select_blockInfo - ... AND sleep 1 + ... AND sleep ${sleep} ... AND click ellement id=ResponseContentText ... AND sllep 1 ... AND input text id=manipulation_elInput_blockselect ${textvalue} - ... AND sleep 1 + ... AND sleep ${sleep} Profile-SearchorCreate [Arguments] ${SearchorCreate} ${ProfileName} ${file} [Documentation] 调用次关键字前需要添加必填参数: @@ -167,23 +167,23 @@ Profile-SearchorCreate ... ${ProfileName}:Profile的名字 ... ${file}:上传文件路径 ... 判断是新建还是搜索profile - sleep 1 - run keyword if "${SearchorCreate}"=="Search" run keywords sleep 1 + sleep ${sleep} + run keyword if "${SearchorCreate}"=="Search" run keywords sleep ${sleep} ... AND input text xapth=/html/body/div/div[1]/div[1]/ul/div[1]/div/input ${ProfileName} - ... AND sleep 1 + ... AND sleep ${sleep} ... AND press keys xapth=/html/body/div/div[1]/div[1]/ul/div[1]/div/input ENTER - ... AND sleep 1 + ... AND sleep ${sleep} ... AND click element xpath=/html/body/div/div[1]/div[1]/ul/div[2]/div/li[1] - ... AND sleep 1 - ... ELSE IF "${SearchorCreate}"=="Create" run keywords sleep 1 + ... AND sleep ${sleep} + ... ELSE IF "${SearchorCreate}"=="Create" run keywords sleep ${sleep} ... AND click element xpath=/html/body/div/div[1]/div[1]/ul/div[1]/div/div/button - ... AND sleep 1 + ... AND sleep ${sleep} ... AND input text id=responsepages_profileName ${ProfileName} - ... AND sleep 1 + ... AND sleep ${sleep} ... AND Choose File xpath=//*[@id="policy_Manipulation_create6"]/div[2]/form/div[2]/div/div/div/input ${file} #上传文件 - ... AND sleep 1 + ... AND sleep ${sleep} ... AND click element id=responseAddOk1 - ... AND sleep 1 + ... AND sleep ${sleep} ... ELSE log 传入参数错误 Deny-Redirect [Arguments] ${QType} ${Avalue} ${Attl} ${CNAMEvalue} ${CNAMEttl} @@ -194,31 +194,31 @@ Deny-Redirect ... ${CNAMEvalue}:根据${QType}填入A的CNAME的域名值或AAAA的CNAME域名值 ... ${CNAMEttl}:根据${QType}填入A的CNAME的ttl值或AAAA的CNAME的ttl值 ... 新建Redirect - sleep 1 + sleep ${sleep} click element id=interceptionadd_add_filter - sleep 1 - run keyword if "${QType}"=="A" run keywords sleep 1 + sleep ${sleep} + run keyword if "${QType}"=="A" run keywords sleep ${sleep} ... AND input text id=A00 ${Avalue} - ... AND sleep 1 + ... AND sleep ${sleep} ... AND input text id=ttl00 ${Attl} - ... AND sleep 1 + ... AND sleep ${sleep} ... AND click element id=interceptionadd_addForm - ... AND sleep 1 + ... AND sleep ${sleep} ... AND input text id=Cname01 ${CNAMEvalue} - ... AND sleep 1 + ... AND sleep ${sleep} ... AND input text id=ttl01 ${CNAMEttl} - run keyword if "${QType}"=="AAAA" run keywords sleep 1 + run keyword if "${QType}"=="AAAA" run keywords sleep ${sleep} ... AND click element id=dns_qtype_radio01 ... AND input text id=AAAA00 ${Avalue} - ... AND sleep 1 + ... AND sleep ${sleep} ... AND input text id=ttl00 ${Attl} - ... AND sleep 1 + ... AND sleep ${sleep} ... AND click element id=interceptionadd_addForm - ... AND sleep 1 + ... AND sleep ${sleep} ... AND input text id=Cname01 ${CNAMEvalue} - ... AND sleep 1 + ... AND sleep ${sleep} ... AND input text id=ttl01 ${CNAMEttl} - sleep 1 + sleep ${sleep} click element id=interceptionadd_shezhidns Replace-Action-Parameters-for1 @@ -234,12 +234,12 @@ Replace-Action-Parameters-for1 FOR ${i} IN RANGE 1 ${len1} Replace-Action-Parameters-for1 ${ParametersType} ${i} ${RequestURIFind} ${RequestURIReplacewith} ${RequestBodyFind} ${RequestBodyReplacewith} ${ResponseBodyFind} ... ${ResponseBodyReplacewith} ${RequestHeaderFind} ${RequestHeaderReplacewith} ${ResponseHeaderFind} ${ResponseHeaderReplacewith} - sleep 1 - run keyword if "${len}"!="1" run keywords sleep 1 + sleep ${sleep} + run keyword if "${len}"!="1" run keywords sleep ${sleep} ... AND clcik element id=replaceadd_btn - ... AND sleep 1 + ... AND sleep ${sleep} END - sleep 1 + sleep ${sleep} Replace-Action-Parameters-for2 [Arguments] ${ParametersType} ${i} ${RequestURIFind} ${RequestURIReplacewith} ${RequestBodyFind} ${RequestBodyReplacewith} ${ResponseBodyFind} @@ -250,41 +250,41 @@ Replace-Action-Parameters-for2 ... ${xxxFind}:是Find输入框输入的值 ... ${XXXReplacewith} :是 Replacewith输入框中输入的值 FOR ${j} IN @{ParametersType} - run keyword if "${j}"=="RequestURI" run keywords sleep 1 + run keyword if "${j}"=="RequestURI" run keywords sleep ${sleep} ... AND click element xpath=//*[@id="policy_paper_left"]/div[12]/div/div/form/div[3]/ul/li[${i}]/div[1]/div/div/div[1]/input - ... AND sleep 1 + ... AND sleep ${sleep} ... AND input text xpath=//*[@id="policy_paper_left"]/div[12]/div/div/form/div[3]/ul/li[${i}]/div[2]/div/div/input ${RequestURIFind} - ... AND sleep 1 + ... AND sleep ${sleep} ... AND input text xpath=//*[@id="policy_paper_left"]/div[12]/div/div/form/div[3]/ul/li[${i}]/div[3]/div/div/input ${RequestURIReplacewith} - ... AND sleep 1 - run keyword if "${j}"=="RequestBody" run keywords sleep 1 + ... AND sleep ${sleep} + run keyword if "${j}"=="RequestBody" run keywords sleep ${sleep} ... AND click element xpath=//*[@id="policy_paper_left"]/div[12]/div/div/form/div[3]/ul/li[${i}]/div[1]/div/div/div[1]/input - ... AND sleep 1 + ... AND sleep ${sleep} ... AND input text xpath=//*[@id="policy_paper_left"]/div[12]/div/div/form/div[3]/ul/li[${i}]/div[2]/div/div/input ${RequestBodyFind} - ... AND sleep 1 + ... AND sleep ${sleep} ... AND input text xpath=//*[@id="policy_paper_left"]/div[12]/div/div/form/div[3]/ul/li[${i}]/div[3]/div/div/input ${RequestBodyReplacewith} - ... AND sleep 1 - run keyword if "${j}"=="ResponseBody" run keywords sleep 1 + ... AND sleep ${sleep} + run keyword if "${j}"=="ResponseBody" run keywords sleep ${sleep} ... AND click element xpath=//*[@id="policy_paper_left"]/div[12]/div/div/form/div[3]/ul/li[${i}]/div[1]/div/div/div[1]/input - ... AND sleep 1 + ... AND sleep ${sleep} ... AND input text xpath=//*[@id="policy_paper_left"]/div[12]/div/div/form/div[3]/ul/li[${i}]/div[2]/div/div/input ${ResponseBodyFind} - ... AND sleep 1 + ... AND sleep ${sleep} ... AND input text xpath=//*[@id="policy_paper_left"]/div[12]/div/div/form/div[3]/ul/li[${i}]/div[3]/div/div/input ${ResponseBodyReplacewith} - ... AND sleep 1 - run keyword if "${j}"=="RequestHeader" run keywords sleep 1 + ... AND sleep ${sleep} + run keyword if "${j}"=="RequestHeader" run keywords sleep ${sleep} ... AND click element xpath=//*[@id="policy_paper_left"]/div[12]/div/div/form/div[3]/ul/li[${i}]/div[1]/div/div/div[1]/input - ... AND sleep 1 + ... AND sleep ${sleep} ... AND input text xpath=//*[@id="policy_paper_left"]/div[12]/div/div/form/div[3]/ul/li[${i}]/div[2]/div/div/input ${RequestHeaderFind} - ... AND sleep 1 + ... AND sleep ${sleep} ... AND input text xpath=//*[@id="policy_paper_left"]/div[12]/div/div/form/div[3]/ul/li[${i}]/div[3]/div/div/input ${RequestHeaderReplacewith} - ... AND sleep 1 - run keyword if "${j}"=="ResponseHeader" run keywords sleep 1 + ... AND sleep ${sleep} + run keyword if "${j}"=="ResponseHeader" run keywords sleep ${sleep} ... AND click element xpath=//*[@id="policy_paper_left"]/div[12]/div/div/form/div[3]/ul/li[${i}]/div[1]/div/div/div[1]/input - ... AND sleep 1 + ... AND sleep ${sleep} ... AND input text xpath=//*[@id="policy_paper_left"]/div[12]/div/div/form/div[3]/ul/li[${i}]/div[2]/div/div/input ${ResponseHeaderFind} - ... AND sleep 1 + ... AND sleep ${sleep} ... AND input text xpath=//*[@id="policy_paper_left"]/div[12]/div/div/form/div[3]/ul/li[${i}]/div[3]/div/div/input ${ResponseHeaderReplacewith} - ... AND sleep 1 + ... AND sleep ${sleep} END HijackFile-SearchorCreate @@ -297,19 +297,19 @@ HijackFile-SearchorCreate ... ${input};填入shuru或其他 ... ${Hijacktype}:填入选择文件类型的元素 ... 判断是新建还是搜索HijackFile - sleep 1 + sleep ${sleep} click element xpath=//*[@id="policy_paper_left"]/div[12]/div/div/form/div[4]/div/div/div/div - sleep 1 - run keyword if "${SearchorCreate}"=="Search" run keywords sleep 1 + sleep ${sleep} + run keyword if "${SearchorCreate}"=="Search" run keywords sleep ${sleep} ... AND input text xapth=/html/body/div/div[1]/div[1]/ul/div[1]/div/input ${Hijackname} - ... AND sleep 1 + ... AND sleep ${sleep} ... AND press keys xapth=/html/body/div/div[1]/div[1]/ul/div[1]/div/input ENTER - ... AND sleep 1 + ... AND sleep ${sleep} ... AND click element xpath=/html/body/div/div[1]/div[1]/ul/div[2]/div/li[1] - ... AND sleep 1 - ... ELSE IF "${SearchorCreate}"=="Create" run keywords sleep 1 + ... AND sleep ${sleep} + ... ELSE IF "${SearchorCreate}"=="Create" run keywords sleep ${sleep} ... AND click element xpath=/html/body/div/div[1]/div[1]/ul/div[1]/div/div/button - ... AND sleep 1 + ... AND sleep ${sleep} ... AND HijackFile-Create ${Hijackname} ${Hijackfile} ${dow_name} ${input} ${Hijackname} ${Hijacktype} ... ELSE log 传入参数错误 @@ -322,19 +322,19 @@ HijackFile-Create ... ${input};填入shuru或其他 ... ${Hijacktype}:填入选择文件类型的元素 ... 新建hijack - Sleep 2 + sleep ${sleep} input id=hijack_profileName ${Hijackname} #输入name - Sleep 2 + sleep ${sleep} Choose File xpath=//*[@id="proxy"]/div[11]/div/div[1]/div[2]/form/div[2]/div/div/div[1]/input ${Hijackfile} #上传文件 - Sleep 2 - run keyword if "${dow_name}"=="close" and "${input}"=="shuru" run keywords sleep 1 + sleep ${sleep} + run keyword if "${dow_name}"=="close" and "${input}"=="shuru" run keywords sleep ${sleep} ... AND input text id=hijack_contentName ${Hijackname} ... ELSE IF "${dow_name}"=="open" click element xpath=//*[@id="contentNameChoose"]/div[1]/span[2] - sleep 1 + sleep ${sleep} click element id=hijackAddContentType #点击+ 打开侧滑窗口 - Sleep 1 + sleep ${sleep} click element ${Hijacktype} #选择文件类型 - sleep 2 + sleep ${sleep} click element id=hijackAddOk1 #点击OK InsertScript-SearchorCreate @@ -346,19 +346,19 @@ InsertScript-SearchorCreate ... ${Inserttype}:根据情况填入css或js ... ${Insertjstype};填入Before Page Load或After Page Load ... 判断是新建还是搜索insert - sleep 1 + sleep ${sleep} click element id=manipulation_select_insetScript - sleep 1 - run keyword if "${SearchorCreate}"=="Search" run keywords sleep 1 + sleep ${sleep} + run keyword if "${SearchorCreate}"=="Search" run keywords sleep ${sleep} ... AND input text xapth=/html/body/div/div[1]/div[1]/ul/div[1]/div/input ${Hijackname} - ... AND sleep 1 + ... AND sleep ${sleep} ... AND press keys xapth=/html/body/div/div[1]/div[1]/ul/div[1]/div/input ENTER - ... AND sleep 1 + ... AND sleep ${sleep} ... AND click element xpath=/html/body/div/div[1]/div[1]/ul/div[2]/div/li[1] - ... AND sleep 1 - ... ELSE IF "${SearchorCreate}"=="Create" run keywords sleep 1 + ... AND sleep ${sleep} + ... ELSE IF "${SearchorCreate}"=="Create" run keywords sleep ${sleep} ... AND click element xpath=/html/body/div/div[1]/div[1]/ul/div[1]/div/div/button - ... AND sleep 1 + ... AND sleep ${sleep} ... AND InsertScript-Create ${Insertname} ${Insertfile} ${Inserttype} ${Insertjstype} ... ELSE log 传入参数错误 @@ -370,22 +370,22 @@ InsertScript-Create ... ${Inserttype}:根据情况填入css或js ... ${Insertjstype};填入Before Page Load或After Page Load ... 新建insert - Sleep 2 + sleep ${sleep} input id=insert_profileName ${Insertname} #输入name - Sleep 2 + sleep ${sleep} Choose File xpath=//*[@id="insertAddUpload"]/div[1]/input ${Insertfile} #上传文件 - Sleep 2 + sleep ${sleep} clcik element id=insert_select_format - sleep 1 - run keyword if "${Inserttype}"=="css" run keywords sleep 1 + sleep ${sleep} + run keyword if "${Inserttype}"=="css" run keywords sleep ${sleep} ... AND click element //span[.="${Inserttype}"] #选择css - run keyword if "${Inserttype}"=="js" run keywords sleep 1 + run keyword if "${Inserttype}"=="js" run keywords sleep ${sleep} ... AND click element //span[.="${Inserttype}"] - ... AND sleep 1 + ... AND sleep ${sleep} ... AND click element id=insert_select_insertOn #点击下拉框 - ... AND sleep 1 + ... AND sleep ${sleep} ... AND click element //span[.="${Insertjstype}"] - sleep 2 + sleep ${sleep} click element id=insertAddOk1 #点击OK @@ -395,7 +395,7 @@ LogSession [Arguments] ${LogSession} [Documentation] 调用次关键字前需要添加必填参数: ... ${LogSession}:填入clcos或其他 - run keyword if "${LogSession}"=="close" run keywords sleep 1 + run keyword if "${LogSession}"=="close" run keywords sleep ${sleep} ... AND click element id=manipulationSwitch0 ... ELSE log 开启日志 @@ -403,101 +403,101 @@ LogOptions [Arguments] ${LogOptions} [Documentation] 调用次关键字前需要添加必填参数: ... ${LogOptions}:填入All或其他 - run keyword if "${LogOptions}"=="All" run keywords sleep 1 + run keyword if "${LogOptions}"=="All" run keywords sleep ${sleep} ... AND click element id=logType1 ... ELSE log 选择Metadata only Enabled [Arguments] ${Enabled} [Documentation] 调用次关键字前需要添加必填参数: ... ${Enabled}:填入open或其他 - run keyword if "${Enabled}"=="open" run keywords sleep 1 + run keyword if "${Enabled}"=="open" run keywords sleep ${sleep} ... AND click element xpath=//*[@id="proxyManipulationUse"]/label[contains(text(), "Enabled")]/following-sibling::div/div - ... AND sleep 2 + ... AND sleep ${sleep} ... AND click element xpath=/html/body/div/div/div[3]/button[2] ... ELSE log 开启日志 Proxy-Policies-OK - sleep 1 + sleep ${sleep} click element id=proxyManipulationSuccess - sleep 1 + sleep ${sleep} Create-Object-Search [Arguments] ${name} ${filter} [Documentation] 调用次关键字前需要添加必填参数: ... ${name}:填入是一个列表,列表内容为object的name ... 选择search对象 - sleep 1 + sleep ${sleep} click element xpath=//*[@id="policy_paper_left"]/div[9]/div/div[1]/label[contains(text(), "${filter}")]/following-sibling::div/div - sleep 1 + 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 1 + sleep ${sleep} press keys xpath=//*[@id="condistions_protocol"]/div[2]/p[contains(text(), "${filter}")]/following-sibling::div[2]/div/div[1]/input ENTER - sleep 1 + 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 1 + sleep ${sleep} END Proxy-Source [Arguments] ${SourceType} ${SourceValue} Wait Until Element Is Enabled xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[1]/span/div/div/div[2]/div/div 10 - sleep 3 + sleep ${sleep} click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[1]/span/div/div/div[2]/div/div - sleep 1 - run keyword if "${SourceType}"=="ID" run keywords sleep 1 + sleep ${sleep} + run keyword if "${SourceType}"=="ID" run keywords sleep ${sleep} ... AND click element xpath=/html/body/div/div[1]/div[1]/ul/li[2] - run keyword if "${SourceType}"=="Name" run keywords sleep 1 + run keyword if "${SourceType}"=="Name" run keywords sleep ${sleep} ... AND click element xpath=/html/body/div/div[1]/div[1]/ul/li[3] - run keyword if "${SourceType}"=="Action" run keywords sleep 1 + run keyword if "${SourceType}"=="Action" run keywords sleep ${sleep} ... AND click element xpath=/html/body/div/div[1]/div[1]/ul/li[4] - sleep 1 + 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 ${SourceValue} - sleep 1 + sleep ${sleep} click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[1]/span/div/i - sleep 1 + sleep ${sleep} click element xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1] - sleep 1 + sleep ${sleep} EditButton - sleep 1 + sleep ${sleep} click element xpath=//*[@id="appEdit"]/span/div/div[2] - sleep 1 + sleep ${sleep} Initialize-Policie [Arguments] ${InitializeAction} [Documentation] 调用次关键字前需要添加必填参数: ... ${InitializeAction}:根据用例进行填写,意思就是是那一个action就不要点击哪一个,以免初始化失败 - run keyword if "${InitializeAction}"=="Allow" run keywords sleep 1 + run keyword if "${InitializeAction}"=="Allow" run keywords sleep ${sleep} ... AND click element id=proxyManipulationdeny - ... AND sleep 1 - ... ELSE IF "${InitializeAction}"=="Deny" run keywords sleep 1 + ... AND sleep ${sleep} + ... ELSE IF "${InitializeAction}"=="Deny" run keywords sleep ${sleep} ... AND click element id=proxyManipulationallow - ... ELSE IF "${InitializeAction}"=="Monitor" run keywords sleep 1 + ... ELSE IF "${InitializeAction}"=="Monitor" run keywords sleep ${sleep} ... AND click element id=proxyManipulationdeny - ... ELSE IF "${InitializeAction}"=="Redirect" run keywords sleep 1 + ... ELSE IF "${InitializeAction}"=="Redirect" run keywords sleep ${sleep} ... AND click element id=proxyManipulationdeny - ... ELSE IF "${InitializeAction}"=="Replace" run keywords sleep 1 + ... ELSE IF "${InitializeAction}"=="Replace" run keywords sleep ${sleep} ... AND click element id=proxyManipulationdeny - ... ELSE IF "${InitializeAction}"=="Hijack" run keywords sleep 1 + ... ELSE IF "${InitializeAction}"=="Hijack" run keywords sleep ${sleep} ... AND click element id=proxyManipulationdeny - ... ELSE IF "${InitializeAction}"=="Insert" run keywords sleep 1 + ... ELSE IF "${InitializeAction}"=="Insert" run keywords sleep ${sleep} ... AND click element id=proxyManipulationdeny ... ELSE log 不修改 - sleep 1 + sleep ${sleep} ${status} Run Keyword And Return Status Page should contain element xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form[1]/div/div[4]/div[1]/div/div/div #判断页面是否包含该元素 run keyword if "${status}"=="False" log go on - run keyword if "${status}"=="True" run keywords sleep 1 + run keyword if "${status}"=="True" run keywords sleep ${sleep} ... AND click element xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form[1]/div/div[4]/div[1]/div/div/div/p/span/span/i[2] - ... AND sleep 1 + ... AND sleep ${sleep} ${status1} Run Keyword And Return Status Page should contain element xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form[1]/div/div[5]/div[1]/div/div/div #判断页面是否包含该元素 run keyword if "${status1}"=="False" log go on - run keyword if "${status1}"=="True" run keywords sleep 1 + run keyword if "${status1}"=="True" run keywords sleep ${sleep} ... AND click element xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form[1]/div/div[5]/div[1]/div/div/div/p/span/span/i[2] - ... AND sleep 1 + ... AND sleep ${sleep} Delete-Proxy-estimate [Arguments] ${securityname} - run keyword if "${securityname}"!="null" run keywords sleep 1 + run keyword if "${securityname}"!="null" run keywords sleep ${sleep} ... AND Delete-Proxy ${securityname} ... ELSE log go on @@ -505,27 +505,27 @@ Delete-Proxy [Arguments] ${securityname} Menu policys Proxy Policy - sleep 2 + sleep ${sleep} Wait Until Element Is Enabled xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[1]/span/div/div/div[2]/div/div 10 click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[1]/span/div/div/div[2]/div/div - sleep 1 + sleep ${sleep} click element xpath=/html/body/div/div[1]/div[1]/ul/li[3] - sleep 1 + 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 ${securityname} - sleep 1 + sleep ${sleep} click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[1]/span/div/i - sleep 1 + sleep ${sleep} Run Keyword And Ignore Error click element xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1] - sleep 2 - sleep 1 + sleep ${sleep} + sleep ${sleep} Run Keyword And Ignore Error click element id=appDel - sleep 1 + sleep ${sleep} Run Keyword And Ignore Error click element xpath=/html/body/div/div/div[3]/button[2] - sleep 1 + sleep ${sleep} Delete-object-estimate [Arguments] ${obj} - run keyword if "${obj}"!="null" run keywords sleep 1 + run keyword if "${obj}"!="null" run keywords sleep ${sleep} ... AND Delete-object ${obj} ... ELSE log go on Delete-object @@ -539,20 +539,20 @@ Forname [Arguments] ${objectname} ${key} FOR ${i} IN @{objectname} Menu objects ${key} - sleep 2 + 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 2 + sleep ${sleep} click element xpath=/html/body/div/div[1]/div[1]/ul/li[3] #点击name为搜索类型 - sleep 2 + 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 2 + sleep ${sleep} click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[1]/span/div/i #点击搜索按钮 - sleep 2 + 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 2 - sleep 1 + sleep ${sleep} + sleep ${sleep} Run Keyword And Ignore Error click element id=objectDel #点击删除按钮 - sleep 1 + sleep ${sleep} Run Keyword And Ignore Error click element xpath=/html/body/div/div/div[3]/button[2] - sleep 1 + sleep ${sleep} END \ No newline at end of file diff --git a/02-Keyword/tsg_ui/proxyTCPOptions/ProxyTCPOptions.robot b/02-Keyword/tsg_ui/proxyTCPOptions/ProxyTCPOptions.robot index 4576a2f..65f2f04 100644 --- a/02-Keyword/tsg_ui/proxyTCPOptions/ProxyTCPOptions.robot +++ b/02-Keyword/tsg_ui/proxyTCPOptions/ProxyTCPOptions.robot @@ -6,24 +6,24 @@ Resource ../SecurityPolicy/SourceAndDestination.robot *** Keywords *** Create-Proxy-TCP-Options [Arguments] ${tcpname} - Sleep 1 + sleep ${sleep} Menu settings Advanced - sleep 1 + sleep ${sleep} click element id=Advanced/advanced #点击Proxy-TCP-Options - sleep 1 + sleep ${sleep} click element id=proxyTCPCreate #点击Create按钮 - sleep 1 + sleep ${sleep} input text id=advancedAdd_policyName ${tcpname} #输入name - sleep 1 + sleep ${sleep} TCPSource [Arguments] ${Source}=yes ${policytype}=null ${type1}=null ${CreateOrSearch}=null ${Add}=null ${name}=null ... ${object_name}=null ${ipclienttext1}=null ${post}=null ${Country}=null ${City}=null ... ${Protocols1}=null ${Degree}=null ${times}=null ${numbers}=null ${limits}=null ${keywordtext}=null #判断是否添加源ip,${Source}=yes,为添加源ip,否则不添加源ip - run keyword if "${Source}"=="yes" run keywords sleep 1 + run keyword if "${Source}"=="yes" run keywords sleep ${sleep} ... AND click element xpath=/html/body/div[1]/div/div[3]/div[2]/div/div/div[1]/div[1]/div/div[2]/form/div[2]/div[1]/div/div #点击添加源ip - ... AND sleep 1 + ... AND sleep ${sleep} ... AND Create-Source ${policytype} ${type1} ${CreateOrSearch} ${Add} ${name} ... ${object_name} ${ipclienttext1} ${post} ${Country} ${City} ... ${Protocols1} ${Degree} ${times} ${numbers} ${limits} ${keywordtext} @@ -33,10 +33,10 @@ TCPDestination ... ${object_name}=null ${ipclienttext1}=null ${post}=null ${Country}=null ${City}=null ... ${Protocols1}=null ${Degree}=null ${times}=null ${numbers}=null ${limits}=null ${keywordtext}=null #判断是否添加目的ip,${Destination}=yes,为添加目的ip,否则不添加目的ip - sleep 1 - run keyword if "${Destination}"=="yes" run keywords sleep 1 + sleep ${sleep} + run keyword if "${Destination}"=="yes" run keywords sleep ${sleep} ... AND click element xpath=/html/body/div[1]/div/div[3]/div[2]/div/div/div[1]/div[1]/div/div[2]/form/div[3]/div[1]/div/div #点击添加目的ip - ... AND sleep 1 + ... AND sleep ${sleep} ... AND Create-Destination ${policytype} ${type1} ${CreateOrSearch} ${Add} ${name} ... ${object_name} ${ipclienttext1} ${post} ${Country} ${City} ... ${Protocols1} ${Degree} ${times} ${numbers} ${limits} ${keywordtext} @@ -44,122 +44,122 @@ TCPDestination TCPFilter [Arguments] ${Filtercreate} ${SNIname} ${Filter}=yes #判断是否添加Filter,${Filter}=yes,为添加Filter,否则不添加Filter - run keyword if "${Filter}"=="yes" run keywords sleep 1 + run keyword if "${Filter}"=="yes" run keywords sleep ${sleep} ... AND Filter-create ${Filtercreate} ${SNIname} ... ELSE log 不添加Filter Filter-create [Arguments] ${Filtercreate} ${SNIname} FOR ${i} IN @{Filtercreate} - sleep 1 + sleep ${sleep} click element id=interceptionadd_add_filter - sleep 1 - run keyword if "${i}"=="SNI" run keywords sleep 1 + 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 1 + ... AND sleep ${sleep} END Create-Object-Search [Arguments] ${name} ${filter} [Documentation] 调用次关键字前需要添加必填参数: ... ${name}:填入是一个列表,列表内容为object的name ... 选择search对象 - sleep 1 + 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 1 + 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 1 + sleep ${sleep} press keys xpath=//*[@id="condistions_protocol"]/div[2]/p[contains(text(), "${filter}")]/following-sibling::div[2]/div/div[1]/input ENTER - sleep 1 + 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 1 + sleep ${sleep} END TCP-Enable-TCP-Passthrough [Arguments] ${Enable-TCP-Passthrough}=null #判断是否开启Enable TCP Passthrough按钮,${Enable-TCP-Passthrough}=open,为开启,否则不添开启 - run keyword if "${Enable-TCP-Passthrough}"=="open" run keywords sleep 1 + 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 1 + ... AND sleep ${sleep} ... ELSE log 不开启 TCP-Bypass-Duplicated-Packet [Arguments] ${Bypass-Duplicated-Packet}=null #判断是否开启Bypass Duplicated Packet按钮,${Bypass-Duplicated-Packet}=open,为开启,否则不添开启 - run keyword if "${Bypass-Duplicated-Packet}"=="open" run keywords sleep 1 + 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 1 + ... AND sleep ${sleep} ... ELSE log 不开启 TCP-Client-side-Parameters [Arguments] ${clickelement}=/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] ... ${ClientOverrideMSS}=null ${ClientMSSvalue}=null ${ClientNoDelay}=null ${Clientttlvalue}=null ${ClientKeepalive}=null ${ClientProbeNumber}=null ... ${ClientIdleTime}=null ${ClientInterval}=null ${ClientUserTimeout}=null - sleep 1 + sleep ${sleep} click element id=tab-first #点击Client-side Parameters - sleep 1 + sleep ${sleep} #判断是否开启Override MSS按钮,${Override-MSS}=open,为开启,否则不添开启 - run keyword if "${ClientOverrideMSS}"=="open" run keywords sleep 1 + run keyword if "${ClientOverrideMSS}"=="open" run keywords sleep ${sleep} ... AND click element xpath=${clickelement}/div/form/div/label[contains(text(), "Override MSS")]/following-sibling::div/div #点击Override-MSS按钮开启 - ... AND sleep 1 + ... AND sleep ${sleep} ... AND input text xpath=${clickelement}/div/form/div[2]/div/div/input ${ClientMSSvalue} #输入MSS内容 - ... AND sleep 1 + ... AND sleep ${sleep} ... ELSE log 不开启 #判断是否开启No Delay按钮,${No-Delay}=open,为开启,否则不添开启 - run keyword if "${ClientNoDelay}"=="open" run keywords sleep 1 + run keyword if "${ClientNoDelay}"=="open" run keywords sleep ${sleep} ... AND click element xpath=${clickelement}/div/form/div/label[contains(text(), "No Delay")]/following-sibling::div/div #点击No-Delay按钮开启 - ... AND sleep 1 + ... AND sleep ${sleep} ... ELSE log 不开启 input text xpath=${clickelement}/div/form/div/label[contains(text(), "TTL")]/following-sibling::div/div/input ${Clientttlvalue} #输入ttl内容 - sleep 1 + sleep ${sleep} #判断是否开启Keepalive按钮,${Keepalive}=open,为开启,否则不添开启 - run keyword if "${ClientKeepalive}"=="open" run keywords sleep 1 + run keyword if "${ClientKeepalive}"=="open" run keywords sleep ${sleep} ... AND click element xpath=${clickelement}/div/form/div/label[contains(text(), "Keepalive")]/following-sibling::div/div #点击Keepalive按钮开启 - ... AND sleep 1 + ... AND sleep ${sleep} ... AND input text xpath=${clickelement}/div/form/div/div/form/div[1]/label[contains(text(), "Probe Number")]/following-sibling::div/div/input ${ClientProbeNumber} #输入Probe Number内容 - ... AND sleep 1 + ... AND sleep ${sleep} ... AND input text xpath=${clickelement}/div/form/div/div/form/div[2]/label[contains(text(), "Idle Time")]/following-sibling::div/div/input ${ClientIdleTime} #输入Idle Time内容 - ... AND sleep 1 + ... AND sleep ${sleep} ... AND input text xpath=${clickelement}/div/form/div/div/form/div[3]/label[contains(text(), "Interval")]/following-sibling::div/div/input ${ClientInterval} #输入Interval内容 - ... AND sleep 1 + ... AND sleep ${sleep} ... ELSE log 不开启 input text xpath=${clickelement}/div/form/div/label[contains(text(), "User Timeout")]/following-sibling::div/div/input ${ClientUserTimeout} #输入User Timeout内容 - sleep 1 + sleep ${sleep} TCP-Server-side-Parameters [Arguments] ${serverelement}=/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] ... ${ServerOverrideMSS}=null ${ServerMSSvalue}=null ${ServerNoDelay}=null ${Serverttlvalue}=null ${ServerKeepalive}=null ${ServerProbeNumber}=null ... ${ServerIdleTime}=null ${ServerInterval}=null ${ServerUserTimeout}=null click element id=tab-second #点击Server-side Parameters - sleep 1 + sleep ${sleep} #判断是否开启Override MSS按钮,${Override-MSS}=open,为开启,否则不添开启 - run keyword if "${ServerOverrideMSS}"=="open" run keywords sleep 1 + run keyword if "${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 1 + ... AND sleep ${sleep} ... AND input text xpath=${serverelement}/div/form/div[2]/div/div/input ${ServerMSSvalue} #输入MSS内容 - ... AND sleep 1 + ... AND sleep ${sleep} ... ELSE log 不开启 #判断是否开启No Delay按钮,${No-Delay}=open,为开启,否则不添开启 - run keyword if "${ServerNoDelay}"=="open" run keywords sleep 1 + run keyword if "${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 1 + ... AND sleep ${sleep} ... ELSE log 不开启 input text xpath=${serverelement}/div/form/div/label[contains(text(), "TTL")]/following-sibling::div/div/input ${Serverttlvalue} #输入ttl内容 - sleep 1 + sleep ${sleep} #判断是否开启Keepalive按钮,${Keepalive}=open,为开启,否则不添开启 - run keyword if "${ServerKeepalive}"=="open" run keywords sleep 1 + run keyword if "${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 1 + ... 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 1 + ... 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 1 + ... 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 1 + ... AND sleep ${sleep} ... ELSE log 不开启 - sleep 1 + sleep ${sleep} input text xpath=${serverelement}/div/form/div/label[contains(text(), "User Timeout")]/following-sibling::div/div/input ${ServerUserTimeout} #输入User Timeout内容 - sleep 1 + sleep ${sleep} TCP-OK - sleep 1 + sleep ${sleep} click element id=proxyManipulationSuccess #点击OK - sleep 1 + sleep ${sleep} TCP-Assertion [Arguments] ${name} ${search} Proxy-TCP-Options-Search ${name} ${search} #搜索刚新建的name @@ -170,29 +170,29 @@ TCP-Assertion Proxy-TCP-Options-Search [Arguments] ${value} ${search} - sleep 1 + sleep ${sleep} click element id=sidebarAdvanced - sleep 1 + 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 #点击搜索框 - sleep 1 + sleep ${sleep} #判断是使用name搜索还是id搜索 - run keyword if "${search}"=="Name" run keywords sleep 1 + 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} - ... ELSE IF "${search}"=="ID" run keywords sleep 1 + ... 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 sleep 1 + ... AND sleep ${sleep} click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[3]/div[1]/div/div[1]/span/div/i #点击搜索按钮 - sleep 1 + sleep ${sleep} Run Keyword And Ignore Error click element xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1] #点击搜索到的列表 - sleep 1 + sleep ${sleep} Delete-Proxy-estimate [Arguments] ${securityname} - run keyword if "${securityname}"!="null" run keywords sleep 1 + run keyword if "${securityname}"!="null" run keywords sleep ${sleep} ... AND Delete-Proxy ${securityname} ... ELSE log go on @@ -200,17 +200,17 @@ Delete-Proxy [Arguments] ${securityname} Menu settings Advanced - sleep 2 + sleep ${sleep} Proxy-TCP-Options-Search ${securityname} Name - sleep 2 + sleep ${sleep} Run Keyword And Ignore Error click element id=proxyTCPDel - sleep 1 + sleep ${sleep} Run Keyword And Ignore Error click element xpath=/html/body/div/div/div[3]/button[2] - sleep 1 + sleep ${sleep} Delete-object-estimate [Arguments] ${obj} - run keyword if "${obj}"!="null" run keywords sleep 1 + run keyword if "${obj}"!="null" run keywords sleep ${sleep} ... AND Delete-object ${obj} ... ELSE log go on Delete-object @@ -224,20 +224,20 @@ Forname [Arguments] ${objectname} ${key} FOR ${i} IN @{objectname} Menu objects ${key} - sleep 2 + 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 2 + sleep ${sleep} click element xpath=/html/body/div/div[1]/div[1]/ul/li[3] #点击name为搜索类型 - sleep 2 + 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 2 + sleep ${sleep} click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[1]/span/div/i #点击搜索按钮 - sleep 2 + 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 2 - sleep 1 + sleep ${sleep} + sleep ${sleep} Run Keyword And Ignore Error click element id=objectDel #点击删除按钮 - sleep 1 + sleep ${sleep} Run Keyword And Ignore Error click element xpath=/html/body/div/div/div[3]/button[2] - sleep 1 + sleep ${sleep} END \ No newline at end of file diff --git a/03-Variable/BifangApiVariable.txt b/03-Variable/BifangApiVariable.txt index e74cbc3..5ee0b15 100644 --- a/03-Variable/BifangApiVariable.txt +++ b/03-Variable/BifangApiVariable.txt @@ -4,15 +4,15 @@ ${loginType} ui #执行环境是否Widonws ${systemType} api #API配置信息 -${host} 192.168.44.71 +${host} 192.168.44.72 ${port} 8080 ${authmode} 1 ${authCode} ${EMPTY} ${ldapId} 27 ${version} v1 ${version2} v2 -${username} byb -${password} 111111 +${username} lyf +${password} 1 ${encodePassword} ${EMPTY} ${token} ${EMPTY} #[Documentation] 测试终端IP统一配置 @@ -29,7 +29,7 @@ ${addTsgUIAPIFlag} 1 ${policyVerificationSleepSeconds} 20 #策略验证后到验证策略日志需等待时间 ${policyLogVerificationSleepSeconds} 60 -${path} C:/Users/byb11/git/tsg_autotest/05-Other/ +${path} F:/tsg-git/tsg_autotest/05-Other/ ${Downloadpath} C:/Users/byb11/Downloads/ ${curlbatpath} ${path}/curl/ ${mailpath} ${path}/mail/ @@ -67,4 +67,6 @@ ${oamPort} 50080 ${contrast} 0.1 ${editpasswd} no #设置密码过期时是否需要修改密码,no为不修改,yes为修改 # Mysql数据库连接信息 -${mysqlHost} host='192.168.44.72',port=3306,user='root',passwd='bifang!@#',database='tsg-bifang' \ No newline at end of file +${mysqlHost} host='192.168.44.72',port=3306,user='root',passwd='bifang!@#',database='tsg-bifang' +#休息时间 +${sleep} 3 \ No newline at end of file