diff --git a/02-Keyword/tsg_ui/objects/NewObject.robot b/02-Keyword/tsg_ui/objects/NewObject.robot index 1e8a8af..4b4c2bc 100644 --- a/02-Keyword/tsg_ui/objects/NewObject.robot +++ b/02-Keyword/tsg_ui/objects/NewObject.robot @@ -404,7 +404,7 @@ Create-Key-hexmode Create-SubscriberID-text [Arguments] ${keywordtext} sleep 1 - input text xpath=//*[@id="policy_Manipulation2"]/div[1]/div[1]/div[2]/form/div[3]/div/div[4]/div[1]/div[1]/div[2]/div[1]/div/form/div[1]/div/div[1]/input ${keywordtext} + input text xpath=//*[@id="policy_Manipulation2"]/div[1]/div[1]/div[2]/form/div[3]/div/div[3]/div[1]/div[1]/div[2]/div[1]/div/form/div[1]/div/div[1]/input ${keywordtext} sleep 1 objects-delete @@ -714,9 +714,9 @@ Create-Sub-Objects FOR ${i} IN @{object_name} input text id=objectAddSubSearch ${i} sleep 1 - press keys id=objectAddSubSearch ENTER + press keys id=objectAddSubSearch ENTER sleep 1 - click element xpath=//*[@id="objects_ip2"]/div/div[1]/div[2]/div[2]/ul/li[1]/span + click element xpath=//*[@id="objects_ip2"]/div/div[1]/div[2]/div[3]/ul/li[1]/span/div/span sleep 1 END click element id=manipilationn_allcanceltag diff --git a/02-Keyword/tsg_ui/policy/Testcase-UIPolicy.robot b/02-Keyword/tsg_ui/policy/Testcase-UIPolicy.robot index b03ff1f..8784e98 100644 --- a/02-Keyword/tsg_ui/policy/Testcase-UIPolicy.robot +++ b/02-Keyword/tsg_ui/policy/Testcase-UIPolicy.robot @@ -1,31 +1,68 @@ *** Settings *** Library Selenium2Library +Resource ../objects/NewObjectPages.robot Resource ../objects/NewObject.robot -Resource ../../../02-Keyword/tsg_ui/Menu.robot +Resource ../Menu.robot Resource ../../../03-Variable/PolicyObjectDefault.txt Resource ../../../02-Keyword/tsg_ui/policy/UIPolicy.robot *** Test Cases *** Test-UIAddPolicies - #log ${TEST NAME} - - ${policyInfo} Create Dictionary policyType=Security Policy policyName=${TEST NAME} policyAction=deny policySubAction=drop ApplicationSearch=HTTP,SSL policyLogSession=1 policyEnabled=open operation=Create/Update - ${sip1} Create Dictionary type1=Ip CreateOrSearch=Create Add=Address name=${TEST NAME}_IP1 ipclienttext1=192.168.40.11-192.168.40.110 port=1-65535 - ${sip2} Create Dictionary type1=Ip CreateOrSearch=Create Add=Group name=${TEST NAME}_IPGroup1 object_name=${TEST NAME}_IP1 - ${sgeo1} Create Dictionary type1=Geography CreateOrSearch=Search Add=Address name=${TEST NAME}_Geo1 geo=Africa country=Botswana city=Dekar - ${sgeo2} Create Dictionary type1=Geography CreateOrSearch=Search Add=Group name=${TEST NAME}_GeoGroup1 object_name=${TEST NAME}_Geo1 - ${slearn1} Create Dictionary type1=IPLearning CreateOrSearch=Create Add=Address name=${TEST NAME}_Learn1 Protocols1=HTTP Degree=2 Degrees limits=10000 numbers=1 times=10000 - ${slearn2} Create Dictionary type1=IPLearning CreateOrSearch=Create Add=Address name=${TEST NAME}_Learn2 Protocols1=HTTP,SSL Degree=12 Degrees limits=10000 numbers=1 times=72 - ${ssub1} Create Dictionary type1=SUBID CreateOrSearch=Create Add=Address name=${TEST NAME}_Subid1 keywordtext=$test25 - ${ssub2} Create Dictionary type1=SUBID CreateOrSearch=Search Add=Group name=${TEST NAME}_Subid1 object_name=${TEST NAME}_Subid1 - ${sourceAddIpList} Create List ${sip1} ${sip2} ${slearn1} ${slearn2} ${ssub1} ${ssub2} ${sgeo1} ${sgeo2} - ${sourceInfo} Create Dictionary sourceAddIpList=${sourceAddIpList} sourceDelList=(list)obj1 obj2 - ${dip1} Create Dictionary type1=Ip CreateOrSearch=Create Add=Address name=zdhip001 ipclienttext1=192.168.100.11 port=1 - ${destinationInfo} Create Dictionary destinationAddIpList=${dip1} destinationDelList=(list)obj1 obj2 - ${url} Create Dictionary - ${urlAddList} Create List ${url} - ${url2} Create Dictionary - ${urlDelList} Create List ${url2} - ${filterInfo} Create Dictionary ${urlAddList} ${urlDelList} (其他filed对象)...... - - UIAddPolicies ${policyInfo} ${sourceInfo} ${destinationInfo} ${filterInfo} + # #新建对象fqdn + # Comment 新建对象fqdn + # CreatePage FQDN single zdhfqdn keywordtext=*www.baidu.com + # #新建对象url + # Comment 新建对象url + # CreatePage URL single zdhurl keywordtext=*.com + # #新建Request Header + # Comment Request Header + # #新建cookie + # CreatePage HTTPSignature single zdhreqck reqrestype=req reqresheader=ck keywordtext=1234@#% + # #新建ua + # CreatePage HTTPSignature single zdhrequa reqrestype=req reqresheader=ua keywordtext=*скрипцияк + # #新建Response Header + # Comment Response Header + # #新建set cookie + # CreatePage HTTPSignature single zdhressck reqrestype=res reqresheader=sck keywordtext=1234@#% + # #新建ct + # CreatePage HTTPSignature single zdhresct reqrestype=res reqresheader=ct keywordtext=text* + # #新建Request Content + # Comment Request Content + # #新建Request Content + # CreatePage Key single zdhreqcontent keywordtext=*pppp + ${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=Drop 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 object_name=${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 object_name=${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 object_name=${sub_name} + #${sourceAddIpList} Create List ${sip1} ${sip2} ${slearn1} ${slearn2} ${ssub1} ${ssub2} ${sgeo1} ${sgeo2} + ${sourceAddIpList} Create List ${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 object_name=${ip_name1} + ${dsgeo} Create Dictionary sordtype=Destination type1=Geography CreateOrSearch=Search object_name=${sgeo_name1} + ${dslearn} Create Dictionary sordtype=Destination type1=IPLearning CreateOrSearch=Search object_name=${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} + UIAddPolicies ${policyInfo} destinationInfo=${destinationInfo} filterInfo=${filterInfo} diff --git a/02-Keyword/tsg_ui/policy/UIPolicy.robot b/02-Keyword/tsg_ui/policy/UIPolicy.robot index 743a09c..87940de 100644 --- a/02-Keyword/tsg_ui/policy/UIPolicy.robot +++ b/02-Keyword/tsg_ui/policy/UIPolicy.robot @@ -5,11 +5,12 @@ Library Selenium2Library Resource ../objects/NewObject.robot Resource ../../../02-Keyword/tsg_ui/Menu.robot Resource ../../../03-Variable/PolicyObjectDefault.txt - +Resource ../../../03-Variable/BifangApiVariable.txt *** Keywords *** UIAddPolicies - [Arguments] ${policyInfo} ${sourceInfo} ${destinationInfo} ${filterInfo} + [Arguments] ${policyInfo} ${sourceInfo}=null ${destinationInfo}=null ${filterInfo}=null ${subactionadd}=null ${Keyring}=null ${MirrorDecryptedTrafficInfo}=null ${DecryptionProfile}=null + ... ${ProxyDenyadd}=null ${DenyRedirectadd}=null ${ReplaceActionParameters}=null ${HijackFileadd}=null ${InsertScript}=null [Documentation] 创建策略 ${emptyList} Create List @@ -38,6 +39,10 @@ UIAddPolicies ${policyLogSession} Run Keyword If "${return}"=="FAIL" or "${policyLogSession}"=="${EMPTY}" set variable ${Default_PolicyLogSession} ... ELSE set variable ${policyName} + ${return} ${LogOptions} Run Keyword And Ignore Error Get From Dictionary ${policyInfo} LogOptions + ${LogOptions} Run Keyword If "${return}"=="FAIL" or "${LogOptions}"=="${EMPTY}" set variable 1 + ... ELSE set variable ${LogOptions} + ${return} ${policyEnabled} Run Keyword And Ignore Error Get From Dictionary ${policyInfo} policyEnabled ${policyEnabled} Run Keyword If "${return}"=="FAIL" or "${policyEnabled}"=="${EMPTY}" set variable ${Default_PolicyEnabled} ... ELSE set variable ${policyEnabled} @@ -49,40 +54,50 @@ UIAddPolicies #${return} ${policyType} Run Keyword And Ignore Error Get From Dictionary ${policy} policyType #Run Keyword If "${return}"=="FAIL" or "${policyType}"=="${EMPTY}" Set To Dictionary ${returnDict} policyType=${Default_PolicyType} #... ELSE Set To Dictionary ${returnDict} policyType=${policyType} - UIPolicy.Create-name ${policyName} - UIPolicy.Create-action ${policyAction} + UIPolicy.Create-name ${policyType} ${policyName} + UIPolicy.Create-actions ${policyType} ${policyAction} #Create-Source-Button Run Keyword If "${sourceInfo}"=="${EMPTY}" log there is no sourceInfoDict ... ELSE UIPolicy. Create-Source-Button Run Keyword If "${sourceInfo}"=="${EMPTY}" log there is no sourceInfoDict - ... ELSE UIPolicy.CreateEditDeleteSources ${sourceInfo} + ... ELSE UIPolicy.CreateEditDeleteSources ${sourceInfo} #Create-Source type1=Ip CreateOrSearch=Create Add=Address name=zdhip001 ipclienttext1=192.168.100.1 post=1 #Create-Destination-Button Run Keyword If "${destinationInfo}"=="${EMPTY}" log there is no destinationInfo ... ELSE UIPolicy.Create-Destination-Button Run Keyword If "${destinationInfo}"=="${EMPTY}" log there is no destinationInfo - ... ELSE UIPolicy.CreateEditDeleteDestinations ${destinationInfo} + ... ELSE UIPolicy.CreateEditDeleteDestination ${destinationInfo} #Create-Destination type1=Ip CreateOrSearch=Create Add=Address name=zdhip001 ipclienttext1=192.168.100.1 post=1 - UIPolicy.Create-Application-Button - Comment 多个协议循环 - FOR ${i} IN ${ApplicationSearchV} - ApplicationSearch ${ApplicationSearch} - END + UIPolicy.Create-Application-Button ${policyType} ${ApplicationSearchV} ${policyAction} #编辑filter Run Keyword If "${filterInfo}"=="${EMPTY}" log there is no filterInfo - ... ELSE UIPolicy.Create-Destination-Button - Run Keyword If "${filterInfo}"=="${EMPTY}" log there is no filterInfo - ... ELSE CreateEditDeleteDestinations ${filterInfo} - - Run Keyword If "${policyAction}"=="deny" Deny-subaction action=${policyAction} subaction=${policySubAction} - Run Keyword If "${policySubAction}"=="Block" Deny-subaction action=${policyAction} subaction=${policySubAction} - LogSession ${policyLogSession} - Enabled ${policyEnabled} - Security-Policies-OK + ... ELSE Create-Filter-SecurityOrProxy ${policyType} ${ApplicationSearchV}[0] ${filterInfo} + log 111111111111111111 + Run Keyword If "${policyType}"=="Security Policy" and "${policyAction}"=="deny" run keywords sleep 2 + ... AND Deny-subaction ${policyAction} ${policySubAction} ${subactionadd} + Run Keyword If "${policyType}"=="Security Policy" and "${policyAction}"=="intercept" and "ApplicationSearchV"=="SSL" run keywords sleep 2 + ... AND interceptadd ${Keyring} ${MirrorDecryptedTrafficInfo} ${DecryptionProfile} + Run Keyword If "${policyType}"=="Proxy Policy" and "${policyAction}"=="deny" run keywords sleep 2 + ... AND Proxy-Deny ${ProxyDenyadd} + Run Keyword If "${policyType}"=="Proxy Policy" and "${policyAction}"=="redirect" run keywords sleep 2 + ... AND Deny-Redirect ${DenyRedirectadd} + Run Keyword If "${policyType}"=="Proxy Policy" and "${policyAction}"=="replace" run keywords sleep 2 + ... AND Replace-Action-Parameters-for1 ${ReplaceActionParameters} + Run Keyword If "${policyType}"=="Proxy Policy" and "${policyAction}"=="hijack" run keywords sleep 2 + ... AND HijackFile-SearchorCreate ${HijackFileadd} + Run Keyword If "${policyType}"=="Proxy Policy" and "${policyAction}"=="insert" run keywords sleep 2 + ... AND InsertScript-SearchorCreate ${InsertScript} + Run Keyword If "${policyType}"=="Proxy Policy" run keywords ProxyLogSession ${policyLogSession} + ... AND ProxyLogOptions ${LogOptions} + ... ELSE LogSession ${policyLogSession} + Run Keyword If "${policyType}"=="Security Policy" Enabled ${policyEnabled} + ... ELSE ProxyEnabled ${policyEnabled} + Run Keyword If "${policyType}"=="Security Policy" Security-Policies-OK + ... ELSE Proxy-Policies-OK -CreateEditDeleteSources +CreateEditDeleteSources [Arguments] ${sourceInfoDict} [Documentation] 策略源条件处理、包括增加:create、search,update、delete几个列表; ... 格式:新增:type1=IP option=Create Add=Address name=zdhip001 ipclienttext1=192.168.100.1 port=1 @@ -90,9 +105,9 @@ CreateEditDeleteSources ... 新增: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 CreateSources ${addList} + ... ELSE CreateSources1 ${addList} -CreateSources +CreateSources1 [Arguments] ${addList} [Documentation] 调用次关键字前需要添加必填参数: ... ${type1}:填入Ip或SUBID或Geography或IPLearning @@ -120,11 +135,49 @@ CreateSources ${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} -CreateSourceAndDestination +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 + ... ${object_name}:列表形式,列表中是对象的名字 + ... ${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 - #... ${object_name}=null ${ipclienttext1}=null ${post}=null ${Country}=null ${City}=null + #... ${object_name}=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] @@ -136,7 +189,7 @@ CreateSourceAndDestination ... ${name}:名称 ... ${ip_type}:填入Ip或者Geography或者IPLearning ... ${ipclienttext1}:填入IPV4或6的值或range的ip段 - ... ${post}:填入端口 + ... ${port}:填入端口 ... ${Country}:列表形式,列表中是国家名字 ... ${City}:列表形式,列表中是城市名字 ... ${Protocols1}:填入HTTP或SSL或HTTPSSL @@ -151,7 +204,7 @@ CreateSourceAndDestination ${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[1]/form/div/div[4] + ${typepath} Run Keyword If "${sordtype}"=="Source" set variable /html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[4] ... ELSE set variable /html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[5] ${return} ${type1} Run Keyword And Ignore Error Get From Dictionary ${addDict} type1 @@ -181,6 +234,9 @@ CreateSourceAndDestination ${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} @@ -203,98 +259,25 @@ CreateSourceAndDestination ... 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 1 ... AND sleep 1 - ... AND SourceIPCreateOrSearch ${typepath} ${CreateOrSearch} ${Add} ${type1} ${name} ${object_name} ${ipclienttext1} ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits} + ... AND SourceIPCreateOrSearch ${typepath} ${CreateOrSearch} ${Add} ${type1} ${name} ${object_name} ${ipclienttext1} ${port} ${Country} ${City} ${fqdn} ${Protocols1} ${Degree} ${times} ${numbers} ${limits} ... ELSE IF "${type1}"=="SUBID" run keywords sleep 2 ... 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 1 - ... AND SUBIDCreateOrSearch ${typepath} ${name} ${keywordtext} ${object_name} + ... AND SUBIDCreateOrSearch ${typepath} ${CreateOrSearch} ${Add} ${name} ${keywordtext} ${object_name} ... ELSE IF "${type1}"=="Geography" run keywords sleep 2 - ... AND click element xpath=${policytype}/div[2]/div[1]/div[2]/div[1]/div/div/div/div[1]/div/div/div/div[3] + ... 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 1 - ... AND SourceIPCreateOrSearch ${typepath} ${CreateOrSearch} ${Add} ${type1} ${name} ${object_name} ${ipclienttext1} ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits} + ... AND SourceIPCreateOrSearch ${typepath} ${CreateOrSearch} ${Add} ${type1} ${name} ${object_name} ${ipclienttext1} ${port} ${Country} ${City} ${fqdn} ${Protocols1} ${Degree} ${times} ${numbers} ${limits} ... ELSE IF "${type1}"=="IPLearning" run keywords sleep 2 ... 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 1 - ... AND SourceIPCreateOrSearch ${typepath} ${CreateOrSearch} ${Add} ${type1} ${name} ${object_name} ${ipclienttext1} ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits} + ... AND SourceIPCreateOrSearch ${typepath} ${CreateOrSearch} ${Add} ${type1} ${name} ${object_name} ${ipclienttext1} ${port} ${Country} ${City} ${fqdn} ${Protocols1} ${Degree} ${times} ${numbers} ${limits} - -CreateSource - [Arguments] ${addDict} - [Documentation] 调用次关键字前需要添加必填参数: - ${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} ${object_name} Run Keyword And Ignore Error Get From Dictionary ${addDict} object_name - ${object_name} Run Keyword If "${return}"=="FAIL" or "${object_name}"=="${EMPTY}" set variable null - ... ELSE set variable ${object_name} - ${return} ${name} Run Keyword And Ignore Error Get From Dictionary ${addDict} name - ${type1} Run Keyword If "${return}"=="FAIL" or "${type1}"=="${EMPTY}" set variable null - ... ELSE set variable ${type1} - ${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} ${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 2 - ... AND click element xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[4]/div[2]/div[1]/div[2]/div[1]/div/div/div/div[1]/div/div/div/div[1] - ... AND sleep 1 - ... AND sleep 1 - ... AND SourceIPCreateOrSearch ${CreateOrSearch} ${Add} ${type1} ${name} ${object_name} ${ipclienttext1} ${port} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits} - ... ELSE IF "${type1}"=="SUBID" run keywords sleep 2 - ... AND click element xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[4]/div[2]/div[1]/div[2]/div[1]/div/div/div/div[1]/div/div/div/div[2] - ... AND sleep 1 - ... AND SUBIDCreateOrSearch ${name} ${keywordtext} ${object_name} - ... ELSE IF "${type1}"=="Geography" run keywords sleep 2 - ... AND click element xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[4]/div[2]/div[1]/div[2]/div[1]/div/div/div/div[1]/div/div/div/div[3] - ... AND sleep 1 - ... AND SourceIPCreateOrSearch ${CreateOrSearch} ${Add} ${type1} ${name} ${object_name} ${ipclienttext1} ${port} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits} - ... ELSE IF "${type1}"=="IPLearning" run keywords sleep 2 - ... AND click element xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[4]/div[2]/div[1]/div[2]/div[1]/div/div/div/div[1]/div/div/div/div[4] - ... AND sleep 1 - ... AND SourceIPCreateOrSearch ${CreateOrSearch} ${Add} ${type1} ${name} ${object_name} ${ipclienttext1} ${port} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits} - -CreateEditDeleteDestinations - [Arguments] ${destinationInfo} - [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} ${addDict} Run Keyword And Ignore Error Get From Dictionary ${destinationInfo} destinationAddIpList - Run Keyword If "${return}"=="FAIL" or "${addList}"=="${EMPTY}" log there is no CreateDestination - ... ELSE CreateDestinatons ${addList} -CreateDestinatons - [Arguments] ${addList} +Create-Destination + [Arguments] ${addDict} + # ${policytype}=null ${type1}=null ${CreateOrSearch}=null ${Add}=null ${name}=null + # ... ${object_name}=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 @@ -313,22 +296,18 @@ CreateDestinatons ... ${object_name}:列表形式,列表中是对象的名字 ... ${keywordtext}:填入新建subid的内容 ... 判断新建source选择用什么样的类型数据 - ${listlenth}= Get Length ${addList} - #${tempValue} set Variable tempValue - FOR ${var} IN RANGE ${addList} - log ${var} - ${tempValue} Get From List ${addList} ${var} - CreateDestinaton ${tempValue} - END - -CreateDestinaton - [Arguments] ${addDict} - [Documentation] 调用次关键字前需要添加必填参数: + #调用次关键字前需要添加必填参数: + ${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[1]/form/div/div[4] + ... ELSE set variable /html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[5] + ${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}"=="${addDict}" set variable Create + ${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 @@ -337,8 +316,8 @@ CreateDestinaton ${object_name} Run Keyword If "${return}"=="FAIL" or "${object_name}"=="${EMPTY}" set variable null ... ELSE set variable ${object_name} ${return} ${name} Run Keyword And Ignore Error Get From Dictionary ${addDict} name - ${type1} Run Keyword If "${return}"=="FAIL" or "${type1}"=="${EMPTY}" set variable null - ... ELSE set variable ${type1} + ${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} @@ -351,6 +330,9 @@ CreateDestinaton ${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} @@ -366,32 +348,21 @@ CreateDestinaton ${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 1 - ... AND click element xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[5]/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 DestinationIPCreateOrSearch ${CreateOrSearch} ${Add} ${type1} ${name} ${object_name} ${ipclienttext1} ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits} - ... ELSE IF "${type1}"=="Geography" run keywords sleep 1 - ... AND click element xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[5]/div[2]/div[1]/div[2]/div[1]/div/div/div/div[1]/div/div/div/div[3] - ... AND sleep 1 - ... AND DestinationIPCreateOrSearch ${CreateOrSearch} ${Add} ${type1} ${name} ${object_name} ${ipclienttext1} ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits} - ... ELSE IF "${type1}"=="IPLearning" run keywords sleep 1 - ... AND click element xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[5]/div[2]/div[1]/div[2]/div[1]/div/div/div/div[1]/div/div/div/div[4] - ... AND sleep 1 - ... AND DestinationCreateOrSearch ${CreateOrSearch} ${Add} ${type1} ${name} ${object_name} ${ipclienttext1} ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${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} ${object_name} ${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} ${object_name} ${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} ${object_name} ${ipclienttext1} ${port} ${Country} ${City} ${fqdn} ${Protocols1} ${Degree} ${times} ${numbers} ${limits} -CreateEditDeleteFilters - [Arguments] ${filterInfo} - -Select-Source - [Documentation] 选择源信息 - ... - + CreateButton [Documentation] 点击安全策略中的Create按钮 Wait Until Element Is Enabled id=app_create @@ -399,12 +370,21 @@ CreateButton click element id=app_create Create-name - [Arguments] ${name} + [Arguments] ${policyType} ${name} [Documentation] 输入name sleep 2 - input text id=interceptionadd_name ${name} - -Create-action + run keyword if "${policyType}"=="Security Policy" run keywords sleep 1 + ... AND input text id=interceptionadd_name ${name} + run keyword if "${policyType}"=="Proxy Policy" run keywords sleep 1 + ... AND input text id=manipulation_elInput_policyName ${name} +Create-actions + [Arguments] ${policyType} ${action} + sleep 1 + run keyword if "${policyType}"=="Security Policy" run keywords sleep 1 + ... AND Create-Securityaction ${action} + run keyword if "${policyType}"=="Proxy Policy" run keywords sleep 1 + ... AND Create-Proxyaction ${action} +Create-Securityaction [Arguments] ${action} [Documentation] 调用次关键字前需要添加必填参数: ... ${action}:填入allow或deny或monitor或intercept @@ -419,6 +399,27 @@ Create-action ... ELSE IF "${action}"=="intercept" run keywords sleep 1 ... AND click element id=security_action_intercept +Create-Proxyaction + [Arguments] ${action} + [Documentation] 调用次关键字前需要添加必填参数: + ... ${action}:填入allow或deny或monitor或intercept + ... 判断要创建什么动作的策略 + sleep ${sleep} + run keyword if "${action}"=="allow" run keywords sleep ${sleep} + ... AND click element id=proxyManipulationallow + ... ELSE IF "${action}"=="deny" run keywords sleep ${sleep} + ... AND click element id=proxyManipulationdeny + ... ELSE IF "${action}"=="monitor" run keywords sleep ${sleep} + ... AND click element id=proxyManipulationmonitor + ... ELSE IF "${action}"=="redirect" run keywords sleep ${sleep} + ... AND click element id=proxyManipulationredirect + ... ELSE IF "${action}"=="replace" run keywords sleep ${sleep} + ... AND click element id=proxyManipulationreplace + ... ELSE IF "${action}"=="hijack" run keywords sleep ${sleep} + ... AND click element id=proxyManipulationhijack + ... ELSE IF "${action}"=="insert" run keywords sleep ${sleep} + ... AND click element id=proxyManipulationinsert + Create-Source-Button [Documentation] 点击Source的加号 sleep 2 @@ -429,23 +430,135 @@ 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 2 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 +Create-Application-Button + [Arguments] ${policyType} ${ApplicationSearchV} ${action} [Documentation] 点击Application的加号 - Wait Until Element Is Enabled id=interceptionadd_application 10 - click element id=interceptionadd_application - -ApplicationSearch + run keyword if "${policyType}"=="Security Policy" run keywords Wait Until Element Is Enabled id=interceptionadd_application 10 + ... AND click element id=interceptionadd_application + ... AND sleep 1 + ... AND SecurityApplicationFor ${ApplicationSearchV} + ... AND sleep 1 + run keyword if "${policyType}"=="Proxy Policy" ProxyApplicationSearch ${action} ${ApplicationSearchV} + +SecurityApplicationFor + [Arguments] ${ApplicationSearchV} + FOR ${i} IN ${ApplicationSearchV} + SecurityApplicationSearch ${ApplicationSearchV} + END +SecurityApplicationSearch [Arguments] ${Application} [Documentation] 调用次关键字前需要添加必填参数: ... ${Application}:填入是Application的内容,例如SSL或HTTP ... 选择search对象 + sleep 1 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 press keys xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[5]/div[2]/div[2]/div/div[1]/input ENTER sleep 1 click element xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[5]/div[2]/div[2]/div/div[3]/div/div/ul/li[1] sleep 1 -Create-Filter-judge +ProxyApplicationSearch + [Arguments] ${action} ${HttpOrDoh} + [Documentation] 调用次关键字前需要添加必填参数: + ... ${action}:填入是action的内容,例如redirect或deny + ... 选择search对象 + run keyword if "${action}"=="redirect" run keywords sleep ${sleep} + ... AND click element id=interceptionadd_application + ... AND sleep ${sleep} + ... AND HttpOrDoh ${HttpOrDoh} + ... ELSE log 不操作 +HttpOrDoh + [Arguments] ${HttpOrDoh} + [Documentation] 调用次关键字前需要添加必填参数: + ... ${HttpOrDoh}:填入是Application的内容,例如Doh或HTTP + ... 选择search对象 + run keyword if "${HttpOrDoh}"=="HTTP" run keywords sleep ${sleep} + ... AND click element id=interceptionadd_checkappshow1 + ... 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 ${sleep} + ... AND click element id=interceptionadd_checkappshow0 + ... AND sleep ${sleep} + ... AND click element xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[7]/div[3]/div/button +Create-Filter-SecurityOrProxy + [Arguments] ${policyType} ${Application} ${addFilter} + [Documentation] 点击Application的加号 + ${return} ${Filter} Run Keyword And Ignore Error Get From Dictionary ${addFilter} Filter + ${Filter} Run Keyword If "${return}"=="FAIL" or "${Filter}"=="${EMPTY}" set variable null + ... ELSE set variable ${Filter} + ${return} ${Hostname} Run Keyword And Ignore Error Get From Dictionary ${addFilter} Hostname + ${Hostname} Run Keyword If "${return}"=="FAIL" or "${Hostname}"=="${EMPTY}" set variable null + ... ELSE set variable ${Hostname} + ${return} ${URLname} Run Keyword And Ignore Error Get From Dictionary ${addFilter} URLname + ${URLname} Run Keyword If "${return}"=="FAIL" or "${URLname}"=="${EMPTY}" set variable null + ... ELSE set variable ${URLname} + ${return} ${Request Headername} Run Keyword And Ignore Error Get From Dictionary ${addFilter} Request Headername + ${Request Headername} Run Keyword If "${return}"=="FAIL" or "${Request Headername}"=="${EMPTY}" set variable null + ... ELSE set variable ${Request Headername} + ${return} ${Response Headername} Run Keyword And Ignore Error Get From Dictionary ${addFilter} Response Headername + ${Response Headername} Run Keyword If "${return}"=="FAIL" or "${Response Headername}"=="${EMPTY}" set variable null + ... ELSE set variable ${Response Headername} + ${return} ${Request Contentname} Run Keyword And Ignore Error Get From Dictionary ${addFilter} Request Contentname + ${Request Contentname} Run Keyword If "${return}"=="FAIL" or "${Request Contentname}"=="${EMPTY}" set variable null + ... ELSE set variable ${Request Contentname} + ${return} ${Response Contentname} Run Keyword And Ignore Error Get From Dictionary ${addFilter} Response Contentname + ${Response Contentname} Run Keyword If "${return}"=="FAIL" or "${Response Contentname}"=="${EMPTY}" set variable null + ... ELSE set variable ${Response Contentname} + ${return} ${SSLSNIname} Run Keyword And Ignore Error Get From Dictionary ${addFilter} SSLSNIname + ${SSLSNIname} Run Keyword If "${return}"=="FAIL" or "${SSLSNIname}"=="${EMPTY}" set variable null + ... ELSE set variable ${SSLSNIname} + ${return} ${CNname} Run Keyword And Ignore Error Get From Dictionary ${addFilter} CNname + ${CNname} Run Keyword If "${return}"=="FAIL" or "${CNname}"=="${EMPTY}" set variable null + ... ELSE set variable ${CNname} + ${return} ${SANname} Run Keyword And Ignore Error Get From Dictionary ${addFilter} SANname + ${SANname} Run Keyword If "${return}"=="FAIL" or "${SANname}"=="${EMPTY}" set variable null + ... ELSE set variable ${SANname} + ${return} ${QNAMEname} Run Keyword And Ignore Error Get From Dictionary ${addFilter} QNAMEname + ${QNAMEname} Run Keyword If "${return}"=="FAIL" or "${QNAMEname}"=="${EMPTY}" set variable null + ... ELSE set variable ${QNAMEname} + ${return} ${Subjectname} Run Keyword And Ignore Error Get From Dictionary ${addFilter} Subjectname + ${Subjectname} Run Keyword If "${return}"=="FAIL" or "${Subjectname}"=="${EMPTY}" set variable null + ... ELSE set variable ${Subjectname} + ${return} ${MAILContentname} Run Keyword And Ignore Error Get From Dictionary ${addFilter} MAILContentname + ${MAILContentname} Run Keyword If "${return}"=="FAIL" or "${MAILContentname}"=="${EMPTY}" set variable null + ... ELSE set variable ${MAILContentname} + ${return} ${Attachment Namename} Run Keyword And Ignore Error Get From Dictionary ${addFilter} Attachment Namename + ${Attachment Namename} Run Keyword If "${return}"=="FAIL" or "${Attachment Namename}"=="${EMPTY}" set variable null + ... ELSE set variable ${Attachment Namename} + ${return} ${Attachment Contentname} Run Keyword And Ignore Error Get From Dictionary ${addFilter} Attachment Contentname + ${Attachment Contentname} Run Keyword If "${return}"=="FAIL" or "${Attachment Contentname}"=="${EMPTY}" set variable null + ... ELSE set variable ${Attachment Contentname} + ${return} ${Fromname} Run Keyword And Ignore Error Get From Dictionary ${addFilter} Fromname + ${Fromname} Run Keyword If "${return}"=="FAIL" or "${Fromname}"=="${EMPTY}" set variable null + ... ELSE set variable ${Fromname} + ${return} ${Toname} Run Keyword And Ignore Error Get From Dictionary ${addFilter} Toname + ${Toname} Run Keyword If "${return}"=="FAIL" or "${Toname}"=="${EMPTY}" set variable null + ... ELSE set variable ${Toname} + ${return} ${MAILAccountname} Run Keyword And Ignore Error Get From Dictionary ${addFilter} MAILAccountname + ${MAILAccountname} Run Keyword If "${return}"=="FAIL" or "${MAILAccountname}"=="${EMPTY}" set variable null + ... ELSE set variable ${MAILAccountname} + ${return} ${URIname} Run Keyword And Ignore Error Get From Dictionary ${addFilter} URIname + ${URIname} Run Keyword If "${return}"=="FAIL" or "${URIname}"=="${EMPTY}" set variable null + ... ELSE set variable ${URIname} + ${return} ${FTPContentname} Run Keyword And Ignore Error Get From Dictionary ${addFilter} FTPContentname + ${FTPContentname} Run Keyword If "${return}"=="FAIL" or "${FTPContentname}"=="${EMPTY}" set variable null + ... ELSE set variable ${FTPContentname} + ${return} ${FTPAccountname} Run Keyword And Ignore Error Get From Dictionary ${addFilter} FTPAccountname + ${FTPAccountname} Run Keyword If "${return}"=="FAIL" or "${FTPAccountname}"=="${EMPTY}" set variable null + ... ELSE set variable ${FTPAccountname} + ${return} ${QUICSNIname} Run Keyword And Ignore Error Get From Dictionary ${addFilter} QUICSNIname + ${QUICSNIname} Run Keyword If "${return}"=="FAIL" or "${QUICSNIname}"=="${EMPTY}" set variable null + ... ELSE set variable ${QUICSNIname} + ${return} ${DohHostname} Run Keyword And Ignore Error Get From Dictionary ${addFilter} DohHostname + ${DohHostname} Run Keyword If "${return}"=="FAIL" or "${DohHostname}"=="${EMPTY}" set variable null + ... ELSE set variable ${DohHostname} + run keyword if "${policyType}"=="Security Policy" Create-SecurityFilter-judge ${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} + run keyword if "${policyType}"=="Proxy Policy" Create-ProxyFilter ${Application} ${Filter} ${Hostname} ${URLname} ${Request Headername} ${Response Headername} ${Request Contentname} + ... ${Response Contentname} ${QNAMEname} ${DohHostname} + +Create-SecurityFilter-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 ... ${Attachment Contentname}=null ${Fromname}=null ${Toname}=null ${MAILAccountname}=null ${URIname}=null ${FTPContentname}=null ${FTPAccountname}=null ${QUICSNIname}=null @@ -457,11 +570,11 @@ Create-Filter-judge ${class}= Get Element Attribute xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[8]/div[1]/div/div[1] class run keyword if "${class}"=="addobject addobject-long-list obj-content-null filter-width-style cursor addobject-long-list-disabled" log filter不可点击,不可添加filter run keyword if "${class}"=="addobject addobject-long-list obj-content-null filter-width-style cursor" run keywords sleep 1 - ... AND Create-Filter ${Application} ${Filter} ${Hostname} ${URLname} ${Request Headername} ${Response Headername} ${Request Contentname} + ... AND Create-SecurityFilter ${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} -Create-Filter +Create-SecurityFilter [Arguments] ${Application} ${Filter} ${Hostname} ${URLname} ${Request Headername} ${Response Headername} ${Request Contentname} ... ${Response Contentname} ${SSLSNIname} ${CNname} ${SANname} ${QNAMEname} ${Subjectname} ${MAILContentname} ${Attachment Namename} ... ${Attachment Contentname} ${Fromname} ${Toname} ${MAILAccountname} ${URIname} ${FTPContentname} ${FTPAccountname} ${QUICSNIname} @@ -471,6 +584,7 @@ Create-Filter ... name:各个对象名称的列表 ... 判断添加filter类型 sleep 2 + log ${Application} FOR ${i} IN @{Filter} sleep 1 click element id=interceptionadd_add_filter @@ -539,9 +653,46 @@ Create-Filter ... AND click element xpath=//*[@id="condistions_protocol"]/div/div[1]/div/div/div/ul/li[1] ... AND Create-Object-Search ${QUICSNIname} ${i} END +Create-ProxyFilter + [Arguments] ${Application}=null ${Filter}=null ${Hostname}=null ${URLname}=null ${Request Headername}=null ${Response Headername}=null ${Request Contentname}=null + ... ${Response Contentname}=null ${QNAMEname}=null ${DohHostname}=null + [Documentation] 调用次关键字前需要添加必填参数: + ... ${Application}:填入是Application的内容,例如SSL或HTTP + ... ${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 ${sleep} + FOR ${i} IN @{Filter} + sleep ${sleep} + click element id=interceptionadd_add_filter + 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 ${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 ${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 ${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 ${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 ${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 ${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 ${sleep} + ... AND click element xpath=//*[@id="interceptionadd_checkappshow1"][contains(text(), "${i}")] + ... AND Create-Object-Search ${QNAMEname} ${i} + END Deny-subaction - [Arguments] ${action}=null ${subaction}=null ${code}=null ${Content}=null ${block-text}=null ${SearchorCreate}=null - ... ${ProfileName}=null ${file}=null ${QType}=null ${Avalue}=null ${Attl}=null ${CNAMEvalue}=null ${CNAMEttl}=null + [Arguments] ${action} ${subaction} ${subactionadd} [Documentation] 调用次关键字前需要添加必填参数: ... ${code}:填入403或404 ... ${Content}:填入TEXT或Profile @@ -555,6 +706,41 @@ Deny-subaction ... ${CNAMEvalue}:根据${QType}填入A的CNAME的域名值或AAAA的CNAME域名值 ... ${CNAMEttl}:根据${QType}填入A的CNAME的ttl值或AAAA的CNAME的ttl值 ... 添加subaction + ${return} ${code} Run Keyword And Ignore Error Get From Dictionary ${subactionadd} code + ${code} Run Keyword If "${return}"=="FAIL" or "${code}"=="${EMPTY}" set variable null + ... ELSE set variable ${code} + ${return} ${Content} Run Keyword And Ignore Error Get From Dictionary ${subactionadd} Content + ${Content} Run Keyword If "${return}"=="FAIL" or "${Content}"=="${EMPTY}" set variable null + ... ELSE set variable ${Content} + ${return} ${block-text} Run Keyword And Ignore Error Get From Dictionary ${subactionadd} block-text + ${block-text} Run Keyword If "${return}"=="FAIL" or "${block-text}"=="${EMPTY}" set variable null + ... ELSE set variable ${block-text} + ${return} ${SearchorCreate} Run Keyword And Ignore Error Get From Dictionary ${subactionadd} SearchorCreate + ${SearchorCreate} Run Keyword If "${return}"=="FAIL" or "${SearchorCreate}"=="${EMPTY}" set variable null + ... ELSE set variable ${SearchorCreate} + ${return} ${ProfileName} Run Keyword And Ignore Error Get From Dictionary ${subactionadd} ProfileName + ${ProfileName} Run Keyword If "${return}"=="FAIL" or "${ProfileName}"=="${EMPTY}" set variable null + ... ELSE set variable ${ProfileName} + ${return} ${file} Run Keyword And Ignore Error Get From Dictionary ${subactionadd} file + ${file} Run Keyword If "${return}"=="FAIL" or "${file}"=="${EMPTY}" set variable null + ... ELSE set variable ${file} + ${return} ${QType} Run Keyword And Ignore Error Get From Dictionary ${subactionadd} 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 ${subactionadd} 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 ${subactionadd} 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 ${subactionadd} 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 ${subactionadd} CNAMEttl + ${CNAMEttl} Run Keyword If "${return}"=="FAIL" or "${CNAMEttl}"=="${EMPTY}" set variable null + ... ELSE set variable ${CNAMEttl} + + run keyword if "${action}"=="deny" and "${subaction}"=="Drop" run keywords sleep 1 ... AND click element id=denyUserRegionBlock_method0 run keyword if "${action}"=="deny" and "${subaction}"=="RST" run keywords sleep 1 @@ -659,9 +845,22 @@ Deny-Redirect ... AND input text id=ttl01 ${CNAMEttl} sleep 1 click element id=interceptionadd_shezhidns +interceptadd + [Arguments] ${Keyring} ${MirrorDecryptedTrafficInfo} ${DecryptionProfile} + [Documentation] 引用次关键字,填入必填参数 + ... 必填参数: + ... ${Keyring}:新建或替换证书的参数,字典 + ... ${MirrorDecryptedTrafficInfo}:新建解密流量参数,字典 + ... ${DecryptionProfile}:新建或修改属性参数,字典 + Run Keyword If "${Keyring}"=="${EMPTY}" log there is no KeyringInfo + ... ELSE Intercept-SSL-Keyring-SearchorCreate ${Keyring} + Run Keyword If "${MirrorDecryptedTrafficInfo}"=="${EMPTY}" log there is no MirrorDecryptedTrafficInfo + ... ELSE Intercept-SSL-MirrorDecryptedTraffic-Open ${MirrorDecryptedTrafficInfo} + Run Keyword If "${DecryptionProfile}"=="${EMPTY}" log there is no interceptaddInfo + ... ELSE DecryptionProfile-SearchorCreate ${DecryptionProfile} + Intercept-SSL-Keyring-SearchorCreate - [Arguments] ${KeySearchorCreate} ${keyname} ${file}=null ${file1}=null ${ExpiryHours1or2}=null ${type}=null ${type1}=null - ... ${shift}=close ${PrivateKeyType}=PrivateKeyFile + [Arguments] ${Keyring} [Documentation] 引用次关键字,填入必填参数 ... 必填参数: ... ${KeySearchorCreate}:填入Create或Search @@ -673,6 +872,34 @@ Intercept-SSL-Keyring-SearchorCreate ... ${type1}:上传证书加密解密算法的元素 ... ${shift}:是否打开客户端包含证书按钮 ... ${PrivateKeyType}:私钥类型 + ${return} ${KeySearchorCreate} Run Keyword And Ignore Error Get From Dictionary ${Keyring} KeySearchorCreate + ${KeySearchorCreate} Run Keyword If "${return}"=="FAIL" or "${KeySearchorCreate}"=="${EMPTY}" set variable null + ... ELSE set variable ${KeySearchorCreate} + ${return} ${keyname} Run Keyword And Ignore Error Get From Dictionary ${Keyring} keyname + ${keyname} Run Keyword If "${return}"=="FAIL" or "${keyname}"=="${EMPTY}" set variable null + ... ELSE set variable ${keyname} + ${return} ${file} Run Keyword And Ignore Error Get From Dictionary ${Keyring} file + ${file} Run Keyword If "${return}"=="FAIL" or "${file}"=="${EMPTY}" set variable null + ... ELSE set variable ${file} + ${return} ${file1} Run Keyword And Ignore Error Get From Dictionary ${Keyring} file1 + ${file1} Run Keyword If "${return}"=="FAIL" or "${file1}"=="${EMPTY}" set variable null + ... ELSE set variable ${file1} + ${return} ${ExpiryHours1or2} Run Keyword And Ignore Error Get From Dictionary ${Keyring} ExpiryHours1or2 + ${ExpiryHours1or2} Run Keyword If "${return}"=="FAIL" or "${ExpiryHours1or2}"=="${EMPTY}" set variable null + ... ELSE set variable ${ExpiryHours1or2} + ${return} ${type} Run Keyword And Ignore Error Get From Dictionary ${Keyring} type + ${type} Run Keyword If "${return}"=="FAIL" or "${type}"=="${EMPTY}" set variable null + ... ELSE set variable ${type} + ${return} ${type1} Run Keyword And Ignore Error Get From Dictionary ${Keyring} type1 + ${type1} Run Keyword If "${return}"=="FAIL" or "${type1}"=="${EMPTY}" set variable null + ... ELSE set variable ${type1} + ${return} ${shift} Run Keyword And Ignore Error Get From Dictionary ${Keyring} shift + ${shift} Run Keyword If "${return}"=="FAIL" or "${shift}"=="${EMPTY}" set variable null + ... ELSE set variable ${shift} + ${return} ${PrivateKeyType} Run Keyword And Ignore Error Get From Dictionary ${Keyring} PrivateKeyType + ${PrivateKeyType} Run Keyword If "${return}"=="FAIL" or "${PrivateKeyType}"=="${EMPTY}" set variable null + ... ELSE set variable ${PrivateKeyType} + sleep 1 click element id=interceptionadd_eventkeying1 sleep 1 @@ -730,7 +957,7 @@ Create-Keyring sleep 1 click id=keyringsadd_sub #点击OK缇交 Intercept-SSL-MirrorDecryptedTraffic-Open - [Arguments] ${MirrorDecryptedTraffic}=null ${MirrorDecryptedTrafficSearchorCreate}=null ${MirrorDecryptedTrafficname}=null ${type}=null ${shuru}=null + [Arguments] ${MirrorDecryptedTrafficInfo} [Documentation] 引用次关键字,填入必填参数 ... 必填参数: ... ${MirrorDecryptedTraffic}:输入open代表开启按钮,其他代表不开启 @@ -738,6 +965,22 @@ Intercept-SSL-MirrorDecryptedTraffic-Open ... ${MirrorDecryptedTrafficname}:解密流量文件的name ... ${type}:是mac还是vlan的定位元素 ... ${shuru}:输入mac或vlan的值 + ${return} ${MirrorDecryptedTraffic} Run Keyword And Ignore Error Get From Dictionary ${MirrorDecryptedTrafficInfo} MirrorDecryptedTraffic + ${MirrorDecryptedTraffic} Run Keyword If "${return}"=="FAIL" or "${MirrorDecryptedTraffic}"=="${EMPTY}" set variable null + ... ELSE set variable ${MirrorDecryptedTraffic} + ${return} ${MirrorDecryptedTrafficSearchorCreate} Run Keyword And Ignore Error Get From Dictionary ${MirrorDecryptedTrafficInfo} MirrorDecryptedTrafficSearchorCreate + ${MirrorDecryptedTrafficSearchorCreate} Run Keyword If "${return}"=="FAIL" or "${MirrorDecryptedTrafficSearchorCreate}"=="${EMPTY}" set variable null + ... ELSE set variable ${MirrorDecryptedTrafficSearchorCreate} + ${return} ${MirrorDecryptedTrafficname} Run Keyword And Ignore Error Get From Dictionary ${MirrorDecryptedTrafficInfo} MirrorDecryptedTrafficname + ${MirrorDecryptedTrafficname} Run Keyword If "${return}"=="FAIL" or "${MirrorDecryptedTrafficname}"=="${EMPTY}" set variable null + ... ELSE set variable ${MirrorDecryptedTrafficname} + ${return} ${type} Run Keyword And Ignore Error Get From Dictionary ${MirrorDecryptedTrafficInfo} type + ${type} Run Keyword If "${return}"=="FAIL" or "${type}"=="${EMPTY}" set variable null + ... ELSE set variable ${type} + ${return} ${shuru} Run Keyword And Ignore Error Get From Dictionary ${MirrorDecryptedTrafficInfo} shuru + ${shuru} Run Keyword If "${return}"=="FAIL" or "${shuru}"=="${EMPTY}" set variable null + ... ELSE set variable ${shuru} + sleep 1 run keyword if "${MirrorDecryptedTraffic}"=="open" run keywords sleep 1 ... AND click element xpath=///*[@id="policy_paper_left"]/div[10]/div[2]/label[contains(text(), "Mirror Decrypted Traffic")]/following-sibling::div/div @@ -782,7 +1025,7 @@ Create-MirrorDecryptedTraffic sleep 2 click xpath=//*[@id="app"]/div/div[3]/div[2]/div/div/div[2]/button[1] #点击OK DecryptionProfile-SearchorCreate - [Arguments] ${DecryptionProfileSearchorCreate}=null ${DecryptionProfilename}=null ${dict1}=null ${fail1}=null ${min1}=null ${max1}=null + [Arguments] ${DecryptionProfile} [Documentation] 引用次关键字,填入必填参数 ... 必填参数: ... ${DecryptionProfileSearchorCreate}:填入Create或Search @@ -793,6 +1036,24 @@ DecryptionProfile-SearchorCreate ... ${fail1} :输入Fail-close或Pass-through ... ${min1}:输入协议版本, ... ${max1}:输入协议版本, + ${return} ${DecryptionProfileSearchorCreate} Run Keyword And Ignore Error Get From Dictionary ${DecryptionProfile} DecryptionProfileSearchorCreate + ${DecryptionProfileSearchorCreate} Run Keyword If "${return}"=="FAIL" or "${DecryptionProfileSearchorCreate}"=="${EMPTY}" set variable null + ... ELSE set variable ${DecryptionProfileSearchorCreate} + ${return} ${DecryptionProfilename} Run Keyword And Ignore Error Get From Dictionary ${DecryptionProfile} DecryptionProfilename + ${DecryptionProfilename} Run Keyword If "${return}"=="FAIL" or "${DecryptionProfilename}"=="${EMPTY}" set variable null + ... ELSE set variable ${DecryptionProfilename} + ${return} ${dict1} Run Keyword And Ignore Error Get From Dictionary ${DecryptionProfile} dict1 + ${dict1} Run Keyword If "${return}"=="FAIL" or "${dict1}"=="${EMPTY}" set variable null + ... ELSE set variable ${dict1} + ${return} ${fail1} Run Keyword And Ignore Error Get From Dictionary ${DecryptionProfile} fail1 + ${fail1} Run Keyword If "${return}"=="FAIL" or "${fail1}"=="${EMPTY}" set variable null + ... ELSE set variable ${fail1} + ${return} ${min1} Run Keyword And Ignore Error Get From Dictionary ${DecryptionProfile} min1 + ${min1} Run Keyword If "${return}"=="FAIL" or "${min1}"=="${EMPTY}" set variable null + ... ELSE set variable ${min1} + ${return} ${max1} Run Keyword And Ignore Error Get From Dictionary ${DecryptionProfile} max1 + ${max1} Run Keyword If "${return}"=="FAIL" or "${max1}"=="${EMPTY}" set variable null + ... ELSE set variable ${max1} sleep 1 click element id=interceptionadd_eventkeying sleep 1 @@ -922,17 +1183,16 @@ Create-Object-Search sleep 1 END -SourceIPCreateOrSearch - [Arguments] ${addDict} - #[Arguments] ${policytype} ${CreateOrSearch} ${Add} ${ip_type} ${name} ${object_name} ${ipclienttext1} - #... ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits} +SourceIPCreateOrSearch + [Arguments] ${policytype} ${CreateOrSearch} ${Add} ${ip_type} ${name} ${object_name} ${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段 - ... ${post}:填入端口 + ... ${port}:填入端口 ... ${Country}:列表形式,列表中是国家名字 ... ${City}:列表形式,列表中是城市名字 ... ${Protocols1}:填入HTTP或SSL或HTTPSSL @@ -942,39 +1202,34 @@ SourceIPCreateOrSearch ... ${limits}:填入数值,例如1或10000 ... ${object_name}:列表形式,列表中是对象的名字 ... 判断是新建ip还是搜索添加ip - - ${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} - - 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 - ... AND SourceSearchSearch ${policytype} ${object_name} + ... AND SourceIPAdd ${policytype} ${Add} ${ip_type} ${name} ${object_name} ${ipclienttext1} ${port} ${Country} ${City} ${fqdn} ${Protocols1} ${Degree} ${times} ${numbers} ${limits} + ... ELSE IF "${CreateOrSearch}"=="Search" run keywords sleep ${sleep} + ... AND SourceSearch ${policytype} ${object_name} SUBIDCreateOrSearch - [Arguments] ${name} ${keywordtext} ${object_name} + [Arguments] ${policytype} ${CreateOrSearch} ${Add} ${name} ${keywordtext} ${object_name} [Documentation] 调用次关键字前需要添加必填参数: ... ${CreateOrSearch}:填入Create或者Search ... ${name}:名称 ... ${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 ${Add} ${name} ${keywordtext} ${object_name} - ... ELSE IF "${CreateOrSearch}"=="Search" run keywords sleep 1 - ... AND SourceSearchSearch ${object_name} + ... AND SUBIDAdd ${policytype} ${Add} ${name} ${keywordtext} ${object_name} + ... ELSE IF "${CreateOrSearch}"=="Search" run keywords sleep ${sleep} + ... AND SourceSearch ${policytype} ${object_name} DestinationIPCreateOrSearch - [Arguments] ${CreateOrSearch} ${Add} ${ip_type} ${name} ${object_name} ${ipclienttext1} - ... ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits} + [Arguments] ${policytype} ${CreateOrSearch} ${Add} ${ip_type} ${name} ${object_name} ${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段 - ... ${post}:填入端口 + ... ${port}:填入端口 ... ${Country}:列表形式,列表中是国家名字 ... ${City}:列表形式,列表中是城市名字 ... ${Protocols1}:填入HTTP或SSL或HTTPSSL @@ -984,105 +1239,99 @@ 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 ${Add} ${ip_type} ${name} ${object_name} ${ipclienttext1} ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits} - ... ELSE IF "${CreateOrSearch}"=="Search" run keywords sleep 1 - ... AND DestinationSearch ${object_name} + ... AND DestinationIPAdd ${policytype} ${Add} ${ip_type} ${name} ${object_name} ${ipclienttext1} ${port} ${Country} ${City} ${fqdn} ${Protocols1} ${Degree} ${times} ${numbers} ${limits} + ... ELSE IF "${CreateOrSearch}"=="Search" run keywords sleep ${sleep} + ... AND DestinationSearch ${policytype} ${object_name} SourceSearch - [Arguments] ${name} + [Arguments] ${policytype} ${name} [Documentation] 调用次关键字前需要添加必填参数: ... ${name}:填入是一个列表,列表内容为source的name ... 选择search对象 FOR ${i} IN @{name} - input text xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[4]/div[2]/div[1]/div[2]/div[2]/div/div[1]/input ${i} - sleep 1 - press keys xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[4]/div[2]/div[1]/div[2]/div[2]/div/div[1]/input ENTER - sleep 1 - click element xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[4]/div[2]/div[1]/div[2]/div[2]/div/div[2]/div/div/ul/li[1] - sleep 1 + 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] ${name} + [Arguments] ${policytype} ${name} [Documentation] 调用次关键字前需要添加必填参数: ... ${name}:填入是一个列表,列表内容为source的name ... 选择search对象 FOR ${i} IN @{name} - input text xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[5]/div[2]/div[1]/div[2]/div[2]/div/div[1]/input ${i} - sleep 1 - press keys xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[5]/div[2]/div[1]/div[2]/div[2]/div/div[1]/input ENTER - sleep 1 - click element xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[5]/div[2]/div[1]/div[2]/div[2]/div/div[2]/div/div/ul/li[1] - sleep 1 + 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] ${Add} ${name} ${keywordtext} ${object_name} + [Arguments] ${policytype} ${Add} ${name} ${keywordtext} ${object_name} [Documentation] 调用次关键字前需要添加必填参数: ... ${Add}:填入Address或Group ... ${name}:名称 ... ${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 SUBAddress ${name} ${keywordtext} - ... ELSE IF "${Add}"=="Group" run keywords sleep 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 1 - ... AND SUBGroupAdd ${name} ${object_name} + ... AND sleep ${sleep} + ... AND SUBGroupAdd ${policytype} ${name} ${object_name} SUBAddress - [Arguments] ${name} ${keywordtext} + [Arguments] ${policytype} ${name} ${keywordtext} [Documentation] 调用次关键字前需要添加必填参数: ... ${name}:名称 ... ${keywordtext}:填入新建subid的内容 ... 新建subid SourceCreate-name ${name} - click element xpath=//*[@id="policy_Manipulation2"]/div[1]/div[1]/div[2]/form/div[3]/div/div[1]/i - sleep 1 + click element xpath=${policytype}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[3]/div/div[1] + sleep ${sleep} Create-SubscriberID-text ${keywordtext} - sleep 1 + sleep ${sleep} + click element xpath=${policytype}/div[2]/div[2]/div/div[2]/button[1] SUBGroupAdd - [Arguments] ${name} ${object_name} + [Arguments] ${policytype} ${name} ${object_name} [Documentation] 调用次关键字前需要添加必填参数: ... ${name}:名称 ... ${object_name}:列表形式,列表中是对象的名字 ... 新建subid分组 SourceCreate-name ${name} - click element xpath=//*[@id="policy_Manipulation2"]/div[1]/div[1]/div[2]/form/div[3]/div/div/div[2] - sleep 1 + 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 ${object_name} - NewObject.Create-ok -SourceIPAdd - [Arguments] ${addDict} - #[Arguments] ${policytype} ${Add} ${ip_type} ${name} ${object_name} ${ipclienttext1} ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits} + click element xpath=${policytype}/div[2]/div[2]/div/div[2]/button[1] +SourceIPAdd + [Arguments] ${policytype} ${Add} ${ip_type} ${name} ${object_name} ${ipclienttext1} ${port} ${Country} ${City} ${fqdn} ${Protocols1} ${Degree} ${times} ${numbers} ${limits} [Documentation] 调用次关键字前需要添加必填参数: ... ${Add}:填入Address或Group ... ${ip_type}:填入IP或者Geography或者IPLearning ... 判断是新建ip还是新建ip分组 - - - ${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} - 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 SourceIPAddress ${policytype} ${name} ${ip_type} ${ipclienttext1} ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits} - ... ELSE IF "${Add}"=="Group" run keywords sleep 1 + ... AND sleep ${sleep} + ... 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 1 + ... AND sleep ${sleep} ... AND SourceIPGroupAdd ${policytype} ${name} ${ip_type} ${object_name} SourceIPAddress - [Arguments] ${addDict} - #[Arguments] ${policytype} ${name} ${ip_type} ${ipclienttext1} ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits} + [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段 - ... ${post}:填入端口 + ... ${port}:填入端口 ... ${Country}:列表形式,列表中是国家名字 ... ${City}:列表形式,列表中是城市名字 ... ${Protocols1}:填入HTTP或SSL或HTTPSSL @@ -1091,110 +1340,60 @@ SourceIPAddress ... ${numbers}:填入数值,例如1或10000 ... ${limits}:填入数值,例如1或10000 ... 判断 新建选择用什么样的类型,并进行新建 - - ${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[1]/form/div/div[4] - ... ELSE set variable /html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[5] - - ${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} ${object_name} Run Keyword And Ignore Error Get From Dictionary ${addDict} object_name - ${object_name} Run Keyword If "${return}"=="FAIL" or "${object_name}"=="${EMPTY}" set variable null - ... ELSE set variable ${object_name} - ${return} ${name} Run Keyword And Ignore Error Get From Dictionary ${addDict} name - ${type1} Run Keyword If "${return}"=="FAIL" or "${type1}"=="${EMPTY}" set variable null - ... ELSE set variable ${type1} - ${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} ${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} - 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 NewObject.Create-ip-ClientIP-text ${ipclienttext1} ${post} + ... 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 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 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 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 1 - ... AND Learn-From-Protocols ${Protocols1} - ... AND Learning-Depth ${policytype} ${Degree} - ... AND sleep 1 + ... AND sleep ${sleep} + ... AND UIPolicy.Learn-From-Protocols ${Protocols1} + ... AND UIPolicy.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 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 31 + ... AND sleep ${sleep} + sleep ${sleep} SourceCreate-ok DestinationIPAdd - [Arguments] ${policytype} ${Add} ${ip_type} ${name} ${object_name} ${ipclienttext1} ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits} + [Arguments] ${policytype} ${Add} ${ip_type} ${name} ${object_name} ${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 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 DestinationIPAddress ${policytype} ${name} ${ip_type} ${ipclienttext1} ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits} - ... ELSE IF "${Add}"=="Group" run keywords sleep 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 1 + ... AND sleep ${sleep} ... AND DestinationIPGroupAdd ${policytype} ${name} ${ip_type} ${object_name} DestinationIPAddress - [Arguments] ${name} ${ip_type} ${ipclienttext1} ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits} + [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段 - ... ${post}:填入端口 + ... ${port}:填入端口 ... ${Country}:列表形式,列表中是国家名字 ... ${City}:列表形式,列表中是城市名字 ... ${Protocols1}:填入HTTP或SSL或HTTPSSL @@ -1203,92 +1402,103 @@ DestinationIPAddress ... ${numbers}:填入数值,例如1或10000 ... ${limits}:填入数值,例如1或10000 ... 判断 新建选择用什么样的类型,并进行新建 - DestinationCreate-name ${name} - sleep 1 - run keyword if "${ip_type}"=="Ip" run keywords click element xpath=/html/body/div/div/div[3]/div[2]/div/div[1]/form/div/div[5]/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[4]/div/div[1] - ... AND sleep 1 - ... AND NewObject.Create-ip-ClientIP-text ${ipclienttext1} ${post} - run keyword if "${ip_type}"=="Geography" run keywords click element xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[5]/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[3]/div/div/label[2] - ... AND sleep 1 - ... AND click element xpath=/html/body/div/div/div[3]/div[2]/div/div[1]/form/div/div[5]/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[4]/div/div[1]/div[2] - ... AND sleep 1 + 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 1 + ... AND sleep ${sleep} ... AND click element id=interceptionadd_allcancelobjec3t - ... AND sleep 1 - run keyword if "${ip_type}"=="IPLearning" run keywords click element xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[5]/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[3]/div/div/label[3] - ... AND sleep 1 - ... AND click element xpath=/html/body/div/div/div[3]/div[2]/div/div[1]/form/div/div[5]/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[4]/div/div[1] - ... AND sleep 1 - ... AND input text xpath=/html/body/div/div/div[3]/div[2]/div/div[1]/form/div/div[5]/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[4]/div/div[3]/div/div[1]/div[2]/div[1]/div[1]/form/div[1]/div/div[1]/input ${fqdn} - ... AND sleep 1 - ... AND click element xpath=/html/body/div/div/div[3]/div[2]/div/div[1]/form/div/div[5]/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[5]/div[1]/div/div/div[2] - ... AND sleep 1 - ... AND Learn-From-Protocols ${Protocols1} - ... AND Learning-Depth ${Degree} - ... AND sleep 1 - ... AND input text xpath=/html/body/div/div/div[3]/div[2]/div/div[1]/form/div/div[5]/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[5]/div[3]/div/div[1]/input ${times} - ... AND sleep 1 - ... AND input text xpath=/html/body/div/div/div[3]/div[2]/div/div[1]/form/div/div[5]/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[5]/div[4]/div/div[1]/input ${numbers} - ... AND sleep 1 - ... AND input text xpath=/html/body/div/div/div[3]/div[2]/div/div[1]/form/div/div[5]/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[5]/div[5]/div/div[1]/input ${limits} - ... AND sleep 1 - DestinationCreate-ok + ... 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 UIPolicy.Learn-From-Protocols ${Protocols1} + ... AND UIPolicy.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 1 - ... AND click element xpath=/html/body/div[6]/div[1]/div[1]/ul/li[1] - run keyword if "${Protocols1}"=="SSL" run keywords sleep 1 - ... AND click element xpath=/html/body/div[6]/div[1]/div[1]/ul/li[2] - run keyword if "${Protocols1}"=="HTTPSSL" run keywords sleep 1 - ... AND click element xpath=/html/body/div[6]/div[1]/div[1]/ul/li[1] - ... AND sleep 1 - ... AND click element xpath=/html/body/div[6]/div[1]/div[1]/ul/li[2] + 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] ${Degree} + [Arguments] ${policytype} ${Degree} [Documentation] 调用次关键字前需要添加必填参数: ... ${Degree}:填入1Degree或2Degree ... 判断是用1Degree或2Degree - run keyword if "${Degree}"=="1Degree" run keywords sleep 1 - ... AND click element xpath=/html/body/div/div/div[3]/div[2]/div/div[1]/form/div/div[5]/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[5]/div[2]/div/div/label[1] - run keyword if "${Degree}"=="2Degree" run keywords sleep 1 - ... AND click element xpath=/html/body/div/div/div[3]/div[2]/div/div[1]/form/div/div[5]/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[5]/div[2]/div/div/label[2] + 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] ${name} ${ip_type} ${object_name} + [Arguments] ${policytype} ${name} ${ip_type} ${object_name} [Documentation] 调用次关键字前需要添加必填参数: ... ${name}:名称 ... ${ip_type}:填入Ip或者Geography ... ${object_name}:列表形式,列表中是对象的名字 SourceCreate-name ${name} Select-ip_type ${ip_type} - sleep 1 - click element xpath=//*[@id="policy_Manipulation2"]/div[1]/div[1]/div[2]/form/div[4]/div/div/div[2] + 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 - +DestinationIPGroupAdd + [Arguments] ${policytype} ${name} ${ip_type} ${object_name} + [Documentation] 调用次关键字前需要添加必填参数: + ... ${name}:名称 + ... ${ip_type}:填入Ip或者Geography + ... ${object_name}:列表形式,列表中是对象的名字 + 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 ${object_name} + NewObject.Create-ok + SourceCreate-name [Arguments] ${objName} - sleep 2 - input text id=objectAdd_name ${objName} + sleep ${sleep} + input text id=objectAdd_name ${objName} SourceCreate-ok - sleep 2 + sleep ${sleep} click button id=objectAdd_ok DestinationCreate-name - [Arguments] ${objName} - sleep 2 - input text xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[5]/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[1]/div/div[1]/input ${objName} + [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 - sleep 2 - click button xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[5]/div[2]/div[2]/div/div[2]/button[1] - + [Arguments] ${policytype} + sleep ${sleep} + click button xpath=${policytype}/div[2]/div[2]/div/div[2]/button[1] Security-Source [Arguments] ${SourceType} ${SourceValue} @@ -1339,5 +1549,420 @@ Initialize-Policie run keyword if "${status1}"=="True" run keywords sleep 1 ... 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 - +Proxy-Deny + [Arguments] ${ProxyDenyadd} + ${return} ${action} Run Keyword And Ignore Error Get From Dictionary ${ProxyDenyadd} action + ${action} Run Keyword If "${return}"=="FAIL" or "${action}"=="${EMPTY}" set variable null + ... ELSE set variable ${action} + ${return} ${denycode} Run Keyword And Ignore Error Get From Dictionary ${ProxyDenyadd} denycode + ${denycode} Run Keyword If "${return}"=="FAIL" or "${denycode}"=="${EMPTY}" set variable null + ... ELSE set variable ${denycode} + ${return} ${contenttype} Run Keyword And Ignore Error Get From Dictionary ${ProxyDenyadd} contenttype + ${contenttype} Run Keyword If "${return}"=="FAIL" or "${contenttype}"=="${EMPTY}" set variable null + ... ELSE set variable ${contenttype} + ${return} ${SearchorCreate} Run Keyword And Ignore Error Get From Dictionary ${ProxyDenyadd} SearchorCreate + ${SearchorCreate} Run Keyword If "${return}"=="FAIL" or "${SearchorCreate}"=="${EMPTY}" set variable null + ... ELSE set variable ${SearchorCreate} + ${return} ${ProfileName} Run Keyword And Ignore Error Get From Dictionary ${ProxyDenyadd} ProfileName + ${ProfileName} Run Keyword If "${return}"=="FAIL" or "${ProfileName}"=="${EMPTY}" set variable null + ... ELSE set variable ${ProfileName} + ${return} ${file} Run Keyword And Ignore Error Get From Dictionary ${ProxyDenyadd} file + ${file} Run Keyword If "${return}"=="FAIL" or "${ProfileName}"=="${EMPTY}" set variable null + ... ELSE set variable ${file} + ${return} ${textvalue} Run Keyword And Ignore Error Get From Dictionary ${ProxyDenyadd} textvalue + ${textvalue} Run Keyword If "${return}"=="FAIL" or "${textvalue}"=="${EMPTY}" set variable null + ... ELSE set variable ${textvalue} + Deny-subaction ${action} ${denycode} + sleep 1 + Deny-content ${contenttype} ${SearchorCreate} ${ProfileName} ${file} ${textvalue} +Deny-subaction + [Arguments] ${action} ${denycode} + [Documentation] 调用次关键字前需要添加必填参数: + ... ${denycode}:填入403或404或451 + ... ${action}:填入deny + ... 添加subaction + ${return} ${DecryptionProfileSearchorCreate} Run Keyword And Ignore Error Get From Dictionary ${DecryptionProfile} DecryptionProfileSearchorCreate + ${DecryptionProfileSearchorCreate} Run Keyword If "${return}"=="FAIL" or "${DecryptionProfileSearchorCreate}"=="${EMPTY}" set variable null + ... ELSE set variable ${DecryptionProfileSearchorCreate} + run keyword if "${action}"=="deny" and "${denycode}"=="403" run keywords sleep ${sleep} + ... AND click element id=manipulation_select_addAction + ... AND sleep ${sleep} + ... AND click element //span[.="${denycode}"] + ... AND sleep ${sleep} + run keyword if "${action}"=="deny" and "${denycode}"=="404" run keywords sleep ${sleep} + ... AND click element id=manipulation_select_addAction + ... AND sleep ${sleep} + ... AND click element //span[.="${denycode}"] + ... AND sleep ${sleep} + run keyword if "${action}"=="deny" and "${denycode}"=="451" run keywords sleep ${sleep} + ... AND click element id=manipulation_select_addAction + ... AND sleep ${sleep} + ... AND click element //span[.="${denycode}"] + ... AND sleep ${sleep} + ... AND +Deny-content + [Arguments] ${contenttype}=File ${SearchorCreate}=null ${ProfileName}=null ${file}=null ${textvalue}=null + [Documentation] 调用次关键字前需要添加必填参数: + ... ${code}:填入403或404 + ... ${Content}:填入TEXT或Profile + ... ${SearchorCreate}:填入Search或Create + ... ${block-text}:填入TEXT文本框内容 + ... ${ProfileName}:Profile的名字 + ... ${file}:上传文件路径 + ... ${textvalue}:填入text输入框内容 + ... 添加block数据内容 + sleep ${sleep} + run keyword if "${contenttype}"=="File" run keywords sleep ${sleep} + ... AND click element id=manipulation_select_blockInfo + ... AND sleep ${sleep} + ... AND click element id=ResponseContentFile + ... AND sleep ${sleep} + ... AND click element id=manipulation_select_htmlProfile + ... AND sleep ${sleep} + ... AND Profile-SearchorCreate ${SearchorCreate} ${ProfileName} ${file} + run keyword if "${contenttype}"=="Text" run keywords sleep ${sleep} + ... AND click element id=manipulation_select_blockInfo + ... AND sleep ${sleep} + ... AND click ellement id=ResponseContentText + ... AND sllep 1 + ... AND input text id=manipulation_elInput_blockselect ${textvalue} + ... AND sleep ${sleep} +Profile-SearchorCreate + [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 + [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} + [Documentation] 调用次关键字前需要添加必填参数:${ReplaceActionParameters}是个字典,字典中的数据为下 + ... ${ParametersType}:列表格式,Search 下拉框中内容 + ... ${i}:索引值 + ... ${xxxFind}:是Find输入框输入的值 + ... ${XXXReplacewith} :是 Replacewith输入框中输入的值 + ${return} ${ParametersType} Run Keyword And Ignore Error Get From Dictionary ${ReplaceActionParameters} ParametersType + ${ParametersType} Run Keyword If "${return}"=="FAIL" or "${ParametersType}"=="${EMPTY}" set variable null + ... ELSE set variable ${ParametersType} + ${return} ${RequestURIFind} Run Keyword And Ignore Error Get From Dictionary ${ReplaceActionParameters} RequestURIFind + ${RequestURIFind} Run Keyword If "${return}"=="FAIL" or "${RequestURIFind}"=="${EMPTY}" set variable null + ... ELSE set variable ${RequestURIFind} + ${return} ${RequestURIReplacewith} Run Keyword And Ignore Error Get From Dictionary ${ReplaceActionParameters} RequestURIReplacewith + ${RequestURIReplacewith} Run Keyword If "${return}"=="FAIL" or "${RequestURIReplacewith}"=="${EMPTY}" set variable null + ... ELSE set variable ${RequestURIReplacewith} + ${return} ${RequestBodyFind} Run Keyword And Ignore Error Get From Dictionary ${ReplaceActionParameters} RequestBodyFind + ${RequestBodyFind} Run Keyword If "${return}"=="FAIL" or "${RequestBodyFind}"=="${EMPTY}" set variable null + ... ELSE set variable ${RequestBodyFind} + ${return} ${RequestBodyReplacewith} Run Keyword And Ignore Error Get From Dictionary ${ReplaceActionParameters} RequestBodyReplacewith + ${RequestBodyReplacewith} Run Keyword If "${return}"=="FAIL" or "${RequestBodyReplacewith}"=="${EMPTY}" set variable null + ... ELSE set variable ${RequestBodyReplacewith} + ${return} ${ResponseBodyFind} Run Keyword And Ignore Error Get From Dictionary ${ReplaceActionParameters} ResponseBodyFind + ${ResponseBodyFind} Run Keyword If "${return}"=="FAIL" or "${ResponseBodyFind}"=="${EMPTY}" set variable null + ... ELSE set variable ${ResponseBodyFind} + ${return} ${ResponseBodyReplacewith} Run Keyword And Ignore Error Get From Dictionary ${ReplaceActionParameters} ResponseBodyReplacewith + ${ResponseBodyReplacewith} Run Keyword If "${return}"=="FAIL" or "${ResponseBodyReplacewith}"=="${EMPTY}" set variable null + ... ELSE set variable ${ResponseBodyReplacewith} + ${return} ${RequestHeaderFind} Run Keyword And Ignore Error Get From Dictionary ${ReplaceActionParameters} RequestHeaderFind + ${RequestHeaderFind} Run Keyword If "${return}"=="FAIL" or "${RequestHeaderFind}"=="${EMPTY}" set variable null + ... ELSE set variable ${RequestHeaderFind} + ${return} ${RequestHeaderReplacewith} Run Keyword And Ignore Error Get From Dictionary ${ReplaceActionParameters} RequestHeaderReplacewith + ${RequestHeaderReplacewith} Run Keyword If "${return}"=="FAIL" or "${RequestHeaderReplacewith}"=="${EMPTY}" set variable null + ... ELSE set variable ${RequestHeaderReplacewith} + ${return} ${ResponseHeaderFind} Run Keyword And Ignore Error Get From Dictionary ${ReplaceActionParameters} ResponseHeaderFind + ${ResponseHeaderFind} Run Keyword If "${return}"=="FAIL" or "${ResponseHeaderFind}"=="${EMPTY}" set variable null + ... ELSE set variable ${ResponseHeaderFind} + ${return} ${ResponseHeaderReplacewith} Run Keyword And Ignore Error Get From Dictionary ${ReplaceActionParameters} ResponseHeaderReplacewith + ${ResponseHeaderReplacewith} Run Keyword If "${return}"=="FAIL" or "${ResponseHeaderReplacewith}"=="${EMPTY}" set variable null + ... ELSE set variable ${ResponseHeaderReplacewith} + ${len} Get Length ${ParametersType} + ${len1} evaluate ${len}+1 + FOR ${i} IN RANGE 1 ${len1} + Replace-Action-Parameters-for2 ${ParametersType} ${i} ${RequestURIFind} ${RequestURIReplacewith} ${RequestBodyFind} ${RequestBodyReplacewith} ${ResponseBodyFind} + ... ${ResponseBodyReplacewith} ${RequestHeaderFind} ${RequestHeaderReplacewith} ${ResponseHeaderFind} ${ResponseHeaderReplacewith} + sleep ${sleep} + run keyword if "${len}"!="1" run keywords sleep ${sleep} + ... AND clcik element id=replaceadd_btn + ... AND sleep ${sleep} + END + sleep ${sleep} + +Replace-Action-Parameters-for2 + [Arguments] ${ParametersType} ${i} ${RequestURIFind} ${RequestURIReplacewith} ${RequestBodyFind} ${RequestBodyReplacewith} ${ResponseBodyFind} + ... ${ResponseBodyReplacewith} ${RequestHeaderFind} ${RequestHeaderReplacewith} ${ResponseHeaderFind} ${ResponseHeaderReplacewith} + [Documentation] 调用次关键字前需要添加必填参数: + ... ${ParametersType}:列表格式,Search 下拉框中内容 + ... ${i}:索引值 + ... ${xxxFind}:是Find输入框输入的值 + ... ${XXXReplacewith} :是 Replacewith输入框中输入的值 + FOR ${j} IN @{ParametersType} + 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 ${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 ${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 ${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 ${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 ${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 ${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 ${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 ${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 ${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 ${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 ${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 ${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 ${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 ${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 ${sleep} + END + +HijackFile-SearchorCreate + [Arguments] ${HijackFileadd} + [Documentation] 调用次关键字前需要添加必填参数:${HijackFileadd}是个字典,字典中的数据为下 + ... ${SearchorCreate}:填入Search或Create + ... ${Hijackname}:填入新建hijack的name + ... ${Hijackfile}:填入新建hijack文件的路径 + ... ${dow_name}:根据情况填入close或open或其他 + ... ${input};填入shuru或其他 + ... ${Hijacktype}:填入选择文件类型的元素 + ... 判断是新建还是搜索HijackFile + ${return} ${SearchorCreate} Run Keyword And Ignore Error Get From Dictionary ${HijackFileadd} SearchorCreate + ${SearchorCreate} Run Keyword If "${return}"=="FAIL" or "${SearchorCreate}"=="${EMPTY}" set variable null + ... ELSE set variable ${SearchorCreate} + ${return} ${Hijackname} Run Keyword And Ignore Error Get From Dictionary ${HijackFileadd} Hijackname + ${Hijackname} Run Keyword If "${return}"=="FAIL" or "${Hijackname}"=="${EMPTY}" set variable null + ... ELSE set variable ${Hijackname} + ${return} ${Hijackfile} Run Keyword And Ignore Error Get From Dictionary ${HijackFileadd} Hijackfile + ${Hijackfile} Run Keyword If "${return}"=="FAIL" or "${Hijackfile}"=="${EMPTY}" set variable null + ... ELSE set variable ${Hijackfile} + ${return} ${dow_name} Run Keyword And Ignore Error Get From Dictionary ${HijackFileadd} dow_name + ${dow_name} Run Keyword If "${return}"=="FAIL" or "${dow_name}"=="${EMPTY}" set variable null + ... ELSE set variable ${dow_name} + ${return} ${input} Run Keyword And Ignore Error Get From Dictionary ${HijackFileadd} input + ${input} Run Keyword If "${return}"=="FAIL" or "${input}"=="${EMPTY}" set variable null + ... ELSE set variable ${input} + ${return} ${Hijacktype} Run Keyword And Ignore Error Get From Dictionary ${HijackFileadd} Hijacktype + ${Hijacktype} Run Keyword If "${return}"=="FAIL" or "${Hijacktype}"=="${EMPTY}" set variable null + ... ELSE set variable ${Hijacktype} + + sleep ${sleep} + click element xpath=//*[@id="policy_paper_left"]/div[12]/div/div/form/div[4]/div/div/div/div + 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 ${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 HijackFile-Create ${Hijackname} ${Hijackfile} ${dow_name} ${input} ${Hijackname} ${Hijacktype} + ... ELSE log 传入参数错误 + +HijackFile-Create + [Arguments] ${Hijackfile} ${dow_name} ${input} ${Hijackname} ${Hijacktype} + [Documentation] 调用次关键字前需要添加必填参数: + ... ${Hijackname}:填入新建hijack的name + ... ${Hijackfile}:填入新建hijack文件的路径 + ... ${dow_name}:根据情况填入close或open或其他 + ... ${input};填入shuru或其他 + ... ${Hijacktype}:填入选择文件类型的元素 + ... 新建hijack + sleep ${sleep} + input id=hijack_profileName ${Hijackname} #输入name + sleep ${sleep} + Choose File xpath=//*[@id="proxy"]/div[11]/div/div[1]/div[2]/form/div[2]/div/div/div[1]/input ${Hijackfile} #上传文件 + 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 ${sleep} + click element id=hijackAddContentType #点击+ 打开侧滑窗口 + sleep ${sleep} + click element ${Hijacktype} #选择文件类型 + sleep ${sleep} + click element id=hijackAddOk1 #点击OK + +InsertScript-SearchorCreate + [Arguments] ${InsertScript} + [Documentation] 调用次关键字前需要添加必填参数:${InsertScript}是个字典,字典中的数据为下 + ... ${SearchorCreate}:填入Search或Create + ... ${Insertname}:填入新建insert的name + ... ${Insertfile}:填入新建insert文件的路径 + ... ${Inserttype}:根据情况填入css或js + ... ${Insertjstype};填入Before Page Load或After Page Load + ... 判断是新建还是搜索insert + ${return} ${SearchorCreate} Run Keyword And Ignore Error Get From Dictionary ${InsertScript} SearchorCreate + ${SearchorCreate} Run Keyword If "${return}"=="FAIL" or "${SearchorCreate}"=="${EMPTY}" set variable null + ... ELSE set variable ${SearchorCreate} + ${return} ${Insertname} Run Keyword And Ignore Error Get From Dictionary ${InsertScript} Insertname + ${Insertname} Run Keyword If "${return}"=="FAIL" or "${Insertname}"=="${EMPTY}" set variable null + ... ELSE set variable ${Insertname} + ${return} ${Insertfile} Run Keyword And Ignore Error Get From Dictionary ${InsertScript} Insertfile + ${Insertfile} Run Keyword If "${return}"=="FAIL" or "${Insertfile}"=="${EMPTY}" set variable null + ... ELSE set variable ${Insertfile} + ${return} ${Inserttype} Run Keyword And Ignore Error Get From Dictionary ${InsertScript} Inserttype + ${Inserttype} Run Keyword If "${return}"=="FAIL" or "${Inserttype}"=="${EMPTY}" set variable null + ... ELSE set variable ${Inserttype} + ${return} ${Insertjstype} Run Keyword And Ignore Error Get From Dictionary ${InsertScript} Insertjstype + ${Insertjstype} Run Keyword If "${return}"=="FAIL" or "${Insertjstype}"=="${EMPTY}" set variable null + ... ELSE set variable ${Insertjstype} + sleep ${sleep} + click element id=manipulation_select_insetScript + 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 ${Insertname} + ... 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 InsertScript-Create ${Insertname} ${Insertfile} ${Inserttype} ${Insertjstype} + ... ELSE log 传入参数错误 + +InsertScript-Create + [Arguments] ${Insertname} ${Insertfile} ${Inserttype} ${Insertjstype} + [Documentation] 调用次关键字前需要添加必填参数: + ... ${Insertname}:填入新建insert的name + ... ${Insertfile}:填入新建insert文件的路径 + ... ${Inserttype}:根据情况填入css或js + ... ${Insertjstype};填入Before Page Load或After Page Load + ... 新建insert + sleep ${sleep} + input id=insert_profileName ${Insertname} #输入name + sleep ${sleep} + Choose File xpath=//*[@id="insertAddUpload"]/div[1]/input ${Insertfile} #上传文件 + sleep ${sleep} + clcik element id=insert_select_format + 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 ${sleep} + ... AND click element //span[.="${Inserttype}"] + ... AND sleep ${sleep} + ... AND click element id=insert_select_insertOn #点击下拉框 + ... AND sleep ${sleep} + ... AND click element //span[.="${Insertjstype}"] + sleep ${sleep} + click element id=insertAddOk1 #点击OK + +ProxyLogSession + [Arguments] ${LogSession} + [Documentation] 调用次关键字前需要添加必填参数: + ... ${LogSession}:填入clcos或其他 + run keyword if "${LogSession}"=="close" run keywords sleep ${sleep} + ... AND click element id=manipulationSwitch0 + ... ELSE log 开启日志 + +ProxyLogOptions + [Arguments] ${LogOptions} + [Documentation] 调用次关键字前需要添加必填参数: + ... ${LogOptions}:填入All或其他 + run keyword if "${LogOptions}"=="All" run keywords sleep ${sleep} + ... AND click element id=logType1 + ... ELSE log 选择Metadata only +ProxyEnabled + [Arguments] ${Enabled} + [Documentation] 调用次关键字前需要添加必填参数: + ... ${Enabled}:填入open或其他 + 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 ${sleep} + ... AND click element xpath=/html/body/div/div/div[3]/button[2] + ... ELSE log 策略生效 + +Proxy-Policies-OK + sleep ${sleep} + click element id=proxyManipulationSuccess + sleep ${sleep} diff --git a/02-Keyword/tsg_ui/proxyPolicy/ProxyPolicy.robot b/02-Keyword/tsg_ui/proxyPolicy/ProxyPolicy.robot index 20aa325..f99291b 100644 --- a/02-Keyword/tsg_ui/proxyPolicy/ProxyPolicy.robot +++ b/02-Keyword/tsg_ui/proxyPolicy/ProxyPolicy.robot @@ -49,11 +49,11 @@ Create-Destination-Button ApplicationSearch - [Arguments] ${Application} ${HttpOrDoh} + [Arguments] ${action} ${HttpOrDoh} [Documentation] 调用次关键字前需要添加必填参数: - ... ${Application}:填入是Application的内容,例如SSL或HTTP + ... ${action}:填入是action的内容,例如redirect或deny ... 选择search对象 - run keyword if "${Application}"=="redirect" run keywords sleep ${sleep} + run keyword if "${action}"=="redirect" run keywords sleep ${sleep} ... AND click element id=interceptionadd_application ... AND sleep ${sleep} ... AND HttpOrDoh ${HttpOrDoh} @@ -232,7 +232,7 @@ Replace-Action-Parameters-for1 ${len} Get Length ${ParametersType} ${len1} evaluate ${len}+1 FOR ${i} IN RANGE 1 ${len1} - Replace-Action-Parameters-for1 ${ParametersType} ${i} ${RequestURIFind} ${RequestURIReplacewith} ${RequestBodyFind} ${RequestBodyReplacewith} ${ResponseBodyFind} + Replace-Action-Parameters-for2 ${ParametersType} ${i} ${RequestURIFind} ${RequestURIReplacewith} ${RequestBodyFind} ${RequestBodyReplacewith} ${ResponseBodyFind} ... ${ResponseBodyReplacewith} ${RequestHeaderFind} ${RequestHeaderReplacewith} ${ResponseHeaderFind} ${ResponseHeaderReplacewith} sleep ${sleep} run keyword if "${len}"!="1" run keywords sleep ${sleep}