diff --git a/02-Keyword/tsg_ui/policy/Testcase-UIPolicy.robot b/02-Keyword/tsg_ui/policy/Testcase-UIPolicy.robot index 04c0487..ba81d38 100644 --- a/02-Keyword/tsg_ui/policy/Testcase-UIPolicy.robot +++ b/02-Keyword/tsg_ui/policy/Testcase-UIPolicy.robot @@ -10,60 +10,67 @@ Resource ../../../02-Keyword/tsg_ui/policy/UIPolicy.robot Test-UIAddPolicies # #新建对象fqdn # Comment 新建对象fqdn - # CreatePage FQDN single zdhfqdn keywordtext=*www.baidu.com + # CreatePage FQDN single ${TEST NAME}_FQDN keywordtext=*www.baidu.com # #新建对象url # Comment 新建对象url - # CreatePage URL single zdhurl keywordtext=*.com + # CreatePage URL single ${TEST NAME}_URL keywordtext=*.com # #新建Request Header # Comment Request Header # #新建cookie - # CreatePage HTTPSignature single zdhreqck reqrestype=req reqresheader=ck keywordtext=1234@#% + # CreatePage HTTPSignature single ${TEST NAME}_REQCK reqrestype=req reqresheader=ck keywordtext=1234@#% # #新建ua - # CreatePage HTTPSignature single zdhrequa reqrestype=req reqresheader=ua keywordtext=*скрипцияк + # CreatePage HTTPSignature single ${TEST NAME}_REQUA reqrestype=req reqresheader=ua keywordtext=*скрипцияк # #新建Response Header # Comment Response Header # #新建set cookie - # CreatePage HTTPSignature single zdhressck reqrestype=res reqresheader=sck keywordtext=1234@#% + # CreatePage HTTPSignature single ${TEST NAME}_RESSCK reqrestype=res reqresheader=sck keywordtext=1234@#% # #新建ct - # CreatePage HTTPSignature single zdhresct reqrestype=res reqresheader=ct keywordtext=text* + # CreatePage HTTPSignature single ${TEST NAME}_RESCT reqrestype=res reqresheader=ct keywordtext=text* # #新建Request Content # Comment Request Content # #新建Request Content - # CreatePage Key single zdhreqcontent keywordtext=*pppp - ${hostname} create list zdhfqdn - ${urlname} create list zdhurl - ${RequestHeadername} create list zdhreqck zdhrequa - ${ResponseHeadername} create list zdhressck zdhresct - ${RequestContentname} create list zdhreqcontent - ${filter} create list Host URL Request Header Response Header Request Content - ${policyInfo} Create Dictionary PolicyType=Security Policy PolicyName=${TEST NAME} PolicyAction=Deny PolicySubAction=RST ApplicationSearch=HTTP PolicyLogSession=1 PolicyEnabled=1 - ${sip1} Create Dictionary Sordtype=Source Type1=Ip CreateOrSearch=Create Add=Address Name=${TEST NAME}_IP1 Ipclienttext1=192.168.40.11-192.168.40.110 Port=1-65535 - ${ip_name} create list ${TEST NAME}_IP1 - ${sip2} Create Dictionary Sordtype=Source Type1=Ip CreateOrSearch=Create Add=Group Name=${TEST NAME}_IPGroup1 ObjectName=${ip_name} - ${Country} create list Botswana - ${City} create list Dekar - ${sgeo1} Create Dictionary Sordtype=Source Type1=Geography CreateOrSearch=Create Add=Address Name=${TEST NAME}_Geo1 Country=${Country} City=${City} - ${sgeo_name} create list ${TEST NAME}_Geo1 - ${sgeo2} Create Dictionary Sordtype=Source Type1=Geography CreateOrSearch=Create Add=Group Name=${TEST NAME}_GeoGroup1 ObjectName=${sgeo_name} - ${slearn1} Create Dictionary Sordtype=Source Type1=IPLearning CreateOrSearch=Create Add=Address Name=${TEST NAME}_Learn1 Fqdn=*www.baidu.com Protocols1=HTTP Degree=2Degrees Limits=10000 Numbers=1 Times=10000 - ${slearn2} Create Dictionary Sordtype=Source Type1=IPLearning CreateOrSearch=Create Add=Address Name=${TEST NAME}_Learn2 Fqdn=*www.baidu.com Protocols1=HTTPSSL Degree=1Degrees Limits=10000 Numbers=1 Times=72 - ${ssub1} Create Dictionary Sordtype=Source Type1=SUBID CreateOrSearch=Create Add=Address Name=${TEST NAME}_Subid1 Keywordtext=$test25 - ${sub_name} create list ${TEST NAME}_Subid1 - ${ssub2} Create Dictionary Sordtype=Source Type1=SUBID CreateOrSearch=Create Add=Group Name=${TEST NAME}_Subid2 ObjectName=${sub_name} - ${sourceAddIpList} Create List ${sip1} ${sip2} ${slearn1} ${slearn2} ${ssub1} ${ssub2} ${sgeo1} ${sgeo2} - ${sourceInfo} Create Dictionary sourceAddIpList=${sourceAddIpList} - ${ip_name1} create list ${TEST NAME}_IP1 ${TEST NAME}_IPGroup1 - ${sgeo_name1} create list ${TEST NAME}_Geo1 ${TEST NAME}_GeoGroup1 - ${slearn_name1} create list ${TEST NAME}_Learn1 ${TEST NAME}_Learn2 - ${sub_name1} create list ${TEST NAME}_Subid1 ${TEST NAME}_Subid2 - ${dip1} Create Dictionary Sordtype=Destination Type1=Ip CreateOrSearch=Search ObjectName=${ip_name1} - ${dsgeo} Create Dictionary Sordtype=Destination Type1=Geography CreateOrSearch=Search ObjectName=${sgeo_name1} - ${dslearn} Create Dictionary Sordtype=Destination Type1=IPLearning CreateOrSearch=Search ObjectName=${slearn_name1} - ${destinationAddIpList} Create List ${dip1} ${dsgeo} ${dslearn} - ${destinationInfo} Create Dictionary destinationAddIpList=${destinationAddIpList} - ${filterInfo} Create Dictionary Filter=${filter} Hostname=${hostname} URLname=${urlname} Request Headername=${RequestHeadername} Response Headername=${ResponseHeadername} - ... Request Contentname=${RequestContentname} - UIAddPolicies ${policyInfo} SourceInfo=${sourceInfo} DestinationInfo=${destinationInfo} FilterInfo=${filterInfo} + # CreatePage Key single ${TEST NAME}_REQCONT keywordtext=*pppp + ${hostname} create list ${TEST NAME}_FQDN + # ${urlname} create list ${TEST NAME}_URL + # ${RequestHeadername} create list ${TEST NAME}_REQCK ${TEST NAME}_REQUA + # ${ResponseHeadername} create list ${TEST NAME}_RESSCK ${TEST NAME}_RESCT + # ${RequestContentname} create list ${TEST NAME}_REQCONT + # ${filter} create list Host URL Request Header Response Header Request Content + # ${policyInfo} Create Dictionary PolicyType=Security Policy PolicyName=${TEST NAME} PolicyAction=Deny PolicySubAction=RST ApplicationSearch=HTTP PolicyLogSession=1 PolicyEnabled=1 + # ${sip1} Create Dictionary Sordtype=Source Type1=Ip CreateOrSearch=Create Add=Address Name=${TEST NAME}_IP1 Ipclienttext1=192.168.40.11-192.168.40.110 Port=1-65535 + # ${ip_name} create list ${TEST NAME}_IP1 + # ${sip2} Create Dictionary Sordtype=Source Type1=Ip CreateOrSearch=Create Add=Group Name=${TEST NAME}_IPGroup1 ObjectName=${ip_name} + # ${Country} create list Botswana + # ${City} create list Dekar + # ${sgeo1} Create Dictionary Sordtype=Source Type1=Geography CreateOrSearch=Create Add=Address Name=${TEST NAME}_Geo1 Country=${Country} City=${City} + # ${sgeo_name} create list ${TEST NAME}_Geo1 + # ${sgeo2} Create Dictionary Sordtype=Source Type1=Geography CreateOrSearch=Create Add=Group Name=${TEST NAME}_GeoGroup1 ObjectName=${sgeo_name} + # ${slearn1} Create Dictionary Sordtype=Source Type1=IPLearning CreateOrSearch=Create Add=Address Name=${TEST NAME}_Learn1 Fqdn=*www.baidu.com Protocols1=HTTP Degree=2Degrees Limits=10000 Numbers=1 Times=10000 + # ${slearn2} Create Dictionary Sordtype=Source Type1=IPLearning CreateOrSearch=Create Add=Address Name=${TEST NAME}_Learn2 Fqdn=*www.baidu.com Protocols1=HTTPSSL Degree=1Degrees Limits=10000 Numbers=1 Times=72 + # ${ssub1} Create Dictionary Sordtype=Source Type1=SUBID CreateOrSearch=Create Add=Address Name=${TEST NAME}_Subid1 Keywordtext=$test25 + # ${sub_name} create list ${TEST NAME}_Subid1 + # ${ssub2} Create Dictionary Sordtype=Source Type1=SUBID CreateOrSearch=Create Add=Group Name=${TEST NAME}_Subid2 ObjectName=${sub_name} + # ${sourceAddIpList} Create List ${sip1} ${sip2} ${slearn1} ${slearn2} ${ssub1} ${ssub2} ${sgeo1} ${sgeo2} + # ${sourceInfo} Create Dictionary sourceAddIpList=${sourceAddIpList} + # ${ip_name1} create list ${TEST NAME}_IP1 ${TEST NAME}_IPGroup1 + # ${sgeo_name1} create list ${TEST NAME}_Geo1 ${TEST NAME}_GeoGroup1 + # ${slearn_name1} create list ${TEST NAME}_Learn1 ${TEST NAME}_Learn2 + # ${sub_name1} create list ${TEST NAME}_Subid1 ${TEST NAME}_Subid2 + # ${dip1} Create Dictionary Sordtype=Destination Type1=Ip CreateOrSearch=Search ObjectName=${ip_name1} + # ${dsgeo} Create Dictionary Sordtype=Destination Type1=Geography CreateOrSearch=Search ObjectName=${sgeo_name1} + # ${dslearn} Create Dictionary Sordtype=Destination Type1=IPLearning CreateOrSearch=Search ObjectName=${slearn_name1} + # ${destinationAddIpList} Create List ${dip1} ${dsgeo} ${dslearn} + # ${destinationInfo} Create Dictionary destinationAddIpList=${destinationAddIpList} + # ${filterInfo} Create Dictionary Filter=${filter} Hostname=${hostname} URLname=${urlname} Request Headername=${RequestHeadername} Response Headername=${ResponseHeadername} + # ... Request Contentname=${RequestContentname} + # UIAddPolicies ${policyInfo} SourceInfo=${sourceInfo} DestinationInfo=${destinationInfo} FilterInfo=${filterInfo} + ${editpolicyInfo} Create Dictionary PolicyType=Security Policy PolicyName=${TEST NAME} PolicyEditName=${TEST NAME}_Edit PolicyAction=Deny PolicySubAction=Drop ApplicationSearch=HTTP,SSL ApplicationFilter=SSL PolicyLogSession=1 PolicyEnabled=open + ${editfilrer} create list SNI + ${editfilterInfo} Create Dictionary Filter=${editfilrer} SSLSNIname=${hostname} + UIUpdataPolicies ${editpolicyInfo} EditFilterInfo=${editfilterInfo} + PoliciesDelete + + Test-UIAddPolicies-Block # #新建对象fqdn diff --git a/02-Keyword/tsg_ui/policy/UIPolicy.robot b/02-Keyword/tsg_ui/policy/UIPolicy.robot index 8e2a7d3..46d09f7 100644 --- a/02-Keyword/tsg_ui/policy/UIPolicy.robot +++ b/02-Keyword/tsg_ui/policy/UIPolicy.robot @@ -108,7 +108,7 @@ UIAddPolicies ... ELSE ProxyAssert ${PolicyName} UIUpdataPolicies - [Arguments] ${PolicyInfo} ${SourceInfo}=null ${DestinationInfo}=null ${FilterInfo}=null ${Subactionadd}=null ${Keyring}=null ${MirrorDecryptedTrafficInfo}=null ${DecryptionProfile}=null + [Arguments] ${PolicyInfo} ${SourceInfo}=null ${DestinationInfo}=null ${EditFilterInfo}=null ${CreateOrDeleteFilterInfo}=null ${Subactionadd}=null ${Keyring}=null ${MirrorDecryptedTrafficInfo}=null ${DecryptionProfile}=null ... ${ProxyDenyadd}=null ${DenyRedirectadd}=null ${ReplaceActionParameters}=null ${HijackFileadd}=null ${InsertScript}=null [Documentation] 编辑策略 @@ -144,7 +144,7 @@ UIUpdataPolicies ${return} ${PolicyLogSession} Run Keyword And Ignore Error Get From Dictionary ${PolicyInfo} PolicyLogSession ${PolicyLogSession} Run Keyword If "${return}"=="FAIL" or "${PolicyLogSession}"=="${EMPTY}" set variable ${Default_PolicyLogSession} - ... ELSE set variable ${PolicyLogSessionession} + ... ELSE set variable ${PolicyLogSession} ${return} ${LogOptions} Run Keyword And Ignore Error Get From Dictionary ${PolicyInfo} LogOptions ${LogOptions} Run Keyword If "${return}"=="FAIL" or "${LogOptions}"=="${EMPTY}" set variable 1 @@ -156,9 +156,6 @@ UIUpdataPolicies Comment 新建策略 打开菜单 Menu policys ${PolicyType} - - Comment 新建策略 打开安全策略列表上方的新建策略按钮 - UIPolicy.CreateButton Comment 搜索要编辑的策略 Security-Source Name ${PolicyName} Comment 点击编辑按钮Edit @@ -168,34 +165,36 @@ UIUpdataPolicies Comment 编辑action UIPolicy.Create-actions ${PolicyType} ${PolicyAction} Comment 编辑Source - Run Keyword If "${SourceInfo}"=="${EMPTY}" log there is no SourceInfoDict + Run Keyword If "${SourceInfo}"=="${EMPTY}" or "${SourceInfo}"=="null" log there is no SourceInfoDict ... ELSE UIPolicy. Create-Source-Button - Run Keyword If "${SourceInfo}"=="${EMPTY}" log there is no SourceInfoDict + Run Keyword If "${SourceInfo}"=="${EMPTY}" or "${SourceInfo}"=="null" log there is no SourceInfoDict ... ELSE UIPolicy.CreateEditDeleteSources ${SourceInfo} Comment 编辑Destination - Run Keyword If "${DestinationInfo}"=="${EMPTY}" log there is no DestinationInfo + Run Keyword If "${DestinationInfo}"=="${EMPTY}" or "${DestinationInfo}"=="null" log there is no DestinationInfo ... ELSE UIPolicy.Create-Destination-Button - Run Keyword If "${DestinationInfo}"=="${EMPTY}" log there is no DestinationInfo + Run Keyword If "${DestinationInfo}"=="${EMPTY}" or "${DestinationInfo}"=="null" log there is no DestinationInfo ... ELSE UIPolicy.CreateEditDeleteDestination ${DestinationInfo} Comment 编辑Application UIPolicy.Create-Application-Button ${PolicyType} ${ApplicationSearchV} ${PolicyAction} #编辑filter - Run Keyword If "${FilterInfo}"=="${EMPTY}" log there is no FilterInfo - ... ELSE Create-Filter-SecurityOrProxy ${PolicyType} ${ApplicationFilter} ${FilterInfo} + Run Keyword If "${EditFilterInfo}"=="${EMPTY}" or "${EditFilterInfo}"=="null" log there is no FilterInfo + ... ELSE Create-Filter-SecurityOrProxy ${PolicyType} ${ApplicationFilter} ${EditFilterInfo} + Run Keyword If "${CreateOrDeleteFilterInfo}"=="${EMPTY}" or "${CreateOrDeleteFilterInfo}"=="null" log there is no FilterInfo + ... ELSE Edit-Filter-SecurityOrProxy ${PolicyType} ${CreateOrDeleteFilterInfo} - Run Keyword If "${PolicyType}"=="Security Policy" and "${PolicyAction}"=="deny" run keywords sleep ${sleep} + Run Keyword If "${PolicyType}"=="Security Policy" and "${PolicyAction}"=="Deny" run keywords sleep ${sleep} ... AND Deny-subaction-1 ${PolicyAction} ${PolicySubAction} ${Subactionadd} - Run Keyword If "${PolicyType}"=="Security Policy" and "${PolicyAction}"=="intercept" and "ApplicationSearchV"=="SSL" run keywords sleep ${sleep} + Run Keyword If "${PolicyType}"=="Security Policy" and "${PolicyAction}"=="Intercept" and "ApplicationSearchV"=="SSL" run keywords sleep ${sleep} ... AND Interceptadd ${Keyring} ${MirrorDecryptedTrafficInfo} ${DecryptionProfile} - Run Keyword If "${PolicyType}"=="Proxy Policy" and "${PolicyAction}"=="deny" run keywords sleep ${sleep} + Run Keyword If "${PolicyType}"=="Proxy Policy" and "${PolicyAction}"=="Deny" run keywords sleep ${sleep} ... AND Proxy-Deny ${ProxyDenyadd} - Run Keyword If "${PolicyType}"=="Proxy Policy" and "${PolicyAction}"=="redirect" run keywords sleep ${sleep} + Run Keyword If "${PolicyType}"=="Proxy Policy" and "${PolicyAction}"=="Redirect" run keywords sleep ${sleep} ... AND Deny-Redirect ${DenyRedirectadd} - Run Keyword If "${PolicyType}"=="Proxy Policy" and "${PolicyAction}"=="replace" run keywords sleep ${sleep} + Run Keyword If "${PolicyType}"=="Proxy Policy" and "${PolicyAction}"=="Replace" run keywords sleep ${sleep} ... AND Replace-Action-Parameters-for1 ${ReplaceActionParameters} - Run Keyword If "${PolicyType}"=="Proxy Policy" and "${PolicyAction}"=="hijack" run keywords sleep ${sleep} + Run Keyword If "${PolicyType}"=="Proxy Policy" and "${PolicyAction}"=="Hijack" run keywords sleep ${sleep} ... AND HijackFile-SearchorCreate ${HijackFileadd} - Run Keyword If "${PolicyType}"=="Proxy Policy" and "${PolicyAction}"=="insert" run keywords sleep ${sleep} + Run Keyword If "${PolicyType}"=="Proxy Policy" and "${PolicyAction}"=="Insert" run keywords sleep ${sleep} ... AND InsertScript-SearchorCreate ${InsertScript} Run Keyword If "${PolicyType}"=="Proxy Policy" run keywords ProxyLogSession ${PolicyLogSession} ... AND ProxyLogOptions ${LogOptions} @@ -204,9 +203,9 @@ UIUpdataPolicies ... ELSE ProxyEnabled ${PolicyEnabled} Run Keyword If "${PolicyType}"=="Security Policy" Security-Policies-OK ... ELSE Proxy-Policies-OK - Security-Source Name ${PolicyName} - Run Keyword If "${PolicyType}"=="Security Policy" SecurityAssert ${PolicyName} - ... ELSE ProxyAssert ${PolicyName} + Security-Source Name ${PolicyEditName} + Run Keyword If "${PolicyType}"=="Security Policy" SecurityAssert ${PolicyEditName} + ... ELSE ProxyAssert ${PolicyEditName} SecurityAssert [Arguments] ${PolicyName} @@ -549,6 +548,7 @@ Create-Destination-Button 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 ${sleep} click element xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[5]/div[1]/div/div + Create-Application-Button [Arguments] ${PolicyType} ${ApplicationSearchV} ${Action} [Documentation] 点击Application的加号 @@ -559,6 +559,7 @@ Create-Application-Button ... AND sleep ${sleep} run keyword if "${PolicyType}"=="Proxy Policy" ProxyApplicationSearch ${Action} ${ApplicationSearchV} + SecurityApplicationFor [Arguments] ${ApplicationSearchV} ${a} set variable ${ApplicationSearchV}[0] @@ -580,6 +581,12 @@ SecurityApplicationSearch 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 ${sleep} + ${style}= Get Element Attribute class=el-message-box__wrapper style + log ${style}1111111111111 + ${c} Evaluate "display: none" in """${style}""" + run keyword if "${c}"=="False" click element xpath=/html/body/div/div/div[3]/button[2] + run keyword if "${c}"=="True" log go on + sleep ${sleep} click element id=check_list_allcancelobject sleep ${sleep} @@ -1793,82 +1800,8 @@ Deny-content ... AND sllep 1 ... AND input text id=manipulation_elInput_blockselect ${TextValue} ... AND sleep ${sleep} -Profile-SearchorCreate_bak - [Arguments] ${SearchorCreate} ${ProfileName} ${File} - [Documentation] 调用次关键字前需要添加必填参数: - ... ${SearchorCreate}:填入Search或Create - ... ${ProfileName}:Profile的名字 - ... ${File}:上传文件路径 - ... 判断是新建还是搜索profile - 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 ${sleep} - ... AND press keys xapth=/html/body/div/div[1]/div[1]/ul/div[1]/div/input ENTER - ... AND sleep ${sleep} - ... AND click element xpath=/html/body/div/div[1]/div[1]/ul/div[2]/div/li[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 ${sleep} - ... AND input text id=responsepages_profileName ${ProfileName} - ... AND sleep ${sleep} - ... AND Choose File xpath=//*[@id="policy_Manipulation_create6"]/div[2]/form/div[2]/div/div/div/input ${File} #上传文件 - ... AND sleep ${sleep} - ... AND click element id=responseAddOk1 - ... AND sleep ${sleep} - ... ELSE log 传入参数错误 -Deny-Redirect_bak - [Arguments] ${DenyRedirectadd} - [Documentation] 调用次关键字前需要添加必填参数:${DenyRedirectadd}是个字典,字典中的数据为下 - ... ${QType}:填入A或AAAA - ... ${Avalue}:根据${QType}填入IPV4或IPV6的值 - ... ${Attl}:根据${QType}填入A的ttl值或AAAA的ttl值 - ... ${CNAMEvalue}:根据${QType}填入A的CNAME的域名值或AAAA的CNAME域名值 - ... ${CNAMEttl}:根据${QType}填入A的CNAME的ttl值或AAAA的CNAME的ttl值 - ... 新建Redirect - ${return} ${QType} Run Keyword And Ignore Error Get From Dictionary ${DenyRedirectadd} QType - ${QType} Run Keyword If "${return}"=="FAIL" or "${QType}"=="${EMPTY}" set variable null - ... ELSE set variable ${QType} - ${return} ${Avalue} Run Keyword And Ignore Error Get From Dictionary ${DenyRedirectadd} Avalue - ${Avalue} Run Keyword If "${return}"=="FAIL" or "${Avalue}"=="${EMPTY}" set variable null - ... ELSE set variable ${Avalue} - ${return} ${Attl} Run Keyword And Ignore Error Get From Dictionary ${DenyRedirectadd} Attl - ${Attl} Run Keyword If "${return}"=="FAIL" or "${Attl}"=="${EMPTY}" set variable null - ... ELSE set variable ${Attl} - ${return} ${CNAMEvalue} Run Keyword And Ignore Error Get From Dictionary ${DenyRedirectadd} CNAMEvalue - ${CNAMEvalue} Run Keyword If "${return}"=="FAIL" or "${CNAMEvalue}"=="${EMPTY}" set variable null - ... ELSE set variable ${CNAMEvalue} - ${return} ${CNAMEttl} Run Keyword And Ignore Error Get From Dictionary ${DenyRedirectadd} CNAMEttl - ${CNAMEttl} Run Keyword If "${return}"=="FAIL" or "${CNAMEttl}"=="${EMPTY}" set variable null - ... ELSE set variable ${CNAMEttl} - - sleep ${sleep} - click element id=interceptionadd_add_filter - sleep ${sleep} - run keyword if "${QType}"=="A" run keywords sleep ${sleep} - ... AND input text id=A00 ${Avalue} - ... AND sleep ${sleep} - ... AND input text id=ttl00 ${Attl} - ... AND sleep ${sleep} - ... AND click element id=interceptionadd_addForm - ... AND sleep ${sleep} - ... AND input text id=Cname01 ${CNAMEvalue} - ... AND sleep ${sleep} - ... AND input text id=ttl01 ${CNAMEttl} - run keyword if "${QType}"=="AAAA" run keywords sleep ${sleep} - ... AND click element id=dns_qtype_radio01 - ... AND input text id=AAAA00 ${Avalue} - ... AND sleep ${sleep} - ... AND input text id=ttl00 ${Attl} - ... AND sleep ${sleep} - ... AND click element id=interceptionadd_addForm - ... AND sleep ${sleep} - ... AND input text id=Cname01 ${CNAMEvalue} - ... AND sleep ${sleep} - ... AND input text id=ttl01 ${CNAMEttl} - sleep ${sleep} - click element id=interceptionadd_shezhidns + + Replace-Action-Parameters-for1 [Arguments] ${ReplaceActionParameters} @@ -2115,7 +2048,7 @@ ProxyLogOptions [Documentation] 调用次关键字前需要添加必填参数: ... ${LogOptions}:填入All或其他 run keyword if "${LogOptions}"=="All" run keywords sleep ${sleep} - ... AND click element id=logtype1 + ... AND click element id=logType1 ... ELSE log 选择Metadata only ProxyEnabled [Arguments] ${Enabled} @@ -2131,7 +2064,24 @@ Proxy-Policies-OK sleep ${sleep} click element id=proxyManipulationSuccess sleep ${sleep} - +Edit-Filter-SecurityOrProxy + [Arguments] ${PolicyType} ${EditFilterdict} + ${typepath} Run Keyword If "${PolicyType}"=="Security Policy" set variable /html/body/div[1]/div/div[3]/div[2]/div/div[1]/form[1]/div/div[8]/div[1]/div[1]/label + ... ELSE set variable /html/body/div[1]/div/div[3]/div[2]/div/div[1]/form[1]/div/div[9]/div[1]/div[1]/label + FOR ${Var} ${Filter} IN ENUMERATE @{dict} + click element xpath=${typepath}[contains(text(), "${Filter}")]/following-sibling::div/div/i + sleep ${sleep} + input text xpath=//*[@id="condistions_protocol"]/div[2]/p[contains(text(), "${filter}")]/following-sibling::div[2]/div/div[1]/input ${EditFilterdict}[${Filter}] + sleep ${sleep} + press keys xpath=//*[@id="condistions_protocol"]/div[2]/p[contains(text(), "${filter}")]/following-sibling::div[2]/div/div[1]/input ENTER + sleep ${sleep} + click element xpath=//*[@id="condistions_protocol"]/div[2]/p[contains(text(), "${filter}")]/following-sibling::div[2]/div/div[2]/div/div/ul/li[1] + sleep ${sleep} + ${class}= Get Element Attribute xpath=xpath=${typepath}[contains(text(), "${key}")]/following-sibling::div/div class + run keyword if "${class}"=="addobject addobject-long-list float-left" log 不操作 + run keyword if "${class}"=="addobject addobject-long-list float-left obj-content-null" run keywords sleep ${sleep} + ... AND click element xpath=${typepath}[contains(text(), "${key}")]/following-sibling::div/div[2]/i + END PoliciesDelete sleep ${sleep} click element id=appDel diff --git a/02-Keyword/tsg_ui/proxyTCPOptions/ProxyTCPOptions.robot b/02-Keyword/tsg_ui/proxyTCPOptions/ProxyTCPOptions.robot index 65f2f04..5bf7d45 100644 --- a/02-Keyword/tsg_ui/proxyTCPOptions/ProxyTCPOptions.robot +++ b/02-Keyword/tsg_ui/proxyTCPOptions/ProxyTCPOptions.robot @@ -1,9 +1,53 @@ *** Settings *** Library Selenium2Library Resource ../Menu.robot -Resource ../SecurityPolicy/SourceAndDestination.robot +#Resource ../SecurityPolicy/SourceAndDestination.robot +Resource ../objects/NewObject.robot *** Keywords *** +UIAddProxyTCPOptions + [Arguments] ${TCPProxy} ${TCPClientDict} ${TCPServerDict} ${SourceInfo}=null ${DestinationInfo}=null + ${return} ${Tcpname} Run Keyword And Ignore Error Get From Dictionary ${TCPProxy} Tcpname + ${Tcpname} Run Keyword If "${return}"=="FAIL" or "${Tcpname}}"=="${EMPTY}" set variable null + ... ELSE set variable ${Tcpname} + + ${return} ${EnableTCPPassthrough} Run Keyword And Ignore Error Get From Dictionary ${TCPProxy} EnableTCPPassthrough + ${EnableTCPPassthrough} Run Keyword If "${return}"=="FAIL" or "${EnableTCPPassthrough}}"=="${EMPTY}" set variable null + ... ELSE set variable ${EnableTCPPassthrough} + + ${return} ${BypassDuplicatedPacket} Run Keyword And Ignore Error Get From Dictionary ${TCPProxy} BypassDuplicatedPacket + ${BypassDuplicatedPacket} Run Keyword If "${return}"=="FAIL" or "${BypassDuplicatedPacket}}"=="${EMPTY}" set variable null + ... ELSE set variable ${BypassDuplicatedPacket} + + Comment 打开菜单新建策略输入name + Create-Proxy-TCP-Options ${Tcpname} + #Create-Source-Button + Run Keyword If "${SourceInfo}"=="${EMPTY}" or "${SourceInfo}"=="null" log there is no SourceInfoDict + ... ELSE Create-Source-Button + Run Keyword If "${SourceInfo}"=="${EMPTY}" or "${SourceInfo}"=="null" log there is no SourceInfoDict + ... ELSE CreateEditDeleteSources ${SourceInfo} + + Run Keyword If "${DestinationInfo}"=="${EMPTY}" or "${DestinationInfo}"=="null" log there is no DestinationInfo + ... ELSE Create-Destination-Button + Run Keyword If "${DestinationInfo}"=="${EMPTY}" or "${DestinationInfo}"=="null" log there is no DestinationInfo + ... ELSE CreateEditDeleteDestination ${DestinationInfo} + Run Keyword If "${FilterInfo}"=="${EMPTY}" log there is no FilterInfo + ... ELSE Filter-create ${FilterInfo} + Run Keyword If "${EnableTCPPassthrough}"=="${EMPTY}" or "${EnableTCPPassthrough}"=="null" log there is no EnableTCPPassthrough + ... ELSE TCP-Enable-TCP-Passthrough ${EnableTCPPassthrough} + Run Keyword If "${BypassDuplicatedPacket}"=="${EMPTY}" or "${BypassDuplicatedPacket}"=="null" log there is no BypassDuplicatedPacket + ... ELSE TCP-Bypass-Duplicated-Packet ${BypassDuplicatedPacket} + TCP-Client-side-Parameters ${TCPClientDict} + TCP-Server-side-Parameters ${TCPServerDict} + TCP-OK + TCP-Assertion ${Tcpname} + +Create-Source-Button + 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 + +Create-Destination-Button + 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 + Create-Proxy-TCP-Options [Arguments] ${tcpname} sleep ${sleep} @@ -15,40 +59,628 @@ Create-Proxy-TCP-Options sleep ${sleep} input text id=advancedAdd_policyName ${tcpname} #输入name sleep ${sleep} + +CreateEditDeleteSources + [Arguments] ${SourceInfoDict} + [Documentation] 策略源条件处理、包括增加:create、search,update、delete几个列表; + ... 格式:新增:Type1=IP option=Create Add=Address name=zdhip001 Ipclienttext1=192.168.100.1 Port=1 + ... 修改:Type1=IP option=Update Add=Address name=zdhip001 Ipclienttext1=192.168.100.1 Port=1 把为name对应值的的记录修改为输入的内容 + ... 新增:Type1=Geography option=Create Add=Address name=zdhip001 Ipclienttext1=192.168.100.1 Port=1geo + ${return} ${AddList} Run Keyword And Ignore Error Get From Dictionary ${SourceInfoDict} sourceAddIpList + Run Keyword If "${return}"=="FAIL" or "${AddList}"=="${EMPTY}" log there is no CreateSource + ... ELSE CreateSources1 ${AddList} -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 ${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 +CreateSources1 + [Arguments] ${AddList} + [Documentation] 调用次关键字前需要添加必填参数: + ... ${Type1}:填入Ip或SUBID或Geography或IPLearning + ... ${CreateOrSearch}:填入Create或者Search + ... ${Add}:填入Address或Group + ... ${Name}:名称 + ... ${Ip_type}:填入Ip或者Geography或者IPLearning + ... ${Ipclienttext1}:填入IPV4或6的值或range的ip段 + ... ${Port}:填入端口 + ... ${Country}:列表形式,列表中是国家名字 + ... ${City}:列表形式,列表中是城市名字 + ... ${Protocols1}:填入HTTP或SSL或HTTPSSL + ... ${Degree}:填入1Degree或2Degree + ... ${Times}:填入小时数,例如1或2 + ... ${Numbers}:填入数值,例如1或10000 + ... ${Limits}:填入数值,例如1或10000 + ... ${ObjectName}:列表形式,列表中是对象的名字 + ... ${Keywordtext}:填入新建subid的内容 + ... 判断新建source选择用什么样的类型数据 + ${listlenth}= Get Length ${AddList} + #${tempValue} set Variable tempValue + #FOR ${var} IN RANGE ${AddList} + FOR ${var} IN RANGE ${listlenth} + log ${var} + ${tempValue} Get From List ${AddList} ${var} + CreateSource ${tempValue} + END +CreateEditDeleteDestination + [Arguments] ${DestinationInfoDict} + [Documentation] 策略源条件处理、包括增加:create、search,update、delete几个列表; + ... 格式:新增:Type1=IP option=Create Add=Address name=zdhip001 Ipclienttext1=192.168.100.1 Port=1 + ... 修改:Type1=IP option=Update Add=Address name=zdhip001 Ipclienttext1=192.168.100.1 Port=1 把为name对应值的的记录修改为输入的内容 + ... 新增:Type1=Geography option=Create Add=Address name=zdhip001 Ipclienttext1=192.168.100.1 Port=1geo + ${return} ${AddList} Run Keyword And Ignore Error Get From Dictionary ${DestinationInfoDict} destinationAddIpList + Run Keyword If "${return}"=="FAIL" or "${AddList}"=="${EMPTY}" log there is no CreateSource + ... ELSE CreateDestination1 ${AddList} + +CreateDestination1 + [Arguments] ${AddList} + [Documentation] 调用次关键字前需要添加必填参数: + ... ${Type1}:填入Ip或SUBID或Geography或IPLearning + ... ${CreateOrSearch}:填入Create或者Search + ... ${Add}:填入Address或Group + ... ${Name}:名称 + ... ${Ip_type}:填入Ip或者Geography或者IPLearning + ... ${Ipclienttext1}:填入IPV4或6的值或range的ip段 + ... ${Port}:填入端口 + ... ${Country}:列表形式,列表中是国家名字 + ... ${City}:列表形式,列表中是城市名字 + ... ${Protocols1}:填入HTTP或SSL或HTTPSSL + ... ${Degree}:填入1Degree或2Degree + ... ${Times}:填入小时数,例如1或2 + ... ${Numbers}:填入数值,例如1或10000 + ... ${Limits}:填入数值,例如1或10000 + ... ${ObjectName}:列表形式,列表中是对象的名字 + ... ${Keywordtext}:填入新建subid的内容 + ... 判断新建source选择用什么样的类型数据 + ${listlenth}= Get Length ${AddList} + #${tempValue} set Variable tempValue + #FOR ${var} IN RANGE ${AddList} + FOR ${var} IN RANGE ${listlenth} + log ${var} + ${tempValue} Get From List ${AddList} ${var} + Create-Destination ${tempValue} + END + +CreateSource + [Arguments] ${AddDict} + #[Arguments] ${PolicyType}=null ${Type1}=null ${CreateOrSearch}=null ${Add}=null ${Name}=null + #... ${ObjectName}=null ${Ipclienttext1}=null ${Port}=null ${Country}=null ${City}=null + #... ${Protocols1}=null ${Degree}=null ${Times}=null ${Numbers}=null ${Limits}=null ${Keywordtext}=null + [Documentation] 调用次关键字前需要添加必填参数: + ... ${PolicyType}:填入安全策略或管控策略或tcp策略中前置元素:安全和代理源:/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[4] 安全和代理目的:/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[5] + ... tcp源:/html/body/div[1]/div/div[3]/div[2]/div/div/div[1]/div[1]/div/div[2]/form/div[2] + ... tcp目的:/html/body/div[1]/div/div[3]/div[2]/div/div/div[1]/div[1]/div/div[2]/form/div[3] + ... ${Type1}:填入Ip或SUBID或Geography或IPLearning + ... ${CreateOrSearch}:填入Create或者Search + ... ${Add}:填入Address或Group + ... ${Name}:名称 + ... ${Ip_type}:填入Ip或者Geography或者IPLearning + ... ${Ipclienttext1}:填入IPV4或6的值或range的ip段 + ... ${Port}:填入端口 + ... ${Country}:列表形式,列表中是国家名字 + ... ${City}:列表形式,列表中是城市名字 + ... ${Protocols1}:填入HTTP或SSL或HTTPSSL + ... ${Degree}:填入1Degree或2Degree + ... ${Times}:填入小时数,例如1或2 + ... ${Numbers}:填入数值,例如1或10000 + ... ${Limits}:填入数值,例如1或10000 + ... ${ObjectName}:列表形式,列表中是对象的名字 + ... ${Keywordtext}:填入新建subid的内容 + ... 判断新建source选择用什么样的类型数据 + #调用次关键字前需要添加必填参数: + ${return} ${Sordtype} Run Keyword And Ignore Error Get From Dictionary ${AddDict} Sordtype + ${Sordtype} Run Keyword If "${return}"=="FAIL" or "${Sordtype}"=="${EMPTY}" set variable Source + ... ELSE set variable ${Sordtype} + ${typepath} Run Keyword If "${Sordtype}"=="Source" set variable /html/body/div[1]/div/div[3]/div[2]/div/div/div[1]/div[1]/div/div[2]/form/div[2] + ... ELSE set variable /html/body/div[1]/div/div[3]/div[2]/div/div/div[1]/div[1]/div/div[2]/form/div[3] + + ${return} ${Type1} Run Keyword And Ignore Error Get From Dictionary ${AddDict} Type1 + ${Type1} Run Keyword If "${return}"=="FAIL" or "${Type1}"=="${EMPTY}" set variable IP + ... ELSE set variable ${Type1} + ${return} ${CreateOrSearch} Run Keyword And Ignore Error Get From Dictionary ${AddDict} CreateOrSearch + ${CreateOrSearch} Run Keyword If "${return}"=="FAIL" or "${CreateOrSearch}"=="${EMPTY}" set variable Create + ... ELSE set variable ${CreateOrSearch} + ${return} ${Add} Run Keyword And Ignore Error Get From Dictionary ${AddDict} Add + ${Add} Run Keyword If "${return}"=="FAIL" or "${Add}"=="${EMPTY}" set variable Add + ... ELSE set variable ${Add} + ${return} ${ObjectName} Run Keyword And Ignore Error Get From Dictionary ${AddDict} ObjectName + ${ObjectName} Run Keyword If "${return}"=="FAIL" or "${ObjectName}"=="${EMPTY}" set variable null + ... ELSE set variable ${ObjectName} + ${return} ${Name} Run Keyword And Ignore Error Get From Dictionary ${AddDict} Name + ${Name} Run Keyword If "${return}"=="FAIL" or "${Name}"=="${EMPTY}" set variable null + ... ELSE set variable ${Name} + ${return} ${Ipclienttext1} Run Keyword And Ignore Error Get From Dictionary ${AddDict} Ipclienttext1 + ${Ipclienttext1} Run Keyword If "${return}"=="FAIL" or "${Ipclienttext1}"=="${EMPTY}" set variable null + ... ELSE set variable ${Ipclienttext1} + ${return} ${Port} Run Keyword And Ignore Error Get From Dictionary ${AddDict} Port + ${Port} Run Keyword If "${return}"=="FAIL" or "${Port}"=="${EMPTY}" set variable null + ... ELSE set variable ${Port} + ${return} ${Country} Run Keyword And Ignore Error Get From Dictionary ${AddDict} Country + ${Country} Run Keyword If "${return}"=="FAIL" or "${Country}"=="${EMPTY}" set variable null + ... ELSE set variable ${Country} + ${return} ${City} Run Keyword And Ignore Error Get From Dictionary ${AddDict} City + ${City} Run Keyword If "${return}"=="FAIL" or "${City}"=="${EMPTY}" set variable null + ... ELSE set variable ${City} + ${return} ${Fqdn} Run Keyword And Ignore Error Get From Dictionary ${AddDict} Fqdn + ${Fqdn} Run Keyword If "${return}"=="FAIL" or "${Fqdn}"=="${EMPTY}" set variable null + ... ELSE set variable ${Fqdn} + ${return} ${Protocols1} Run Keyword And Ignore Error Get From Dictionary ${AddDict} Protocols1 + ${Protocols1} Run Keyword If "${return}"=="FAIL" or "${Protocols1}"=="${EMPTY}" set variable null + ... ELSE set variable ${Protocols1} + ${return} ${Degree} Run Keyword And Ignore Error Get From Dictionary ${AddDict} Degree + ${Degree} Run Keyword If "${return}"=="FAIL" or "${Degree}"=="${EMPTY}" set variable null + ... ELSE set variable ${Degree} + ${return} ${Times} Run Keyword And Ignore Error Get From Dictionary ${AddDict} Times + ${Times} Run Keyword If "${return}"=="FAIL" or "${Times}"=="${EMPTY}" set variable null + ... ELSE set variable ${Times} + ${return} ${Numbers} Run Keyword And Ignore Error Get From Dictionary ${AddDict} Numbers + ${Numbers} Run Keyword If "${return}"=="FAIL" or "${Numbers}"=="${EMPTY}" set variable null + ... ELSE set variable ${Numbers} + ${return} ${Limits} Run Keyword And Ignore Error Get From Dictionary ${AddDict} Limits + ${Limits} Run Keyword If "${return}"=="FAIL" or "${Limits}"=="${EMPTY}" set variable null + ... ELSE set variable ${Limits} + ${return} ${Keywordtext} Run Keyword And Ignore Error Get From Dictionary ${AddDict} Keywordtext + ${Keywordtext} Run Keyword If "${return}"=="FAIL" or "${Keywordtext}"=="${EMPTY}" set variable null + ... ELSE set variable ${Keywordtext} + run keyword if "${Type1}"=="Ip" run keywords sleep ${sleep} + ... AND click element xpath=${typepath}/div[2]/div[1]/div[2]/div[1]/div/div/div/div[1]/div/div/div/div[1] ... AND sleep ${sleep} - ... AND Create-Source ${policytype} ${type1} ${CreateOrSearch} ${Add} ${name} - ... ${object_name} ${ipclienttext1} ${post} ${Country} ${City} - ... ${Protocols1} ${Degree} ${times} ${numbers} ${limits} ${keywordtext} - ... ELSE log 不添加源ip -TCPDestination - [Arguments] ${Destination}=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,${Destination}=yes,为添加目的ip,否则不添加目的ip + ... AND sleep ${sleep} + ... AND SourceIPCreateOrSearch ${typepath} ${CreateOrSearch} ${Add} ${Type1} ${Name} ${ObjectName} ${Ipclienttext1} ${Port} ${Country} ${City} ${Fqdn} ${Protocols1} ${Degree} ${Times} ${Numbers} ${Limits} + ... ELSE IF "${Type1}"=="SUBID" run keywords sleep ${sleep} + ... AND click element xpath=${typepath}/div[2]/div[1]/div[2]/div[1]/div/div/div/div[1]/div/div/div/div[2] + ... AND sleep ${sleep} + ... AND SUBIDCreateOrSearch ${typepath} ${CreateOrSearch} ${Add} ${Name} ${Keywordtext} ${ObjectName} + ... ELSE IF "${Type1}"=="Geography" run keywords sleep ${sleep} + ... AND click element xpath=${typepath}/div[2]/div[1]/div[2]/div[1]/div/div/div/div[1]/div/div/div/div[3] + ... AND sleep ${sleep} + ... AND SourceIPCreateOrSearch ${typepath} ${CreateOrSearch} ${Add} ${Type1} ${Name} ${ObjectName} ${Ipclienttext1} ${Port} ${Country} ${City} ${Fqdn} ${Protocols1} ${Degree} ${Times} ${Numbers} ${Limits} + ... ELSE IF "${Type1}"=="IPLearning" run keywords sleep ${sleep} + ... AND click element xpath=${typepath}/div[2]/div[1]/div[2]/div[1]/div/div/div/div[1]/div/div/div/div[4] + ... AND sleep ${sleep} + ... AND SourceIPCreateOrSearch ${typepath} ${CreateOrSearch} ${Add} ${Type1} ${Name} ${ObjectName} ${Ipclienttext1} ${Port} ${Country} ${City} ${Fqdn} ${Protocols1} ${Degree} ${Times} ${Numbers} ${Limits} + +SourceIPCreateOrSearch + [Arguments] ${PolicyType} ${CreateOrSearch} ${Add} ${Ip_type} ${Name} ${ObjectName} ${Ipclienttext1} + ... ${Port} ${Country} ${City} ${Fqdn} ${Protocols1} ${Degree} ${Times} ${Numbers} ${Limits} + [Documentation] 调用次关键字前需要添加必填参数: + ... ${CreateOrSearch}:填入Create或者Search + ... ${Add}:填入Address或Group + ... ${Name}:名称 + ... ${Ip_type}:填入Ip或者Geography或者IPLearning + ... ${Ipclienttext1}:填入IPV4或6的值或range的ip段 + ... ${Port}:填入端口 + ... ${Country}:列表形式,列表中是国家名字 + ... ${City}:列表形式,列表中是城市名字 + ... ${Protocols1}:填入HTTP或SSL或HTTPSSL + ... ${Degree}:填入1Degree或2Degree + ... ${Times}:填入小时数,例如1或2 + ... ${Numbers}:填入数值,例如1或10000 + ... ${Limits}:填入数值,例如1或10000 + ... ${ObjectName}:列表形式,列表中是对象的名字 + ... 判断是新建ip还是搜索添加ip + run keyword if "${CreateOrSearch}"=="Create" run keywords sleep ${sleep} + ... AND click element id=interceptionadd_proaddaddSource + ... AND SourceIPAdd ${PolicyType} ${Add} ${Ip_type} ${Name} ${ObjectName} ${Ipclienttext1} ${Port} ${Country} ${City} ${Fqdn} ${Protocols1} ${Degree} ${Times} ${Numbers} ${Limits} + ... ELSE IF "${CreateOrSearch}"=="Search" run keywords sleep ${sleep} + ... AND SourceSearch ${PolicyType} ${ObjectName} +Create-Destination + [Arguments] ${AddDict} + # ${PolicyType}=null ${Type1}=null ${CreateOrSearch}=null ${Add}=null ${Name}=null + # ... ${ObjectName}=null ${Ipclienttext1}=null ${Port}=null ${Country}=null ${City}=null + # ... ${Protocols1}=null ${Degree}=null ${Times}=null ${Numbers}=null ${Limits}=null ${Keywordtext}=null + [Documentation] 调用次关键字前需要添加必填参数: + ... ${Type1}:填入Ip或SUBID或Geography或IPLearning + ... ${CreateOrSearch}:填入Create或者Search + ... ${Add}:填入Address或Group + ... ${Name}:名称 + ... ${Ip_type}:填入Ip或者Geography或者IPLearning + ... ${Ipclienttext1}:填入IPV4或6的值或range的ip段 + ... ${Port}:填入端口 + ... ${Country}:列表形式,列表中是国家名字 + ... ${City}:列表形式,列表中是城市名字 + ... ${Protocols1}:填入HTTP或SSL或HTTPSSL + ... ${Degree}:填入1Degree或2Degree + ... ${Times}:填入小时数,例如1或2 + ... ${Numbers}:填入数值,例如1或10000 + ... ${Limits}:填入数值,例如1或10000 + ... ${ObjectName}:列表形式,列表中是对象的名字 + ... ${Keywordtext}:填入新建subid的内容 + ... 判断新建source选择用什么样的类型数据 + #调用次关键字前需要添加必填参数: + ${return} ${Sordtype} Run Keyword And Ignore Error Get From Dictionary ${AddDict} Sordtype + ${Sordtype} Run Keyword If "${return}"=="FAIL" or "${Sordtype}"=="${EMPTY}" set variable Source + ... ELSE set variable ${Sordtype} + ${typepath} Run Keyword If "${Sordtype}"=="Source" set variable /html/body/div[1]/div/div[3]/div[2]/div/div/div[1]/div[1]/div/div[2]/form/div[2] + ... ELSE set variable /html/body/div[1]/div/div[3]/div[2]/div/div/div[1]/div[1]/div/div[2]/form/div[3] + + ${return} ${Type1} Run Keyword And Ignore Error Get From Dictionary ${AddDict} Type1 + ${Type1} Run Keyword If "${return}"=="FAIL" or "${Type1}"=="${EMPTY}" set variable IP + ... ELSE set variable ${Type1} + ${return} ${CreateOrSearch} Run Keyword And Ignore Error Get From Dictionary ${AddDict} CreateOrSearch + ${CreateOrSearch} Run Keyword If "${return}"=="FAIL" or "${CreateOrSearch}"=="${EMPTY}" set variable Create + ... ELSE set variable ${CreateOrSearch} + ${return} ${Add} Run Keyword And Ignore Error Get From Dictionary ${AddDict} Add + ${Add} Run Keyword If "${return}"=="FAIL" or "${Add}"=="${EMPTY}" set variable Add + ... ELSE set variable ${Add} + ${return} ${ObjectName} Run Keyword And Ignore Error Get From Dictionary ${AddDict} ObjectName + ${ObjectName} Run Keyword If "${return}"=="FAIL" or "${ObjectName}"=="${EMPTY}" set variable null + ... ELSE set variable ${ObjectName} + ${return} ${Name} Run Keyword And Ignore Error Get From Dictionary ${AddDict} Name + ${Name} Run Keyword If "${return}"=="FAIL" or "${Name}"=="${EMPTY}" set variable null + ... ELSE set variable ${Name} + ${return} ${Ipclienttext1} Run Keyword And Ignore Error Get From Dictionary ${AddDict} Ipclienttext1 + ${Ipclienttext1} Run Keyword If "${return}"=="FAIL" or "${Ipclienttext1}"=="${EMPTY}" set variable null + ... ELSE set variable ${Ipclienttext1} + ${return} ${Port} Run Keyword And Ignore Error Get From Dictionary ${AddDict} Port + ${Port} Run Keyword If "${return}"=="FAIL" or "${Port}"=="${EMPTY}" set variable null + ... ELSE set variable ${Port} + ${return} ${Country} Run Keyword And Ignore Error Get From Dictionary ${AddDict} Country + ${Country} Run Keyword If "${return}"=="FAIL" or "${Country}"=="${EMPTY}" set variable null + ... ELSE set variable ${Country} + ${return} ${City} Run Keyword And Ignore Error Get From Dictionary ${AddDict} City + ${City} Run Keyword If "${return}"=="FAIL" or "${City}"=="${EMPTY}" set variable null + ... ELSE set variable ${City} + ${return} ${Fqdn} Run Keyword And Ignore Error Get From Dictionary ${AddDict} Fqdn + ${Fqdn} Run Keyword If "${return}"=="FAIL" or "${Fqdn}"=="${EMPTY}" set variable null + ... ELSE set variable ${Fqdn} + ${return} ${Protocols1} Run Keyword And Ignore Error Get From Dictionary ${AddDict} Protocols1 + ${Protocols1} Run Keyword If "${return}"=="FAIL" or "${Protocols1}"=="${EMPTY}" set variable null + ... ELSE set variable ${Protocols1} + ${return} ${Degree} Run Keyword And Ignore Error Get From Dictionary ${AddDict} Degree + ${Degree} Run Keyword If "${return}"=="FAIL" or "${Degree}"=="${EMPTY}" set variable null + ... ELSE set variable ${Degree} + ${return} ${Times} Run Keyword And Ignore Error Get From Dictionary ${AddDict} Times + ${Times} Run Keyword If "${return}"=="FAIL" or "${Times}"=="${EMPTY}" set variable null + ... ELSE set variable ${Times} + ${return} ${Numbers} Run Keyword And Ignore Error Get From Dictionary ${AddDict} Numbers + ${Numbers} Run Keyword If "${return}"=="FAIL" or "${Numbers}"=="${EMPTY}" set variable null + ... ELSE set variable ${Numbers} + ${return} ${Limits} Run Keyword And Ignore Error Get From Dictionary ${AddDict} Limits + ${Limits} Run Keyword If "${return}"=="FAIL" or "${Limits}"=="${EMPTY}" set variable null + ... ELSE set variable ${Limits} + run keyword if "${Type1}"=="Ip" run keywords sleep ${sleep} + ... AND click element xpath=${typepath}/div[2]/div[1]/div[2]/div[1]/div/div/div/div[1]/div/div/div/div[1] + ... AND sleep ${sleep} + ... AND sleep ${sleep} + ... AND DestinationIPCreateOrSearch ${typepath} ${CreateOrSearch} ${Add} ${Type1} ${Name} ${ObjectName} ${Ipclienttext1} ${Port} ${Country} ${City} ${Fqdn} ${Protocols1} ${Degree} ${Times} ${Numbers} ${Limits} + ... ELSE IF "${Type1}"=="Geography" run keywords sleep ${sleep} + ... AND click element xpath=${typepath}/div[2]/div[1]/div[2]/div[1]/div/div/div/div[1]/div/div/div/div[2] + ... AND sleep ${sleep} + ... AND DestinationIPCreateOrSearch ${typepath} ${CreateOrSearch} ${Add} ${Type1} ${Name} ${ObjectName} ${Ipclienttext1} ${Port} ${Country} ${City} ${Fqdn} ${Protocols1} ${Degree} ${Times} ${Numbers} ${Limits} + ... ELSE IF "${Type1}"=="IPLearning" run keywords sleep ${sleep} + ... AND click element xpath=${typepath}/div[2]/div[1]/div[2]/div[1]/div/div/div/div[1]/div/div/div/div[3] + ... AND sleep ${sleep} + ... AND DestinationIPCreateOrSearch ${typepath} ${CreateOrSearch} ${Add} ${Type1} ${Name} ${ObjectName} ${Ipclienttext1} ${Port} ${Country} ${City} ${Fqdn} ${Protocols1} ${Degree} ${Times} ${Numbers} ${Limits} + +SourceIPCreateOrSearch + [Arguments] ${PolicyType} ${CreateOrSearch} ${Add} ${Ip_type} ${Name} ${ObjectName} ${Ipclienttext1} + ... ${Port} ${Country} ${City} ${Fqdn} ${Protocols1} ${Degree} ${Times} ${Numbers} ${Limits} + [Documentation] 调用次关键字前需要添加必填参数: + ... ${CreateOrSearch}:填入Create或者Search + ... ${Add}:填入Address或Group + ... ${Name}:名称 + ... ${Ip_type}:填入Ip或者Geography或者IPLearning + ... ${Ipclienttext1}:填入IPV4或6的值或range的ip段 + ... ${Port}:填入端口 + ... ${Country}:列表形式,列表中是国家名字 + ... ${City}:列表形式,列表中是城市名字 + ... ${Protocols1}:填入HTTP或SSL或HTTPSSL + ... ${Degree}:填入1Degree或2Degree + ... ${Times}:填入小时数,例如1或2 + ... ${Numbers}:填入数值,例如1或10000 + ... ${Limits}:填入数值,例如1或10000 + ... ${ObjectName}:列表形式,列表中是对象的名字 + ... 判断是新建ip还是搜索添加ip + run keyword if "${CreateOrSearch}"=="Create" run keywords sleep ${sleep} + ... AND click element id=interceptionadd_proaddaddSource + ... AND SourceIPAdd ${PolicyType} ${Add} ${Ip_type} ${Name} ${ObjectName} ${Ipclienttext1} ${Port} ${Country} ${City} ${Fqdn} ${Protocols1} ${Degree} ${Times} ${Numbers} ${Limits} + ... ELSE IF "${CreateOrSearch}"=="Search" run keywords sleep ${sleep} + ... AND SourceSearch ${PolicyType} ${ObjectName} +SUBIDCreateOrSearch + [Arguments] ${PolicyType} ${CreateOrSearch} ${Add} ${Name} ${Keywordtext} ${ObjectName} + [Documentation] 调用次关键字前需要添加必填参数: + ... ${CreateOrSearch}:填入Create或者Search + ... ${Name}:名称 + ... ${Keywordtext}:填入新建subid的内容 + ... ${ObjectName}:列表形式,列表中是对象的名字 + ... 判断是新建subid还是搜索添加subid + run keyword if "${CreateOrSearch}"=="Create" run keywords sleep ${sleep} + ... AND click element id=interceptionadd_proaddaddSource + ... AND SUBIDAdd ${PolicyType} ${Add} ${Name} ${Keywordtext} ${ObjectName} + ... ELSE IF "${CreateOrSearch}"=="Search" run keywords sleep ${sleep} + ... AND SourceSearch ${PolicyType} ${ObjectName} +DestinationIPCreateOrSearch + [Arguments] ${PolicyType} ${CreateOrSearch} ${Add} ${Ip_type} ${Name} ${ObjectName} ${Ipclienttext1} + ... ${Port} ${Country} ${City} ${Fqdn} ${Protocols1} ${Degree} ${Times} ${Numbers} ${Limits} + [Documentation] 调用次关键字前需要添加必填参数: + ... ${CreateOrSearch}:填入Create或者Search + ... ${Add}:填入Address或Group + ... ${Name}:名称 + ... ${Ip_type}:填入Ip或者Geography或者IPLearning + ... ${Ipclienttext1}:填入IPV4或6的值或range的ip段 + ... ${Port}:填入端口 + ... ${Country}:列表形式,列表中是国家名字 + ... ${City}:列表形式,列表中是城市名字 + ... ${Protocols1}:填入HTTP或SSL或HTTPSSL + ... ${Degree}:填入1Degree或2Degree + ... ${Times}:填入小时数,例如1或2 + ... ${Numbers}:填入数值,例如1或10000 + ... ${Limits}:填入数值,例如1或10000 + ... ${ObjectName}:列表形式,列表中是对象的名字 + ... 判断是新建ip还是搜索添加ip + run keyword if "${CreateOrSearch}"=="Create" run keywords sleep ${sleep} + ... AND click element id=interceptionadd_proaddaddDestination + ... AND DestinationIPAdd ${PolicyType} ${Add} ${Ip_type} ${Name} ${ObjectName} ${Ipclienttext1} ${Port} ${Country} ${City} ${Fqdn} ${Protocols1} ${Degree} ${Times} ${Numbers} ${Limits} + ... ELSE IF "${CreateOrSearch}"=="Search" run keywords sleep ${sleep} + ... AND DestinationSearch ${PolicyType} ${ObjectName} +SourceSearch + [Arguments] ${PolicyType} ${Name} + [Documentation] 调用次关键字前需要添加必填参数: + ... ${Name}:填入是一个列表,列表内容为source的name + ... 选择search对象 + FOR ${i} IN @{name} + input text xpath=${PolicyType}/div[2]/div[1]/div[2]/div[2]/div/div[1]/input ${i} + sleep ${sleep} + press keys xpath=${PolicyType}/div[2]/div[1]/div[2]/div[2]/div/div[1]/input ENTER + sleep ${sleep} + click element xpath=${PolicyType}/div[2]/div[1]/div[2]/div[2]/div/div[2]/div/div/ul/li[1] + sleep ${sleep} + END +DestinationSearch + [Arguments] ${PolicyType} ${Name} + [Documentation] 调用次关键字前需要添加必填参数: + ... ${Name}:填入是一个列表,列表内容为source的name + ... 选择search对象 + FOR ${i} IN @{name} + input text xpath=${PolicyType}/div[2]/div[1]/div[2]/div[2]/div/div[1]/input ${i} + sleep ${sleep} + press keys xpath=${PolicyType}/div[2]/div[1]/div[2]/div[2]/div/div[1]/input ENTER + sleep ${sleep} + click element xpath=${PolicyType}/div[2]/div[1]/div[2]/div[2]/div/div[2]/div/div/ul/li[1] + sleep ${sleep} + END + +SUBIDAdd + [Arguments] ${PolicyType} ${Add} ${Name} ${Keywordtext} ${ObjectName} + [Documentation] 调用次关键字前需要添加必填参数: + ... ${Add}:填入Address或Group + ... ${Name}:名称 + ... ${Keywordtext}:填入新建subid的内容 + ... ${ObjectName}:列表形式,列表中是对象的名字 + ... 判断是新建subid还是新建subid分组 + run keyword if "${Add}"=="Address" run keywords sleep ${sleep} + ... AND click element xpath=/html/body/ul/li[1] + ... AND sleep ${sleep} + ... AND SUBAddress ${PolicyType} ${Name} ${Keywordtext} + ... ELSE IF "${Add}"=="Group" run keywords sleep ${sleep} + ... AND click element xpath=/html/body/ul/li[2] + ... AND sleep ${sleep} + ... AND SUBGroupAdd ${PolicyType} ${Name} ${ObjectName} +SUBAddress + [Arguments] ${PolicyType} ${Name} ${Keywordtext} + [Documentation] 调用次关键字前需要添加必填参数: + ... ${Name}:名称 + ... ${Keywordtext}:填入新建subid的内容 + ... 新建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 ${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 + Create-SubscriberID-text ${Keywordtext} + sleep ${sleep} + click element xpath=${PolicyType}/div[2]/div[2]/div/div[2]/button[1] + +SUBGroupAdd + [Arguments] ${PolicyType} ${Name} ${ObjectName} + [Documentation] 调用次关键字前需要添加必填参数: + ... ${Name}:名称 + ... ${ObjectName}:列表形式,列表中是对象的名字 + ... 新建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 ${sleep} + Create-Sub-Objects ${ObjectName} + click element xpath=${PolicyType}/div[2]/div[2]/div/div[2]/button[1] +SourceIPAdd + [Arguments] ${PolicyType} ${Add} ${Ip_type} ${Name} ${ObjectName} ${Ipclienttext1} ${Port} ${Country} ${City} ${Fqdn} ${Protocols1} ${Degree} ${Times} ${Numbers} ${Limits} + [Documentation] 调用次关键字前需要添加必填参数: + ... ${Add}:填入Address或Group + ... ${Ip_type}:填入IP或者Geography或者IPLearning + ... 判断是新建ip还是新建ip分组 + run keyword if "${Add}"=="Address" run keywords sleep ${sleep} + ... AND click element xpath=/html/body/ul/li[1] ... AND sleep ${sleep} - ... AND Create-Destination ${policytype} ${type1} ${CreateOrSearch} ${Add} ${name} - ... ${object_name} ${ipclienttext1} ${post} ${Country} ${City} - ... ${Protocols1} ${Degree} ${times} ${numbers} ${limits} ${keywordtext} - ... ELSE log 不添加目的ip -TCPFilter - [Arguments] ${Filtercreate} ${SNIname} ${Filter}=yes - #判断是否添加Filter,${Filter}=yes,为添加Filter,否则不添加Filter - run keyword if "${Filter}"=="yes" run keywords sleep ${sleep} - ... AND Filter-create ${Filtercreate} ${SNIname} - ... ELSE log 不添加Filter + ... AND SourceIPAddress ${PolicyType} ${Name} ${Ip_type} ${Ipclienttext1} ${Port} ${Country} ${City} ${Fqdn} ${Protocols1} ${Degree} ${Times} ${Numbers} ${Limits} + ... ELSE IF "${Add}"=="Group" run keywords sleep ${sleep} + ... AND click element xpath=/html/body/ul/li[2] + ... AND sleep ${sleep} + ... AND SourceIPGroupAdd ${PolicyType} ${Name} ${Ip_type} ${ObjectName} +SourceIPAddress + [Arguments] ${PolicyType} ${Name} ${Ip_type} ${Ipclienttext1} ${Port} ${Country} ${City} ${Fqdn} ${Protocols1} ${Degree} ${Times} ${Numbers} ${Limits} + [Documentation] 调用次关键字前需要添加必填参数: + ... ${Name}:名称 + ... ${Ip_type}:填入Ip或者Geography或者IPLearning + ... ${Ipclienttext1}:填入IPV4或6的值或range的ip段 + ... ${Port}:填入端口 + ... ${Country}:列表形式,列表中是国家名字 + ... ${City}:列表形式,列表中是城市名字 + ... ${Protocols1}:填入HTTP或SSL或HTTPSSL + ... ${Degree}:填入1Degree或2Degree + ... ${Times}:填入小时数,例如1或2 + ... ${Numbers}:填入数值,例如1或10000 + ... ${Limits}:填入数值,例如1或10000 + ... 判断 新建选择用什么样的类型,并进行新建 + SourceCreate-name ${Name} + sleep ${sleep} + run keyword if "${Ip_type}"=="Ip" run keywords click element xpath=${PolicyType}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[4]/div/div[1] + ... AND sleep ${sleep} + ... AND NewObject.Create-ip-ClientIP-text ${Ipclienttext1} ${Port} + run keyword if "${Ip_type}"=="Geography" run keywords click element xpath=${PolicyType}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[3]/div/div/label[2] + ... AND sleep ${sleep} + ... AND click element xpath=${PolicyType}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[4]/div/div[1]/div[2] + ... AND sleep ${sleep} + ... AND NewObject.Create-Geography ${Country} ${City} + ... AND sleep ${sleep} + ... AND click element xpath=${PolicyType}/div[2]/div[2]/div/div[1]/div[10]/div/div/div/div[4]/button + ... AND sleep ${sleep} + run keyword if "${Ip_type}"=="IPLearning" run keywords click element xpath=${PolicyType}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[3]/div/div/label[3] + ... AND sleep ${sleep} + ... AND click element xpath=${PolicyType}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[4]/div/div[1] + ... AND sleep ${sleep} + ... AND input text xpath=${PolicyType}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[4]/div/div[3]/div/div[1]/div[2]/div[1]/div[1]/form/div[1]/div/div[1]/input ${Fqdn} + ... AND sleep ${sleep} + ... AND click element xpath=//*[@id="policy_Manipulation2"]/div[1]/div[1]/div[2]/form/div[5]/div[1]/div/div/div[2] + ... AND sleep ${sleep} + ... AND ProxyTCPOptions.Learn-From-Protocols ${Protocols1} + ... AND ProxyTCPOptions.Learning-Depth ${PolicyType} ${Degree} + ... AND sleep ${sleep} + ... AND input text xpath=//*[@id="policy_Manipulation2"]/div[1]/div[1]/div[2]/form/div[5]/div[3]/div/div[1]/input ${Times} + ... AND sleep ${sleep} + ... AND input text xpath=//*[@id="policy_Manipulation2"]/div[1]/div[1]/div[2]/form/div[5]/div[4]/div/div[1]/input ${Numbers} + ... AND sleep ${sleep} + ... AND input text xpath=//*[@id="policy_Manipulation2"]/div[1]/div[1]/div[2]/form/div[5]/div[5]/div/div[1]/input ${Limits} + ... AND sleep ${sleep} + sleep ${sleep} + SourceCreate-ok + +DestinationIPAdd + [Arguments] ${PolicyType} ${Add} ${Ip_type} ${Name} ${ObjectName} ${Ipclienttext1} ${Port} ${Country} ${City} ${Fqdn} ${Protocols1} ${Degree} ${Times} ${Numbers} ${Limits} + [Documentation] 调用次关键字前需要添加必填参数: + ... ${Add}:填入Address或Group + ... ${Ip_type}:填入IP或者Geography或者IPLearning + ... 判断是新建ip还是新建ip分组 + run keyword if "${Add}"=="Address" run keywords sleep ${sleep} + ... AND click element xpath=/html/body/ul[contains(@id,'dropdown-menu' )and @x-placement='bottom-start']/child::li[1] + ... AND sleep ${sleep} + ... AND DestinationIPAddress ${PolicyType} ${Name} ${Ip_type} ${Ipclienttext1} ${Port} ${Country} ${City} ${Fqdn} ${Protocols1} ${Degree} ${Times} ${Numbers} ${Limits} + ... ELSE IF "${Add}"=="Group" run keywords sleep ${sleep} + ... AND click element xpath=/html/body/ul[contains(@id,'dropdown-menu' )and @x-placement='bottom-start']/child::li[2] + ... AND sleep ${sleep} + ... AND DestinationIPGroupAdd ${PolicyType} ${Name} ${Ip_type} ${ObjectName} +DestinationIPAddress + [Arguments] ${PolicyType} ${Name} ${Ip_type} ${Ipclienttext1} ${Port} ${Country} ${City} ${Fqdn} ${Protocols1} ${Degree} ${Times} ${Numbers} ${Limits} + [Documentation] 调用次关键字前需要添加必填参数: + ... ${Name}:名称 + ... ${Ip_type}:填入Ip或者Geography或者IPLearning + ... ${Ipclienttext1}:填入IPV4或6的值或range的ip段 + ... ${Port}:填入端口 + ... ${Country}:列表形式,列表中是国家名字 + ... ${City}:列表形式,列表中是城市名字 + ... ${Protocols1}:填入HTTP或SSL或HTTPSSL + ... ${Degree}:填入1Degree或2Degree + ... ${Times}:填入小时数,例如1或2 + ... ${Numbers}:填入数值,例如1或10000 + ... ${Limits}:填入数值,例如1或10000 + ... 判断 新建选择用什么样的类型,并进行新建 + DestinationCreate-name ${PolicyType} ${Name} + sleep ${sleep} + run keyword if "${Ip_type}"=="Ip" run keywords click element xpath=${PolicyType}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[4]/div/div[1] + ... AND sleep ${sleep} + ... AND NewObject.Create-ip-ClientIP-text ${Ipclienttext1} ${Port} + run keyword if "${Ip_type}"=="Geography" run keywords click element xpath=${PolicyType}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[3]/div/div/label[2] + ... AND sleep ${sleep} + ... AND click element xpath=${PolicyType}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[4]/div/div[1]/div[2] + ... AND sleep ${sleep} + ... AND NewObject.Create-Geography ${Country} ${City} + ... AND sleep ${sleep} + ... AND click element id=interceptionadd_allcancelobjec3t + ... AND sleep ${sleep} + run keyword if "${Ip_type}"=="IPLearning" run keywords click element xpath=${PolicyType}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[3]/div/div/label[3] + ... AND sleep ${sleep} + ... AND click element xpath=${PolicyType}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[4]/div/div[1] + ... AND sleep ${sleep} + ... AND input text xpath=${PolicyType}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[4]/div/div[3]/div/div[1]/div[2]/div[1]/div[1]/form/div[1]/div/div[1]/input ${Fqdn} + ... AND sleep ${sleep} + ... AND click element xpath=${PolicyType}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[5]/div[1]/div/div/div[2] + ... AND sleep ${sleep} + ... AND ProxyTCPOptions.Learn-From-Protocols ${Protocols1} + ... AND ProxyTCPOptions.Learning-Depth ${PolicyType} ${Degree} + ... 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 ${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 ${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 ${sleep} + DestinationCreate-ok ${PolicyType} +Learn-From-Protocols + [Arguments] ${Protocols1} + [Documentation] 调用次关键字前需要添加必填参数: + ... ${Protocols1}:填入HTTP或SSL或者HTTPSSL + ... 判断选择用什么样的协议 + run keyword if "${Protocols1}"=="HTTP" run keywords sleep ${sleep} + ... AND click element xpath=/html/body/div/div[1]/div[1]/ul/li[1] + run keyword if "${Protocols1}"=="SSL" run keywords sleep ${sleep} + ... AND click element xpath=/html/body/div/div[1]/div[1]/ul/li[2] + run keyword if "${Protocols1}"=="HTTPSSL" run keywords sleep ${sleep} + ... AND click element xpath=/html/body/div/div[1]/div[1]/ul/li[1] + ... AND sleep ${sleep} + ... AND click element xpath=/html/body/div/div[1]/div[1]/ul/li[2] + +Learning-Depth + [Arguments] ${PolicyType} ${Degree} + [Documentation] 调用次关键字前需要添加必填参数: + ... ${Degree}:填入1Degree或2Degree + ... 判断是用1Degree或2Degree + run keyword if "${Degree}"=="1Degree" run keywords sleep ${sleep} + ... AND click element xpath=${PolicyType}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[5]/div[2]/div/div/label[1] + run keyword if "${Degree}"=="2Degree" run keywords sleep ${sleep} + ... AND click element xpath=${PolicyType}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[5]/div[2]/div/div/label[2] + +SourceIPGroupAdd + [Arguments] ${PolicyType} ${Name} ${Ip_type} ${ObjectName} + [Documentation] 调用次关键字前需要添加必填参数: + ... ${Name}:名称 + ... ${Ip_type}:填入Ip或者Geography + ... ${ObjectName}:列表形式,列表中是对象的名字 + SourceCreate-name ${Name} + Select-ip_type ${Ip_type} + sleep ${sleep} + click element xpath=${PolicyType}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[4]/div/div/div[2] + Create-Sub-Objects ${ObjectName} + NewObject.Create-ok +DestinationIPGroupAdd + [Arguments] ${PolicyType} ${Name} ${Ip_type} ${ObjectName} + [Documentation] 调用次关键字前需要添加必填参数: + ... ${Name}:名称 + ... ${Ip_type}:填入Ip或者Geography + ... ${ObjectName}:列表形式,列表中是对象的名字 + SourceCreate-name ${Name} + Select-ip_type ${Ip_type} + sleep ${sleep} + click element xpath=${PolicyType}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[4]/div/div/div[2] + Create-Sub-Objects ${ObjectName} + NewObject.Create-ok + +SourceCreate-name + [Arguments] ${ObjName} + sleep ${sleep} + input text id=objectAdd_name ${ObjName} + +SourceCreate-ok + sleep ${sleep} + click button id=objectAdd_ok + +DestinationCreate-name + [Arguments] ${PolicyType} ${ObjName} + input text xpath=${PolicyType}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[1]/div/div[1]/input ${ObjName} + +DestinationCreate-ok + [Arguments] ${PolicyType} + sleep ${sleep} + click button xpath=${PolicyType}/div[2]/div[2]/div/div[2]/button[1] + + +# TCPFilter + # [Arguments] ${Filtercreate} ${SNIname} ${Filter}=yes + # #判断是否添加Filter,${Filter}=yes,为添加Filter,否则不添加Filter + # run keyword if "${Filter}"=="yes" run keywords sleep ${sleep} + # ... AND Filter-create ${Filtercreate} ${SNIname} + # ... ELSE log 不添加Filter Filter-create - [Arguments] ${Filtercreate} ${SNIname} + [Arguments] ${FilterInfo} + ${return} ${Filtercreate} Run Keyword And Ignore Error Get From Dictionary ${PolicyInfo} Filtercreate + ${Filtercreate} Run Keyword If "${return}"=="FAIL" or "${Filtercreate}"=="${EMPTY}" set variable null + ... ELSE set variable ${Filtercreate} + ${return} ${SNIname} Run Keyword And Ignore Error Get From Dictionary ${PolicyInfo} SNIname + ${SNIname} Run Keyword If "${return}"=="FAIL" or "${SNIname}"=="${EMPTY}" set variable null + ... ELSE set variable ${SNIname} FOR ${i} IN @{Filtercreate} sleep ${sleep} click element id=interceptionadd_add_filter @@ -75,93 +707,175 @@ Create-Object-Search sleep ${sleep} END TCP-Enable-TCP-Passthrough - [Arguments] ${Enable-TCP-Passthrough}=null + [Arguments] ${Enable-TCP-Passthrough} #判断是否开启Enable TCP Passthrough按钮,${Enable-TCP-Passthrough}=open,为开启,否则不添开启 run keyword if "${Enable-TCP-Passthrough}"=="open" run keywords sleep ${sleep} ... AND click element xpath=//*[@id="proxytcpThrough"]/label[contains(text(), "Enable TCP Passthrough")]/following-sibling::div/div #点击Enable-TCP-Passthrough按钮开启 ... AND sleep ${sleep} ... ELSE log 不开启 TCP-Bypass-Duplicated-Packet - [Arguments] ${Bypass-Duplicated-Packet}=null + [Arguments] ${Bypass-Duplicated-Packet} #判断是否开启Bypass Duplicated Packet按钮,${Bypass-Duplicated-Packet}=open,为开启,否则不添开启 run keyword if "${Bypass-Duplicated-Packet}"=="open" run keywords sleep ${sleep} ... AND click element xpath=//*[@id="proxyduplicatedPacket"]/label[contains(text(), "Bypass Duplicated Packet")]/following-sibling::div/div #点击Bypass-Duplicated-Packet按钮开启 ... AND sleep ${sleep} ... ELSE log 不开启 TCP-Client-side-Parameters - [Arguments] ${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 + [Arguments] ${TCPClientDict} + # ... ${Clientelement}=/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 + ${return} ${Clientelement} Run Keyword And Ignore Error Get From Dictionary ${TCPClientDict} Clientelement + ${Clientelement} Run Keyword If "${return}"=="FAIL" or "${Clientelement}"=="${EMPTY}" set variable null + ... ELSE set variable ${Clientelement} + ${return} ${ClientOverrideMSS} Run Keyword And Ignore Error Get From Dictionary ${TCPClientDict} ClientOverrideMSS + ${ClientOverrideMSS} Run Keyword If "${return}"=="FAIL" or "${ClientOverrideMSS}"=="${EMPTY}" set variable null + ... ELSE set variable ${ClientOverrideMSS} + + ${return} ${ClientMSSvalue} Run Keyword And Ignore Error Get From Dictionary ${TCPClientDict} ClientMSSvalue + ${ClientMSSvalue} Run Keyword If "${return}"=="FAIL" or "${ClientMSSvalue}"=="${EMPTY}" set variable null + ... ELSE set variable ${ClientMSSvalue} + + ${return} ${ClientNoDelay} Run Keyword And Ignore Error Get From Dictionary ${TCPClientDict} ClientNoDelay + ${ClientNoDelay} Run Keyword If "${return}"=="FAIL" or "${ClientNoDelay}"=="${EMPTY}" set variable null + ... ELSE set variable ${ClientNoDelay} + + ${return} ${Clientttlvalue} Run Keyword And Ignore Error Get From Dictionary ${TCPClientDict} Clientttlvalue + ${Clientttlvalue} Run Keyword If "${return}"=="FAIL" or "${Clientttlvalue}"=="${EMPTY}" set variable null + ... ELSE set variable ${Clientttlvalue} + + ${return} ${ClientKeepalive} Run Keyword And Ignore Error Get From Dictionary ${TCPClientDict} ClientKeepalive + ${ClientKeepalive} Run Keyword If "${return}"=="FAIL" or "${ClientKeepalive}"=="${EMPTY}" set variable null + ... ELSE set variable ${ClientKeepalive} + + ${return} ${ClientProbeNumber} Run Keyword And Ignore Error Get From Dictionary ${TCPClientDict} ClientProbeNumber + ${ClientProbeNumber} Run Keyword If "${return}"=="FAIL" or "${ClientProbeNumber}"=="${EMPTY}" set variable null + ... ELSE set variable ${ClientProbeNumber} + + ${return} ${ClientIdleTime} Run Keyword And Ignore Error Get From Dictionary ${TCPClientDict} ClientIdleTime + ${ClientIdleTime} Run Keyword If "${return}"=="FAIL" or "${ClientIdleTime}"=="${EMPTY}" set variable null + ... ELSE set variable ${ClientIdleTime} + + ${return} ${ClientInterval} Run Keyword And Ignore Error Get From Dictionary ${TCPClientDict} ClientInterval + ${ClientInterval} Run Keyword If "${return}"=="FAIL" or "${ClientInterval}"=="${EMPTY}" set variable null + ... ELSE set variable ${ClientInterval} + + ${return} ${ClientUserTimeout} Run Keyword And Ignore Error Get From Dictionary ${TCPClientDict} ClientUserTimeout + ${ClientUserTimeout} Run Keyword If "${return}"=="FAIL" or "${ClientUserTimeout}"=="${EMPTY}" set variable null + ... ELSE set variable ${ClientUserTimeout} + + sleep ${sleep} click element id=tab-first #点击Client-side Parameters sleep ${sleep} #判断是否开启Override MSS按钮,${Override-MSS}=open,为开启,否则不添开启 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 click element xpath=${Clientelement}/div/form/div/label[contains(text(), "Override MSS")]/following-sibling::div/div #点击Override-MSS按钮开启 ... AND sleep ${sleep} - ... AND input text xpath=${clickelement}/div/form/div[2]/div/div/input ${ClientMSSvalue} #输入MSS内容 + ... AND input text xpath=${Clientelement}/div/form/div[2]/div/div/input ${ClientMSSvalue} #输入MSS内容 ... AND sleep ${sleep} ... ELSE log 不开启 #判断是否开启No Delay按钮,${No-Delay}=open,为开启,否则不添开启 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 click element xpath=${Clientelement}/div/form/div/label[contains(text(), "No Delay")]/following-sibling::div/div #点击No-Delay按钮开启 ... AND sleep ${sleep} ... ELSE log 不开启 - input text xpath=${clickelement}/div/form/div/label[contains(text(), "TTL")]/following-sibling::div/div/input ${Clientttlvalue} #输入ttl内容 + input text xpath=${Clientelement}/div/form/div/label[contains(text(), "TTL")]/following-sibling::div/div/input ${Clientttlvalue} #输入ttl内容 sleep ${sleep} #判断是否开启Keepalive按钮,${Keepalive}=open,为开启,否则不添开启 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 click element xpath=${Clientelement}/div/form/div/label[contains(text(), "Keepalive")]/following-sibling::div/div #点击Keepalive按钮开启 ... 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 input text xpath=${Clientelement}/div/form/div/div/form/div[1]/label[contains(text(), "Probe Number")]/following-sibling::div/div/input ${ClientProbeNumber} #输入Probe Number内容 ... AND sleep ${sleep} - ... AND input text xpath=${clickelement}/div/form/div/div/form/div[2]/label[contains(text(), "Idle Time")]/following-sibling::div/div/input ${ClientIdleTime} #输入Idle Time内容 + ... AND input text xpath=${Clientelement}/div/form/div/div/form/div[2]/label[contains(text(), "Idle Time")]/following-sibling::div/div/input ${ClientIdleTime} #输入Idle Time内容 ... AND sleep ${sleep} - ... AND input text xpath=${clickelement}/div/form/div/div/form/div[3]/label[contains(text(), "Interval")]/following-sibling::div/div/input ${ClientInterval} #输入Interval内容 + ... AND input text xpath=${Clientelement}/div/form/div/div/form/div[3]/label[contains(text(), "Interval")]/following-sibling::div/div/input ${ClientInterval} #输入Interval内容 ... AND sleep ${sleep} ... ELSE log 不开启 - input text xpath=${clickelement}/div/form/div/label[contains(text(), "User Timeout")]/following-sibling::div/div/input ${ClientUserTimeout} #输入User Timeout内容 + input text xpath=${Clientelement}/div/form/div/label[contains(text(), "User Timeout")]/following-sibling::div/div/input ${ClientUserTimeout} #输入User Timeout内容 sleep ${sleep} TCP-Server-side-Parameters - [Arguments] ${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 + [Arguments] ${TCPServerDict} + # ... ${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 + ${return} ${Serverelement} Run Keyword And Ignore Error Get From Dictionary ${TCPServerDict} Serverelement + ${Serverelement} Run Keyword If "${return}"=="FAIL" or "${Serverelement}"=="${EMPTY}" set variable null + ... ELSE set variable ${Serverelement} + + ${return} ${ServerOverrideMSS} Run Keyword And Ignore Error Get From Dictionary ${TCPServerDict} ServerOverrideMSS + ${ServerOverrideMSS} Run Keyword If "${return}"=="FAIL" or "${ServerOverrideMSS}"=="${EMPTY}" set variable null + ... ELSE set variable ${ServerOverrideMSS} + + ${return} ${ServerMSSvalue} Run Keyword And Ignore Error Get From Dictionary ${TCPServerDict} ServerMSSvalue + ${ServerMSSvalue} Run Keyword If "${return}"=="FAIL" or "${ServerMSSvalue}"=="${EMPTY}" set variable null + ... ELSE set variable ${ServerMSSvalue} + + ${return} ${ServerNoDelay} Run Keyword And Ignore Error Get From Dictionary ${TCPServerDict} ServerNoDelay + ${ServerNoDelay} Run Keyword If "${return}"=="FAIL" or "${ServerNoDelay}"=="${EMPTY}" set variable null + ... ELSE set variable ${ServerNoDelay} + + ${return} ${Serverttlvalue} Run Keyword And Ignore Error Get From Dictionary ${TCPServerDict} Serverttlvalue + ${Serverttlvalue} Run Keyword If "${return}"=="FAIL" or "${Serverttlvalue}"=="${EMPTY}" set variable null + ... ELSE set variable ${Serverttlvalue} + + ${return} ${ServerKeepalive} Run Keyword And Ignore Error Get From Dictionary ${TCPServerDict} ServerKeepalive + ${ServerKeepalive} Run Keyword If "${return}"=="FAIL" or "${ServerKeepalive}"=="${EMPTY}" set variable null + ... ELSE set variable ${ServerKeepalive} + + ${return} ${ServerProbeNumber} Run Keyword And Ignore Error Get From Dictionary ${TCPServerDict} ServerProbeNumber + ${ServerProbeNumber} Run Keyword If "${return}"=="FAIL" or "${ServerProbeNumber}"=="${EMPTY}" set variable null + ... ELSE set variable ${ServerProbeNumber} + + ${return} ${ServerIdleTime} Run Keyword And Ignore Error Get From Dictionary ${TCPServerDict} ServerIdleTime + ${ServerIdleTime} Run Keyword If "${return}"=="FAIL" or "${ServerIdleTime}"=="${EMPTY}" set variable null + ... ELSE set variable ${ServerIdleTime} + + ${return} ${ServerInterval} Run Keyword And Ignore Error Get From Dictionary ${TCPServerDict} ServerInterval + ${ServerInterval} Run Keyword If "${return}"=="FAIL" or "${ServerInterval}"=="${EMPTY}" set variable null + ... ELSE set variable ${ServerInterval} + + ${return} ${ServerUserTimeout} Run Keyword And Ignore Error Get From Dictionary ${TCPServerDict} ServerUserTimeout + ${ServerUserTimeout} Run Keyword If "${return}"=="FAIL" or "${ServerUserTimeout}"=="${EMPTY}" set variable null + ... ELSE set variable ${ServerUserTimeout} + click element id=tab-second #点击Server-side Parameters sleep ${sleep} #判断是否开启Override MSS按钮,${Override-MSS}=open,为开启,否则不添开启 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 click element xpath=${Serverelement}/div/form/div/label[contains(text(), "Override MSS")]/following-sibling::div/div #点击Override-MSS按钮开启 ... AND sleep ${sleep} - ... AND input text xpath=${serverelement}/div/form/div[2]/div/div/input ${ServerMSSvalue} #输入MSS内容 + ... AND input text xpath=${Serverelement}/div/form/div[2]/div/div/input ${ServerMSSvalue} #输入MSS内容 ... AND sleep ${sleep} ... ELSE log 不开启 #判断是否开启No Delay按钮,${No-Delay}=open,为开启,否则不添开启 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 click element xpath=${Serverelement}/div/form/div/label[contains(text(), "No Delay")]/following-sibling::div/div #点击No-Delay按钮开启 ... AND sleep ${sleep} ... ELSE log 不开启 - input text xpath=${serverelement}/div/form/div/label[contains(text(), "TTL")]/following-sibling::div/div/input ${Serverttlvalue} #输入ttl内容 + input text xpath=${Serverelement}/div/form/div/label[contains(text(), "TTL")]/following-sibling::div/div/input ${Serverttlvalue} #输入ttl内容 sleep ${sleep} #判断是否开启Keepalive按钮,${Keepalive}=open,为开启,否则不添开启 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 click element xpath=${Serverelement}/div/form/div/label[contains(text(), "Keepalive")]/following-sibling::div/div #点击Keepalive按钮开启 ... AND sleep ${sleep} - ... AND input text xpath=${serverelement}/div/form/div/div/form/div[1]/label[contains(text(), "Probe Number")]/following-sibling::div/div/input ${ServerProbeNumber} #输入Probe Number内容 + ... AND input text xpath=${Serverelement}/div/form/div/div/form/div[1]/label[contains(text(), "Probe Number")]/following-sibling::div/div/input ${ServerProbeNumber} #输入Probe Number内容 ... AND sleep ${sleep} - ... AND input text xpath=${serverelement}/div/form/div/div/form/div[2]/label[contains(text(), "Idle Time")]/following-sibling::div/div/input ${ServerIdleTime} #输入Idle Time内容 + ... AND input text xpath=${Serverelement}/div/form/div/div/form/div[2]/label[contains(text(), "Idle Time")]/following-sibling::div/div/input ${ServerIdleTime} #输入Idle Time内容 ... AND sleep ${sleep} - ... AND input text xpath=${serverelement}/div/form/div/div/form/div[3]/label[contains(text(), "Interval")]/following-sibling::div/div/input ${ServerInterval} #输入Interval内容 + ... AND input text xpath=${Serverelement}/div/form/div/div/form/div[3]/label[contains(text(), "Interval")]/following-sibling::div/div/input ${ServerInterval} #输入Interval内容 ... AND sleep ${sleep} ... ELSE log 不开启 sleep ${sleep} - input text xpath=${serverelement}/div/form/div/label[contains(text(), "User Timeout")]/following-sibling::div/div/input ${ServerUserTimeout} #输入User Timeout内容 + input text xpath=${Serverelement}/div/form/div/label[contains(text(), "User Timeout")]/following-sibling::div/div/input ${ServerUserTimeout} #输入User Timeout内容 sleep ${sleep} TCP-OK sleep ${sleep} click element id=proxyManipulationSuccess #点击OK sleep ${sleep} TCP-Assertion - [Arguments] ${name} ${search} + [Arguments] ${name} ${search}=Name Proxy-TCP-Options-Search ${name} ${search} #搜索刚新建的name ${text1} Get Text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/p #获取点击后页面文本信息 Should Be Equal As Strings ${text1} ${name} #断言