From 37b03123eb7a99d6618339c2569f5b3b0c419921 Mon Sep 17 00:00:00 2001 From: lyf Date: Fri, 5 Feb 2021 17:50:26 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E6=8F=90=E4=BA=A4=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=AE=89=E5=85=A8=E5=9C=B0=E7=90=86=E5=85=B3=E9=94=AE=E5=AD=97?= =?UTF-8?q?2=E3=80=81=E6=8F=90=E4=BA=A4=E6=BA=90=E5=92=8C=E7=9B=AE?= =?UTF-8?q?=E7=9A=84=E5=85=AC=E5=85=B1=E5=85=B3=E9=94=AE=E5=AD=973?= =?UTF-8?q?=E3=80=81=E6=8F=90=E4=BA=A4tcp=E5=85=B3=E9=94=AE=E5=AD=97?= =?UTF-8?q?=E5=92=8C=E7=94=A8=E4=BE=8Bdome?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 01-TestCase/tsg_ui/ui_proxy/Proxy.robot | 90 ++++ 01-TestCase/tsg_ui/ui_security/Security.robot | 47 +- .../tsg_ui/ui_tcppolicy/TCPPolicy.robot | 37 ++ 02-Keyword/tsg_ui/Menu.robot | 2 +- .../SecurityPolicy.robot | 383 +------------- .../SecurityPolicy/SourceAndDestination.robot | 401 ++++++++++++++ .../tsg_ui/proxyPolicy/ProxyPolicy.robot | 488 ++---------------- .../proxyTCPOptions/ProxyTCPOptions.robot | 243 +++++++++ .../securityPolicy/InterceptSSLModule.robot | 122 ----- 9 files changed, 847 insertions(+), 966 deletions(-) create mode 100644 01-TestCase/tsg_ui/ui_proxy/Proxy.robot create mode 100644 01-TestCase/tsg_ui/ui_tcppolicy/TCPPolicy.robot rename 02-Keyword/tsg_ui/{securityPolicy => SecurityPolicy}/SecurityPolicy.robot (60%) create mode 100644 02-Keyword/tsg_ui/SecurityPolicy/SourceAndDestination.robot create mode 100644 02-Keyword/tsg_ui/proxyTCPOptions/ProxyTCPOptions.robot delete mode 100644 02-Keyword/tsg_ui/securityPolicy/InterceptSSLModule.robot diff --git a/01-TestCase/tsg_ui/ui_proxy/Proxy.robot b/01-TestCase/tsg_ui/ui_proxy/Proxy.robot new file mode 100644 index 0000000..27955fc --- /dev/null +++ b/01-TestCase/tsg_ui/ui_proxy/Proxy.robot @@ -0,0 +1,90 @@ +*** Settings *** +Test Teardown run keywords Delete-Proxy-estimate ${PolicyName} +... AND Delete-object-estimate ${ObjName} +Force Tags tsg-ui objects security +Resource ../../../02-Keyword/tsg_ui/proxyPolicy/ProxyPolicy.robot +Resource ../../../02-Keyword/tsg_ui/SecurityPolicy/SourceAndDestination.robot +Library OperatingSystem +Resource ../../../02-Keyword/tsg_ui/Menu.robot +Resource ../../../02-Keyword/tsg_ui/objects/NewObjectPages.robot +Resource ../../../02-Keyword/tsg_ui/objects/NewObject.robot +Resource ../../../03-Variable/bifangapivariable.txt + +*** Test Cases *** +ProxyPolicy-Deny-HTTP-MaxCombination-Drop-403 + #新建对象fqdn + Comment 新建对象fqdn + CreatePage FQDN single zdhfqdn keywordtext=*www.baidu.com + #新建对象url + Comment 新建对象url + CreatePage URL single zdhurl keywordtext=*.com + #新建Request Header + Comment Request Header + #新建cookie + CreatePage HTTPSignature single zdhreqck reqrestype=req reqresheader=ck keywordtext=1234@#% + #新建ua + CreatePage HTTPSignature single zdhrequa reqrestype=req reqresheader=ua keywordtext=*скрипцияк + #新建Response Header + Comment Response Header + #新建set cookie + CreatePage HTTPSignature single zdhressck reqrestype=res reqresheader=sck keywordtext=1234@#% + #新建ct + CreatePage HTTPSignature single zdhresct reqrestype=res reqresheader=ct keywordtext=text* + #新建Request Content + Comment Request Content + #新建Request Content + CreatePage Key single zdhreqcontent keywordtext=*pppp + #新建策略 + Comment 新建策略 + Menu policys Proxy Policy + ProxyPolicy.CreateButton + ProxyPolicy.Create-name ProxyPolicy-Deny-HTTP-MaxCombination + ProxyPolicy.Create-action deny + ProxyPolicy.Create-Source-Button + SourceAndDestination.Create-Source policytype=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[4] type1=Ip CreateOrSearch=Create Add=Address name=zdhip001 ipclienttext1=192.168.100.1 post=1 + ProxyPolicy.Create-Destination-Button + SourceAndDestination.Create-Destination policytype=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[5] type1=Ip CreateOrSearch=Create Add=Address name=zdhip001 ipclienttext1=192.168.100.1 post=1 + ${ipname} create list zdhip001 zdhip001 + ${hostname} create list zdhfqdn + ${urlname} create list zdhurl + ${RequestHeadername} create list zdhreqck zdhrequa + ${ResponseHeadername} create list zdhressck zdhresct + ${RequestContentname} create list zdhreqcontent + ${ObjName} create dictionary FQDN=${hostname} URL=${urlname} HTTPSignature=${RequestHeadername} HTTPSignature=${ResponseHeadername} Key=${RequestContentname} #IP=${ipname} IP=${ipname} + ${PolicyName} set variable SecurityPolicy-Deny-HTTP-MaxCombination + ${filter} create list Host URL Request Header Response Header Request Content + ProxyPolicy.Create-Filter Application=HTTP Filter=${filter} Hostname=${hostname} URLname=${urlname} Request Headername=${RequestHeadername} Response Headername=${ResponseHeadername} + ... Request Contentname=${RequestContentname} + Deny-subaction action=deny denycode=403 + Deny-content contenttype=File SearchorCreate=Create ProfileName=zdhprofilehtml file=${path}response_pages_files\\Create-ResponsePages-test.html + LogSession 1 + LogOptions 1 + Enabled open + Proxy-Policies-OK + sleep 1 + #修改策略,修改策略相当于再进行一遍新增 + Comment 修改策略 + Proxy-Source Name ProxyPolicy-Deny-HTTP-MaxCombination + EditButton + Initialize-Policie Deny + #新建策略 + ProxyPolicy.Create-name ProxyPolicy-Deny-MaxCombination-403 + ProxyPolicy.Create-action deny + ProxyPolicy.Create-Source-Button + ProxyPolicy.Create-Source type1=Ip CreateOrSearch=Create Add=Address name=zdhip001 ipclienttext1=192.168.100.2 post=1 + ProxyPolicy.Create-Destination-Button + ProxyPolicy.Create-Destination type1=Ip CreateOrSearch=Create Add=Address name=zdhip001 ipclienttext1=192.168.100.3 post=1 + ${filter} create list Host URL Request Header Response Header Request Content + ProxyPolicy.Create-Filter Application=HTTP Filter=${filter} Hostname=${hostname} URLname=${urlname} Request Headername=${RequestHeadername} Response Headername=${ResponseHeadername} + ... Request Contentname=${RequestContentname} + Deny-subaction action=deny denycode=404 + Deny-content contenttype=File SearchorCreate=Create ProfileName=zdhprofilehtml file=${path}response_pages_files\\Create-ResponsePages-test.html + LogSession 1 + LogOptions 1 + Enabled open + Proxy-Policies-OK + Proxy-Source Name ProxyPolicy-Deny-MaxCombination-403 + ${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr/td[2]/div/div/p + Should Be Equal As Strings ${text} ProxyPolicy-Deny-MaxCombination-403 + ${PolicyName} set variable SecurityPolicy-Deny-HTTP-MaxCombination + diff --git a/01-TestCase/tsg_ui/ui_security/Security.robot b/01-TestCase/tsg_ui/ui_security/Security.robot index e854214..bf493b5 100644 --- a/01-TestCase/tsg_ui/ui_security/Security.robot +++ b/01-TestCase/tsg_ui/ui_security/Security.robot @@ -3,6 +3,7 @@ Test Teardown run keywords Delete-Security-estimate ${PolicyName} ... AND Delete-object-estimate ${ObjName} Force Tags tsg-ui objects security Resource ../../../02-Keyword/tsg_ui/securityPolicy/SecurityPolicy.robot +Resource ../../../02-Keyword/tsg_ui/SecurityPolicy/SourceAndDestination.robot Library OperatingSystem Resource ../../../02-Keyword/tsg_ui/Menu.robot Resource ../../../02-Keyword/tsg_ui/objects/NewObjectPages.robot @@ -40,9 +41,9 @@ SecurityPolicy-Deny-HTTP-MaxCombination-Drop SecurityPolicy.Create-name SecurityPolicy-Deny-HTTP-MaxCombination SecurityPolicy.Create-action deny SecurityPolicy.Create-Source-Button - SecurityPolicy.Create-Source type1=Ip CreateOrSearch=Create Add=Address name=zdhip001 ipclienttext1=192.168.100.1 post=1 + SourceAndDestination.Create-Source policytype=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[4] type1=Ip CreateOrSearch=Create Add=Address name=zdhip001 ipclienttext1=192.168.100.1 post=1 SecurityPolicy.Create-Destination-Button - SecurityPolicy.Create-Destination type1=Ip CreateOrSearch=Create Add=Address name=zdhip001 ipclienttext1=192.168.100.1 post=1 + SourceAndDestination.Create-Destination policytype=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[5] type1=Ip CreateOrSearch=Create Add=Address name=zdhip001 ipclienttext1=192.168.100.1 post=1 ${ipname} create list zdhip001 zdhip001 ${hostname} create list zdhfqdn ${urlname} create list zdhurl @@ -61,27 +62,29 @@ SecurityPolicy-Deny-HTTP-MaxCombination-Drop Enabled open Security-Policies-OK sleep 1 - # #修改策略,修改策略相当于再进行一遍新增 - # Comment 修改策略 - # Security-Source Name SecurityPolicy-Deny-HTTP-MaxCombination - # EditButton - # Initialize-Policie Deny - # #新建策略 - # SecurityPolicy.Create-name SecurityPolicy-Deny-SSL-MaxCombination-Drop - # SecurityPolicy.Create-action deny - # SecurityPolicy.Create-Source-Button - # SecurityPolicy.Create-Source type1=Ip CreateOrSearch=Create Add=Address name=zdhip001 ipclienttext1=192.168.100.2 post=1 + 修改策略,修改策略相当于再进行一遍新增 + Comment 修改策略 + Menu policys Security Policy + Security-Source Name SecurityPolicy-Deny-HTTP-MaxCombination + EditButton + Initialize-Policie Deny + #新建策略 + SecurityPolicy.Create-name SecurityPolicy-Deny-SSL-MaxCombination-Drop + SecurityPolicy.Create-action deny + SecurityPolicy.Create-Source-Button + ${Country} create list China + SourceAndDestination.Create-Source policytype=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[4] type1=Geography CreateOrSearch=Create Add=Address name=zdhip001 Country=${Country} # SecurityPolicy.Create-Destination-Button - # SecurityPolicy.Create-Destination type1=Ip CreateOrSearch=Create Add=Address name=zdhip001 ipclienttext1=192.168.100.3 post=1 - # ${fqdnname} create list zdhfqdn - # ${filter} create list SNI CN SAN - # Create-Application-Button - # ApplicationSearch SSL - # Create-Filter-judge Application=SSL Filter=${filter} SSLSNIname=${fqdnname} CNname=${fqdnname} SANname=${fqdnname} - # Deny-subaction action=deny subaction=RST - # LogSession 1 - # Enabled open - # Security-Policies-OK + # SourceAndDestination.Create-Destination policytype=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[5] type1=Ip CreateOrSearch=Create Add=Address name=zdhip001 ipclienttext1=192.168.100.3 post=1 + ${fqdnname} create list zdhfqdn + ${filter} create list SNI CN SAN + Create-Application-Button + ApplicationSearch SSL + Create-Filter-judge Application=SSL Filter=${filter} SSLSNIname=${fqdnname} CNname=${fqdnname} SANname=${fqdnname} + Deny-subaction action=deny subaction=RST + LogSession 1 + Enabled open + Security-Policies-OK Security-Source Name SecurityPolicy-Deny-HTTP-MaxCombination ${text} get text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr/td[2]/div/div/p Should Be Equal As Strings ${text} SecurityPolicy-Deny-HTTP-MaxCombination diff --git a/01-TestCase/tsg_ui/ui_tcppolicy/TCPPolicy.robot b/01-TestCase/tsg_ui/ui_tcppolicy/TCPPolicy.robot new file mode 100644 index 0000000..09f271b --- /dev/null +++ b/01-TestCase/tsg_ui/ui_tcppolicy/TCPPolicy.robot @@ -0,0 +1,37 @@ +*** Settings *** +Test Teardown run keywords Delete-Proxy-estimate ${PolicyName} +... AND Delete-object-estimate ${ObjName} +Force Tags tsg-ui objects security +Resource ../../../02-Keyword/tsg_ui/proxyTCPOptions/ProxyTCPOptions.robot +Library OperatingSystem +Resource ../../../02-Keyword/tsg_ui/Menu.robot +Resource ../../../03-Variable/bifangapivariable.txt +Resource ../../../02-Keyword/tsg_ui/objects/NewObjectPages.robot +Resource ../../../02-Keyword/tsg_ui/objects/NewObject.robot + +*** Test Cases *** +Proxy-TCP-Options001 + # #新建对象fqdn + # Comment 新建对象fqdn + # CreatePage FQDN single zdhfqdn keywordtext=*www.baidu.com + #新建策略 + Comment 新建策略 + Create-Proxy-TCP-Options Proxy-TCP-Options001 + Comment 添加源ip + TCPSource policytype=/html/body/div/div/div[3]/div[2]/div/div/div[1]/div[1]/div/div[2]/form/div[2] type1=Ip CreateOrSearch=Create Add=Address name=zdhip001 ipclienttext1=192.168.100.1 post=1 + Comment 添加目的ip + TCPDestination policytype=/html/body/div/div/div[3]/div[2]/div/div/div[1]/div[1]/div/div[2]/form/div[3] type1=Ip CreateOrSearch=Create Add=Address name=zdhip001 ipclienttext1=192.168.100.1 post=1 + ${ipname} create list zdhip001 zdhip001 + ${hostname} create list zdhfqdn + ${ObjName} create dictionary FQDN=${hostname} #IP=${ipname} + ${PolicyName} set variable Proxy-TCP-Options001 + ${filter} create list SNI + TCPFilter Filtercreate=${filter} SNIname=${hostname} + TCP-Enable-TCP-Passthrough Enable-TCP-Passthrough=open + TCP-Bypass-Duplicated-Packet Bypass-Duplicated-Packet=open + TCP-Client-side-Parameters ClientOverrideMSS=open ClientMSSvalue=800 ClientNoDelay=open Clientttlvalue=100 ClientKeepalive=open ClientProbeNumber=30 + ... ClientIdleTime=30 ClientInterval=30 ClientUserTimeout=500 + TCP-Server-side-Parameters ServerOverrideMSS=open ServerMSSvalue=800 ServerNoDelay=open Serverttlvalue=100 ServerKeepalive=open ServerProbeNumber=30 + ... ServerIdleTime=30 ServerInterval=30 ServerUserTimeout=500 + TCP-OK + TCP-Assertion Proxy-TCP-Options001 Name \ No newline at end of file diff --git a/02-Keyword/tsg_ui/Menu.robot b/02-Keyword/tsg_ui/Menu.robot index 7039214..12ee809 100644 --- a/02-Keyword/tsg_ui/Menu.robot +++ b/02-Keyword/tsg_ui/Menu.robot @@ -12,7 +12,7 @@ Menu ${objects} create dictionary IP=sidebarObjects_ip FQDN=sidebarObjects_fqdn SubscriberID=sidebarObjects_subscriberid HTTPSignature=sidebarObjects_http_signature Key=sidebarObjects_keywords URL=sidebarObjects_url Category=sidebarObjects_fqdn_category Account=sidebarObjects_account Applications=sidebarApplication ${log} create dictionary Security Event Logs=sidebarLog_SecurityEventLogs Proxy Event Logs=sidebarLog_ProxyEventLogs Session Records=sidebarLog_SesssionRecords Radius Logs=sidebarLog_RadiusLogs ${administration} create dictionary Accounts=sidebarsystem_accounts Audit Log=sidebarsystem_PolicyConfigurationLog Login Log =sidebarsystem_LoginLog Mail Server=sidebarsystem_MailServer LDAP Server=sidebarsystem_LadpServer Login Restrictions=sidebarLogin_Restrictions - + ${settings} create dictionary Proxy Profiles=sidebarProxy_Profiles WAN NAT Profiles=sidebarSetting_Wannat Certificate Managements=sidebarProxy_CertificateManagement Trouble Shooting=sidebarTrouble_shooting Advanced=sidebarAdvanced # 遍历一级菜单 FOR ${list} ${num} IN ENUMERATE @{dict} run keyword if "${num}"=="${menuOne}" run keywords sleep 2 diff --git a/02-Keyword/tsg_ui/securityPolicy/SecurityPolicy.robot b/02-Keyword/tsg_ui/SecurityPolicy/SecurityPolicy.robot similarity index 60% rename from 02-Keyword/tsg_ui/securityPolicy/SecurityPolicy.robot rename to 02-Keyword/tsg_ui/SecurityPolicy/SecurityPolicy.robot index 3c4d9e5..1a735c8 100644 --- a/02-Keyword/tsg_ui/securityPolicy/SecurityPolicy.robot +++ b/02-Keyword/tsg_ui/SecurityPolicy/SecurityPolicy.robot @@ -1,7 +1,7 @@ *** Settings *** Library Selenium2Library Resource ../objects/NewObject.robot -Resource ../Menu.robot +Resource SourceAndDestination.robot *** Keywords *** CreateButton [Documentation] 点击安全策略中的Create按钮 @@ -533,387 +533,6 @@ Create-Object-Search sleep 1 END -Create-Source - [Arguments] ${type1}=null ${CreateOrSearch}=null ${Add}=null ${name}=null - ... ${object_name}=null ${ipclienttext1}=null ${post}=null ${Country}=null ${City}=null - ... ${Protocols1}=null ${Degree}=null ${times}=null ${numbers}=null ${limits}=null ${keywordtext}=null - [Documentation] 调用次关键字前需要添加必填参数: - ... ${type1}:填入Ip或SUBID或Geography或IPLearning - ... ${CreateOrSearch}:填入Create或者Search - ... ${Add}:填入Address或Group - ... ${name}:名称 - ... ${ip_type}:填入Ip或者Geography或者IPLearning - ... ${ipclienttext1}:填入IPV4或6的值或range的ip段 - ... ${post}:填入端口 - ... ${Country}:列表形式,列表中是国家名字 - ... ${City}:列表形式,列表中是城市名字 - ... ${Protocols1}:填入HTTP或SSL或HTTPSSL - ... ${Degree}:填入1Degree或2Degree - ... ${times}:填入小时数,例如1或2 - ... ${numbers}:填入数值,例如1或10000 - ... ${limits}:填入数值,例如1或10000 - ... ${object_name}:列表形式,列表中是对象的名字 - ... ${keywordtext}:填入新建subid的内容 - ... 判断新建source选择用什么样的类型数据 - 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} ${post} ${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} ${post} ${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} ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits} - -Create-Destination - [Arguments] ${type1}=null ${CreateOrSearch}=null ${Add}=null ${name}=null - ... ${object_name}=null ${ipclienttext1}=null ${post}=null ${Country}=null ${City}=null - ... ${Protocols1}=null ${Degree}=null ${times}=null ${numbers}=null ${limits}=null ${keywordtext}=null - [Documentation] 调用次关键字前需要添加必填参数: - ... ${type1}:填入Ip或SUBID或Geography或IPLearning - ... ${CreateOrSearch}:填入Create或者Search - ... ${Add}:填入Address或Group - ... ${name}:名称 - ... ${ip_type}:填入Ip或者Geography或者IPLearning - ... ${ipclienttext1}:填入IPV4或6的值或range的ip段 - ... ${post}:填入端口 - ... ${Country}:列表形式,列表中是国家名字 - ... ${City}:列表形式,列表中是城市名字 - ... ${Protocols1}:填入HTTP或SSL或HTTPSSL - ... ${Degree}:填入1Degree或2Degree - ... ${times}:填入小时数,例如1或2 - ... ${numbers}:填入数值,例如1或10000 - ... ${limits}:填入数值,例如1或10000 - ... ${object_name}:列表形式,列表中是对象的名字 - ... ${keywordtext}:填入新建subid的内容 - ... 判断新建source选择用什么样的类型数据 - 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} - - -SourceIPCreateOrSearch - [Arguments] ${CreateOrSearch} ${Add} ${ip_type} ${name} ${object_name} ${ipclienttext1} - ... ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits} - [Documentation] 调用次关键字前需要添加必填参数: - ... ${CreateOrSearch}:填入Create或者Search - ... ${Add}:填入Address或Group - ... ${name}:名称 - ... ${ip_type}:填入Ip或者Geography或者IPLearning - ... ${ipclienttext1}:填入IPV4或6的值或range的ip段 - ... ${post}:填入端口 - ... ${Country}:列表形式,列表中是国家名字 - ... ${City}:列表形式,列表中是城市名字 - ... ${Protocols1}:填入HTTP或SSL或HTTPSSL - ... ${Degree}:填入1Degree或2Degree - ... ${times}:填入小时数,例如1或2 - ... ${numbers}:填入数值,例如1或10000 - ... ${limits}:填入数值,例如1或10000 - ... ${object_name}:列表形式,列表中是对象的名字 - ... 判断是新建ip还是搜索添加ip - run keyword if "${CreateOrSearch}"=="Create" run keywords sleep 1 - ... AND click element id=interceptionadd_proaddaddSource - ... AND SourceIPAdd ${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 ${object_name} -SUBIDCreateOrSearch - [Arguments] ${name} ${keywordtext} ${object_name} - [Documentation] 调用次关键字前需要添加必填参数: - ... ${CreateOrSearch}:填入Create或者Search - ... ${name}:名称 - ... ${keywordtext}:填入新建subid的内容 - ... ${object_name}:列表形式,列表中是对象的名字 - ... 判断是新建subid还是搜索添加subid - run keyword if "${CreateOrSearch}"=="Create" run keywords sleep 1 - ... 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} -DestinationIPCreateOrSearch - [Arguments] ${CreateOrSearch} ${Add} ${ip_type} ${name} ${object_name} ${ipclienttext1} - ... ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits} - [Documentation] 调用次关键字前需要添加必填参数: - ... ${CreateOrSearch}:填入Create或者Search - ... ${Add}:填入Address或Group - ... ${name}:名称 - ... ${ip_type}:填入Ip或者Geography或者IPLearning - ... ${ipclienttext1}:填入IPV4或6的值或range的ip段 - ... ${post}:填入端口 - ... ${Country}:列表形式,列表中是国家名字 - ... ${City}:列表形式,列表中是城市名字 - ... ${Protocols1}:填入HTTP或SSL或HTTPSSL - ... ${Degree}:填入1Degree或2Degree - ... ${times}:填入小时数,例如1或2 - ... ${numbers}:填入数值,例如1或10000 - ... ${limits}:填入数值,例如1或10000 - ... ${object_name}:列表形式,列表中是对象的名字 - ... 判断是新建ip还是搜索添加ip - run keyword if "${CreateOrSearch}"=="Create" run keywords sleep 1 - ... 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} -SourceSearch - [Arguments] ${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 - END -DestinationSearch - [Arguments] ${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 - END - -SUBIDAdd - [Arguments] ${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 - ... 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 click element xpath=/html/body/ul/li[2] - ... AND sleep 1 - ... AND SUBGroupAdd ${name} ${object_name} -SUBAddress - [Arguments] ${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 - Create-SubscriberID-text ${keywordtext} - sleep 1 - -SUBGroupAdd - [Arguments] ${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 - Create-Sub-Objects ${object_name} - NewObject.Create-ok -SourceIPAdd - [Arguments] ${Add} ${ip_type} ${name} ${object_name} ${ipclienttext1} ${post} ${Country} ${City} ${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 - ... AND click element xpath=/html/body/ul/li[1] - ... AND sleep 1 - ... AND SourceIPAddress ${name} ${ip_type} ${ipclienttext1} ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits} - ... ELSE IF "${Add}"=="Group" run keywords sleep 1 - ... AND click element xpath=/html/body/ul/li[2] - ... AND sleep 1 - ... AND SourceIPGroupAdd ${name} ${ip_type} ${object_name} -SourceIPAddress - [Arguments] ${name} ${ip_type} ${ipclienttext1} ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits} - [Documentation] 调用次关键字前需要添加必填参数: - ... ${name}:名称 - ... ${ip_type}:填入Ip或者Geography或者IPLearning - ... ${ipclienttext1}:填入IPV4或6的值或range的ip段 - ... ${post}:填入端口 - ... ${Country}:列表形式,列表中是国家名字 - ... ${City}:列表形式,列表中是城市名字 - ... ${Protocols1}:填入HTTP或SSL或HTTPSSL - ... ${Degree}:填入1Degree或2Degree - ... ${times}:填入小时数,例如1或2 - ... ${numbers}:填入数值,例如1或10000 - ... ${limits}:填入数值,例如1或10000 - ... 判断 新建选择用什么样的类型,并进行新建 - SourceCreate-name ${name} - sleep 1 - run keyword if "${ip_type}"=="Ip" run keywords click element xpath=//*[@id="policy_Manipulation2"]/div[1]/div[1]/div[2]/form/div[4]/div/div[1] - ... AND sleep 1 - ... AND NewObject.Create-ip-ClientIP-text ${ipclienttext1} ${post} - run keyword if "${ip_type}"=="Geography" run keywords click element id=objectAdd_ip1 - ... AND sleep 1 - ... AND click element xpath=//*[@id="policy_Manipulation2"]/div[1]/div[1]/div[2]/form/div[4]/div/div[1]/div[2] - ... AND sleep 1 - ... AND NewObject.Create-Geography ${Country} ${City} - ... AND sleep 1 - ... AND click element id=interceptionadd_allcancelobjec3t - ... AND sleep 1 - run keyword if "${ip_type}"=="IPLearning" run keywords click element id=objectAdd_ip2 - ... AND sleep 1 - ... AND click element xpath=//*[@id="policy_Manipulation2"]/div[1]/div[1]/div[2]/form/div[4]/div/div[1] - ... AND sleep 1 - ... AND input text xpath=//*[@id="policy_Manipulation2"]/div[1]/div[1]/div[2]/form/div[4]/div/div[4]/div/div[1]/div[2]/div[1]/div[1]/form/div[1]/div/div[1]/input ${fqdn} - ... AND sleep 1 - ... AND click element xpath=//*[@id="policy_Manipulation2"]/div[1]/div[1]/div[2]/form/div[5]/div[1]/div/div/div[2] - ... AND sleep 1 - ... AND Learn-From-Protocols ${Protocols1} - ... AND Learning-Depth ${Degree} - ... AND sleep 1 - ... AND input text xpath=//*[@id="policy_Manipulation2"]/div[1]/div[1]/div[2]/form/div[5]/div[3]/div/div[1]/input ${times} - ... AND sleep 1 - ... AND input text xpath=//*[@id="policy_Manipulation2"]/div[1]/div[1]/div[2]/form/div[5]/div[4]/div/div[1]/input ${numbers} - ... AND sleep 1 - ... AND input text xpath=//*[@id="policy_Manipulation2"]/div[1]/div[1]/div[2]/form/div[5]/div[5]/div/div[1]/input ${limits} - ... AND sleep 1 - sleep 1 - SourceCreate-ok - -DestinationIPAdd - [Arguments] ${Add} ${ip_type} ${name} ${object_name} ${ipclienttext1} ${post} ${Country} ${City} ${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 - ... AND click element xpath=/html/body/ul[contains(@id,'dropdown-menu' )and @x-placement='bottom-start']/child::li[1] - ... AND sleep 1 - ... AND DestinationIPAddress ${name} ${ip_type} ${ipclienttext1} ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits} - ... ELSE IF "${Add}"=="Group" run keywords sleep 1 - ... AND click element xpath=/html/body/ul[contains(@id,'dropdown-menu' )and @x-placement='bottom-start']/child::li[2] - ... AND sleep 1 - ... AND IPGroupAdd ${name} ${ip_type} ${object_name} -DestinationIPAddress - [Arguments] ${name} ${ip_type} ${ipclienttext1} ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits} - [Documentation] 调用次关键字前需要添加必填参数: - ... ${name}:名称 - ... ${ip_type}:填入Ip或者Geography或者IPLearning - ... ${ipclienttext1}:填入IPV4或6的值或range的ip段 - ... ${post}:填入端口 - ... ${Country}:列表形式,列表中是国家名字 - ... ${City}:列表形式,列表中是城市名字 - ... ${Protocols1}:填入HTTP或SSL或HTTPSSL - ... ${Degree}:填入1Degree或2Degree - ... ${times}:填入小时数,例如1或2 - ... ${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 - ... AND NewObject.Create-Geography ${Country} ${City} - ... AND sleep 1 - ... 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 -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] - -Learning-Depth - [Arguments] ${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] - -SourceIPGroupAdd - [Arguments] ${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] - Create-Sub-Objects ${object_name} - NewObject.Create-ok - -SourceCreate-name - [Arguments] ${objName} - sleep 2 - input text id=objectAdd_name ${objName} - -SourceCreate-ok - sleep 2 - 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} - -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] - Security-Source [Arguments] ${SourceType} ${SourceValue} diff --git a/02-Keyword/tsg_ui/SecurityPolicy/SourceAndDestination.robot b/02-Keyword/tsg_ui/SecurityPolicy/SourceAndDestination.robot new file mode 100644 index 0000000..30d7a43 --- /dev/null +++ b/02-Keyword/tsg_ui/SecurityPolicy/SourceAndDestination.robot @@ -0,0 +1,401 @@ +*** Settings *** +Library Selenium2Library +Resource ../objects/NewObject.robot +Resource ../Menu.robot +*** Keywords *** +Create-Source + [Arguments] ${policytype}=null ${type1}=null ${CreateOrSearch}=null ${Add}=null ${name}=null + ... ${object_name}=null ${ipclienttext1}=null ${post}=null ${Country}=null ${City}=null + ... ${Protocols1}=null ${Degree}=null ${times}=null ${numbers}=null ${limits}=null ${keywordtext}=null + [Documentation] 调用次关键字前需要添加必填参数: + ... ${policytype}:填入安全策略或管控策略或tcp策略中前置元素:安全和代理源:/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[4] 安全和代理目的:/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[5] + ... tcp源:/html/body/div[1]/div/div[3]/div[2]/div/div/div[1]/div[1]/div/div[2]/form/div[2] + ... tcp目的:/html/body/div[1]/div/div[3]/div[2]/div/div/div[1]/div[1]/div/div[2]/form/div[3] + ... ${type1}:填入Ip或SUBID或Geography或IPLearning + ... ${CreateOrSearch}:填入Create或者Search + ... ${Add}:填入Address或Group + ... ${name}:名称 + ... ${ip_type}:填入Ip或者Geography或者IPLearning + ... ${ipclienttext1}:填入IPV4或6的值或range的ip段 + ... ${post}:填入端口 + ... ${Country}:列表形式,列表中是国家名字 + ... ${City}:列表形式,列表中是城市名字 + ... ${Protocols1}:填入HTTP或SSL或HTTPSSL + ... ${Degree}:填入1Degree或2Degree + ... ${times}:填入小时数,例如1或2 + ... ${numbers}:填入数值,例如1或10000 + ... ${limits}:填入数值,例如1或10000 + ... ${object_name}:列表形式,列表中是对象的名字 + ... ${keywordtext}:填入新建subid的内容 + ... 判断新建source选择用什么样的类型数据 + ... + run keyword if "${type1}"=="Ip" 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[1] + ... AND sleep 1 + ... AND sleep 1 + ... AND SourceIPCreateOrSearch ${policytype} ${CreateOrSearch} ${Add} ${type1} ${name} ${object_name} ${ipclienttext1} ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits} + ... ELSE IF "${type1}"=="SUBID" run keywords sleep 2 + ... AND click element xpath=${policytype}/div[2]/div[1]/div[2]/div[1]/div/div/div/div[1]/div/div/div/div[2] + ... AND sleep 1 + ... AND SUBIDCreateOrSearch ${policytype} ${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 sleep 1 + ... AND SourceIPCreateOrSearch ${policytype} ${CreateOrSearch} ${Add} ${type1} ${name} ${object_name} ${ipclienttext1} ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits} + ... ELSE IF "${type1}"=="IPLearning" run keywords sleep 2 + ... AND click element xpath=${policytype}/div[2]/div[1]/div[2]/div[1]/div/div/div/div[1]/div/div/div/div[4] + ... AND sleep 1 + ... AND SourceIPCreateOrSearch ${policytype} ${CreateOrSearch} ${Add} ${type1} ${name} ${object_name} ${ipclienttext1} ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits} + +Create-Destination + [Arguments] ${policytype}=null ${type1}=null ${CreateOrSearch}=null ${Add}=null ${name}=null + ... ${object_name}=null ${ipclienttext1}=null ${post}=null ${Country}=null ${City}=null + ... ${Protocols1}=null ${Degree}=null ${times}=null ${numbers}=null ${limits}=null ${keywordtext}=null + [Documentation] 调用次关键字前需要添加必填参数: + ... ${type1}:填入Ip或SUBID或Geography或IPLearning + ... ${CreateOrSearch}:填入Create或者Search + ... ${Add}:填入Address或Group + ... ${name}:名称 + ... ${ip_type}:填入Ip或者Geography或者IPLearning + ... ${ipclienttext1}:填入IPV4或6的值或range的ip段 + ... ${post}:填入端口 + ... ${Country}:列表形式,列表中是国家名字 + ... ${City}:列表形式,列表中是城市名字 + ... ${Protocols1}:填入HTTP或SSL或HTTPSSL + ... ${Degree}:填入1Degree或2Degree + ... ${times}:填入小时数,例如1或2 + ... ${numbers}:填入数值,例如1或10000 + ... ${limits}:填入数值,例如1或10000 + ... ${object_name}:列表形式,列表中是对象的名字 + ... ${keywordtext}:填入新建subid的内容 + ... 判断新建source选择用什么样的类型数据 + run keyword if "${type1}"=="Ip" run keywords sleep 1 + ... AND click element xpath=${policytype}/div[2]/div[1]/div[2]/div[1]/div/div/div/div[1]/div/div/div/div[1] + ... AND sleep 1 + ... AND sleep 1 + ... AND DestinationIPCreateOrSearch ${policytype} ${CreateOrSearch} ${Add} ${type1} ${name} ${object_name} ${ipclienttext1} ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits} + ... ELSE IF "${type1}"=="Geography" run keywords sleep 1 + ... AND click element xpath=${policytype}/div[2]/div[1]/div[2]/div[1]/div/div/div/div[1]/div/div/div/div[3] + ... AND sleep 1 + ... AND DestinationIPCreateOrSearch ${policytype} ${CreateOrSearch} ${Add} ${type1} ${name} ${object_name} ${ipclienttext1} ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits} + ... ELSE IF "${type1}"=="IPLearning" run keywords sleep 1 + ... AND click element xpath=${policytype}/div[2]/div[1]/div[2]/div[1]/div/div/div/div[1]/div/div/div/div[4] + ... AND sleep 1 + ... AND DestinationIPCreateOrSearch ${policytype} ${CreateOrSearch} ${Add} ${type1} ${name} ${object_name} ${ipclienttext1} ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits} + + +SourceIPCreateOrSearch + [Arguments] ${policytype} ${CreateOrSearch} ${Add} ${ip_type} ${name} ${object_name} ${ipclienttext1} + ... ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits} + [Documentation] 调用次关键字前需要添加必填参数: + ... ${CreateOrSearch}:填入Create或者Search + ... ${Add}:填入Address或Group + ... ${name}:名称 + ... ${ip_type}:填入Ip或者Geography或者IPLearning + ... ${ipclienttext1}:填入IPV4或6的值或range的ip段 + ... ${post}:填入端口 + ... ${Country}:列表形式,列表中是国家名字 + ... ${City}:列表形式,列表中是城市名字 + ... ${Protocols1}:填入HTTP或SSL或HTTPSSL + ... ${Degree}:填入1Degree或2Degree + ... ${times}:填入小时数,例如1或2 + ... ${numbers}:填入数值,例如1或10000 + ... ${limits}:填入数值,例如1或10000 + ... ${object_name}:列表形式,列表中是对象的名字 + ... 判断是新建ip还是搜索添加ip + run keyword if "${CreateOrSearch}"=="Create" run keywords sleep 1 + ... 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 SourceSearch ${policytype} ${object_name} +SUBIDCreateOrSearch + [Arguments] ${policytype} ${name} ${keywordtext} ${object_name} + [Documentation] 调用次关键字前需要添加必填参数: + ... ${CreateOrSearch}:填入Create或者Search + ... ${name}:名称 + ... ${keywordtext}:填入新建subid的内容 + ... ${object_name}:列表形式,列表中是对象的名字 + ... 判断是新建subid还是搜索添加subid + run keyword if "${CreateOrSearch}"=="Create" run keywords sleep 1 + ... AND click element id=interceptionadd_proaddaddSource + ... AND SUBIDAdd ${policytype} ${Add} ${name} ${keywordtext} ${object_name} + ... ELSE IF "${CreateOrSearch}"=="Search" run keywords sleep 1 + ... AND SourceSearch ${object_name} +DestinationIPCreateOrSearch + [Arguments] ${policytype} ${CreateOrSearch} ${Add} ${ip_type} ${name} ${object_name} ${ipclienttext1} + ... ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits} + [Documentation] 调用次关键字前需要添加必填参数: + ... ${CreateOrSearch}:填入Create或者Search + ... ${Add}:填入Address或Group + ... ${name}:名称 + ... ${ip_type}:填入Ip或者Geography或者IPLearning + ... ${ipclienttext1}:填入IPV4或6的值或range的ip段 + ... ${post}:填入端口 + ... ${Country}:列表形式,列表中是国家名字 + ... ${City}:列表形式,列表中是城市名字 + ... ${Protocols1}:填入HTTP或SSL或HTTPSSL + ... ${Degree}:填入1Degree或2Degree + ... ${times}:填入小时数,例如1或2 + ... ${numbers}:填入数值,例如1或10000 + ... ${limits}:填入数值,例如1或10000 + ... ${object_name}:列表形式,列表中是对象的名字 + ... 判断是新建ip还是搜索添加ip + run keyword if "${CreateOrSearch}"=="Create" run keywords sleep 1 + ... AND click element id=interceptionadd_proaddaddDestination + ... AND DestinationIPAdd ${policytype} ${Add} ${ip_type} ${name} ${object_name} ${ipclienttext1} ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits} + ... ELSE IF "${CreateOrSearch}"=="Search" run keywords sleep 1 + ... AND DestinationSearch ${policytype} ${object_name} +SourceSearch + [Arguments] ${policytype} ${name} + [Documentation] 调用次关键字前需要添加必填参数: + ... ${name}:填入是一个列表,列表内容为source的name + ... 选择search对象 + FOR ${i} IN @{name} + input text xpath=${policytype}/div[2]/div[1]/div[2]/div[2]/div/div[1]/input ${i} + sleep 1 + press keys xpath=${policytype}/div[2]/div[1]/div[2]/div[2]/div/div[1]/input ENTER + sleep 1 + click element xpath=${policytype}/div[2]/div[1]/div[2]/div[2]/div/div[2]/div/div/ul/li[1] + sleep 1 + END +DestinationSearch + [Arguments] ${policytype} ${name} + [Documentation] 调用次关键字前需要添加必填参数: + ... ${name}:填入是一个列表,列表内容为source的name + ... 选择search对象 + FOR ${i} IN @{name} + input text xpath=${policytype}/div[2]/div[1]/div[2]/div[2]/div/div[1]/input ${i} + sleep 1 + press keys xpath=${policytype}/div[2]/div[1]/div[2]/div[2]/div/div[1]/input ENTER + sleep 1 + click element xpath=${policytype}/div[2]/div[1]/div[2]/div[2]/div/div[2]/div/div/ul/li[1] + sleep 1 + END + +SUBIDAdd + [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 + ... AND click element xpath=/html/body/ul/li[1] + ... AND sleep 1 + ... AND SUBAddress ${policytype}${name} ${keywordtext} + ... ELSE IF "${Add}"=="Group" run keywords sleep 1 + ... AND click element xpath=/html/body/ul/li[2] + ... AND sleep 1 + ... AND SUBGroupAdd ${policytype} ${name} ${object_name} +SUBAddress + [Arguments] ${policytype} ${name} ${keywordtext} + [Documentation] 调用次关键字前需要添加必填参数: + ... ${name}:名称 + ... ${keywordtext}:填入新建subid的内容 + ... 新建subid + SourceCreate-name ${name} + click element xpath=${policytype}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[3]/div/div[1] + sleep 1 + Create-SubscriberID-text ${keywordtext} + sleep 1 + +SUBGroupAdd + [Arguments] ${policytype} ${name} ${object_name} + [Documentation] 调用次关键字前需要添加必填参数: + ... ${name}:名称 + ... ${object_name}:列表形式,列表中是对象的名字 + ... 新建subid分组 + SourceCreate-name ${name} + click element xpath=${policytype}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[3]/div/div/div[2] + sleep 1 + Create-Sub-Objects ${object_name} + NewObject.Create-ok +SourceIPAdd + [Arguments] ${policytype} ${Add} ${ip_type} ${name} ${object_name} ${ipclienttext1} ${post} ${Country} ${City} ${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 + ... 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 click element xpath=/html/body/ul/li[2] + ... AND sleep 1 + ... AND SourceIPGroupAdd ${policytype} ${name} ${ip_type} ${object_name} +SourceIPAddress + [Arguments] ${policytype} ${name} ${ip_type} ${ipclienttext1} ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits} + [Documentation] 调用次关键字前需要添加必填参数: + ... ${name}:名称 + ... ${ip_type}:填入Ip或者Geography或者IPLearning + ... ${ipclienttext1}:填入IPV4或6的值或range的ip段 + ... ${post}:填入端口 + ... ${Country}:列表形式,列表中是国家名字 + ... ${City}:列表形式,列表中是城市名字 + ... ${Protocols1}:填入HTTP或SSL或HTTPSSL + ... ${Degree}:填入1Degree或2Degree + ... ${times}:填入小时数,例如1或2 + ... ${numbers}:填入数值,例如1或10000 + ... ${limits}:填入数值,例如1或10000 + ... 判断 新建选择用什么样的类型,并进行新建 + SourceCreate-name ${name} + sleep 1 + 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} + 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 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 NewObject.Create-Geography ${Country} ${City} + ... AND sleep 1 + ... AND click element xpath=${policytype}/div[2]/div[2]/div/div[1]/div[10]/div/div/div/div[4]/button + ... AND sleep 1 + 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 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 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 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 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 input text xpath=//*[@id="policy_Manipulation2"]/div[1]/div[1]/div[2]/form/div[5]/div[5]/div/div[1]/input ${limits} + ... AND sleep 1 + sleep 3 + SourceCreate-ok + +DestinationIPAdd + [Arguments] ${policytype} ${Add} ${ip_type} ${name} ${object_name} ${ipclienttext1} ${post} ${Country} ${City} ${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 + ... 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 click element xpath=/html/body/ul[contains(@id,'dropdown-menu' )and @x-placement='bottom-start']/child::li[2] + ... AND sleep 1 + ... AND DestinationIPGroupAdd ${policytype} ${name} ${ip_type} ${object_name} +DestinationIPAddress + [Arguments] ${policytype} ${name} ${ip_type} ${ipclienttext1} ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits} + [Documentation] 调用次关键字前需要添加必填参数: + ... ${name}:名称 + ... ${ip_type}:填入Ip或者Geography或者IPLearning + ... ${ipclienttext1}:填入IPV4或6的值或range的ip段 + ... ${post}:填入端口 + ... ${Country}:列表形式,列表中是国家名字 + ... ${City}:列表形式,列表中是城市名字 + ... ${Protocols1}:填入HTTP或SSL或HTTPSSL + ... ${Degree}:填入1Degree或2Degree + ... ${times}:填入小时数,例如1或2 + ... ${numbers}:填入数值,例如1或10000 + ... ${limits}:填入数值,例如1或10000 + ... 判断 新建选择用什么样的类型,并进行新建 + DestinationCreate-name ${policytype} ${name} + sleep 1 + 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} + 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 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 NewObject.Create-Geography ${Country} ${City} + ... AND sleep 1 + ... AND click element id=interceptionadd_allcancelobjec3t + ... AND sleep 1 + 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 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 click element xpath=${policytype}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[5]/div[1]/div/div/div[2] + ... AND sleep 1 + ... AND Learn-From-Protocols ${Protocols1} + ... AND Learning-Depth ${policytype} ${Degree} + ... AND sleep 1 + ... AND input text xpath=${policytype}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[5]/div[3]/div/div[1]/input ${times} + ... AND sleep 1 + ... AND input text xpath=${policytype}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[5]/div[4]/div/div[1]/input ${numbers} + ... AND sleep 1 + ... AND input text xpath=${policytype}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[5]/div[5]/div/div[1]/input ${limits} + ... AND sleep 1 + 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/div[1]/div[1]/ul/li[1] + run keyword if "${Protocols1}"=="SSL" run keywords sleep 1 + ... AND click element xpath=/html/body/div/div[1]/div[1]/ul/li[2] + run keyword if "${Protocols1}"=="HTTPSSL" run keywords sleep 1 + ... AND click element xpath=/html/body/div/div[1]/div[1]/ul/li[1] + ... AND sleep 1 + ... AND click element xpath=/html/body/div/div[1]/div[1]/ul/li[2] + +Learning-Depth + [Arguments] ${policytype} ${Degree} + [Documentation] 调用次关键字前需要添加必填参数: + ... ${Degree}:填入1Degree或2Degree + ... 判断是用1Degree或2Degree + run keyword if "${Degree}"=="1Degree" run keywords sleep 1 + ... AND click element xpath=${policytype}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[5]/div[2]/div/div/label[1] + run keyword if "${Degree}"=="2Degree" run keywords sleep 1 + ... AND click element xpath=${policytype}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[5]/div[2]/div/div/label[2] + +SourceIPGroupAdd + [Arguments] ${policytype} ${name} ${ip_type} ${object_name} + [Documentation] 调用次关键字前需要添加必填参数: + ... ${name}:名称 + ... ${ip_type}:填入Ip或者Geography + ... ${object_name}:列表形式,列表中是对象的名字 + SourceCreate-name ${name} + Select-ip_type ${ip_type} + sleep 1 + 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 1 + 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} + +SourceCreate-ok + sleep 2 + click button id=objectAdd_ok + +DestinationCreate-name + [Arguments] ${policytype} ${objName} + input text xpath=${policytype}/div[2]/div[2]/div/div[1]/div[1]/div[2]/form/div[1]/div/div[1]/input ${objName} + +DestinationCreate-ok + [Arguments] ${policytype} + sleep 2 + click button xpath=${policytype}/div[2]/div[2]/div/div[2]/button[1] diff --git a/02-Keyword/tsg_ui/proxyPolicy/ProxyPolicy.robot b/02-Keyword/tsg_ui/proxyPolicy/ProxyPolicy.robot index 0ae83f4..5b88557 100644 --- a/02-Keyword/tsg_ui/proxyPolicy/ProxyPolicy.robot +++ b/02-Keyword/tsg_ui/proxyPolicy/ProxyPolicy.robot @@ -38,7 +38,7 @@ Create-action Create-Source-Button [Documentation] 点击Source的加号 - sleep 2 + sleep 2 click element xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[4]/div[1]/div/div Create-Destination-Button @@ -71,95 +71,70 @@ HttpOrDoh ... AND click element id=interceptionadd_checkappshow0 ... AND sleep 1 ... AND click element xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[7]/div[3]/div/button -Create-Filter-judge - [Arguments] ${Application}=null ${Filter}=null ${Hostname}=null ${URLname}=null ${Request Headername}=null ${Response Headername}=null ${Request Contentname}=null - ... ${Response Contentname}=null ${SSLSNIname}=null ${CNname}=null ${SANname}=null ${QNAMEname}=null ${Subjectname}=null ${MAILContentname}=null ${Attachment Namename}=null - ... ${Attachment Contentname}=null ${Fromname}=null ${Toname}=null ${MAILAccountname}=null ${URIname}=null ${FTPContentname}=null ${FTPAccountname}=null ${QUICSNIname}=null - [Documentation] 调用次关键字前需要添加必填参数: - ... ${Application}:填入是Application的内容,例如SSL或HTTP - ... ${Filter}:是一个列表,列表中填入filter类型,例如Host或URL等 - ... name:各个对象名称的列表 - ... 判断filter是否可以点击 - ${class}= Get Element Attribute xpath=/html/body/div[1]/div/div[3]/div[2]/div/div[1]/form/div/div[8]/div[1]/div/div[1] class - run keyword if "${class}"=="addobject addobject-long-list obj-content-null filter-width-style cursor addobject-long-list-disabled" log filter不可点击,不可添加filter - run keyword if "${class}"=="addobject addobject-long-list obj-content-null filter-width-style cursor" run keywords sleep 1 - ... AND Create-Filter ${Application} ${Filter} ${Hostname} ${URLname} ${Request Headername} ${Response Headername} ${Request Contentname} - ... ${Response Contentname} ${SSLSNIname} ${CNname} ${SANname} ${QNAMEname} ${Subjectname} ${MAILContentname} ${Attachment Namename} - ... ${Attachment Contentname} ${Fromname} ${Toname} ${MAILAccountname} ${URIname} ${FTPContentname} ${FTPAccountname} ${QUICSNIname} + Create-Filter - [Arguments] ${Application} ${Filter} ${Hostname} ${URLname} ${Request Headername} ${Response Headername} ${Request Contentname} - ... ${Response Contentname} ${SSLSNIname} ${CNname} ${SANname} ${QNAMEname} ${Subjectname} ${MAILContentname} ${Attachment Namename} - ... ${Attachment Contentname} ${Fromname} ${Toname} ${MAILAccountname} ${URIname} ${FTPContentname} ${FTPAccountname} ${QUICSNIname} + [Arguments] ${Application}=null ${Filter}=null ${Hostname}=null ${URLname}=null ${Request Headername}=null ${Response Headername}=null ${Request Contentname}=null + ... ${Response Contentname}=null ${QNAMEname}=null ${DohHostname}=null [Documentation] 调用次关键字前需要添加必填参数: ... ${Application}:填入是Application的内容,例如SSL或HTTP ... ${Filter}:是一个列表,列表中填入filter类型,例如Host或URL等 ... name:各个对象名称的列表 - ... 判断添加filter类型 + ... 判断添加filter类型 xpath=//*[@id="policy_paper_left"]/div[8]/div/div[1]/label[contains(text(), "${filter}")]/following-sibling::div/div //*[@id="interceptionadd_checkappshow0"][contains(text(), "${filter}")] sleep 2 FOR ${i} IN @{Filter} sleep 1 click element id=interceptionadd_add_filter sleep 1 run keyword if "${Application}"=="HTTP" and "${i}"=="Host" run keywords sleep 1 - ... AND click element xpath=//*[@id="condistions_protocol"]/div/div[1]/div/div/div/ul/li[1] + ... AND click element xpath=//*[@id="interceptionadd_checkappshow0"][contains(text(), "${i}")] ... AND Create-Object-Search ${Hostname} ${i} run keyword if "${Application}"=="HTTP" and "${i}"=="URL" run keywords sleep 1 - ... AND click element xpath=//*[@id="condistions_protocol"]/div/div[1]/div/div/div/ul/li[2] + ... AND click element xpath=//*[@id="interceptionadd_checkappshow1"][contains(text(), "${i}")] ... AND Create-Object-Search ${URLname} ${i} run keyword if "${Application}"=="HTTP" and "${i}"=="Request Header" run keywords sleep 1 - ... AND click element xpath=//*[@id="condistions_protocol"]/div/div[1]/div/div/div/ul/li[3] + ... AND click element xpath=//*[@id="interceptionadd_checkappshow2"][contains(text(), "${i}")] ... AND Create-Object-Search ${Request Headername} ${i} run keyword if "${Application}"=="HTTP" and "${i}"=="Response Header" run keywords sleep 1 - ... AND click element xpath=//*[@id="condistions_protocol"]/div/div[1]/div/div/div/ul/li[4] + ... AND click element xpath=//*[@id="interceptionadd_checkappshow3"][contains(text(), "${i}")] ... AND Create-Object-Search ${Response Headername} ${i} run keyword if "${Application}"=="HTTP" and "${i}"=="Request Content" run keywords sleep 1 - ... AND click element xpath=//*[@id="condistions_protocol"]/div/div[1]/div/div/div/ul/li[5] + ... AND click element xpath=//*[@id="interceptionadd_checkappshow4"][contains(text(), "${i}")] ... AND Create-Object-Search ${Request Contentname} ${i} run keyword if "${Application}"=="HTTP" and "${i}"=="Response Content" run keywords sleep 1 - ... AND click element xpath=//*[@id="condistions_protocol"]/div/div[1]/div/div/div/ul/li[6] + ... AND click element xpath=//*[@id="interceptionadd_checkappshow5"][contains(text(), "${i}")] ... AND Create-Object-Search ${Response Contentname} ${i} run keyword if "${Application}"=="Doh" and "${i}"=="Host" run keywords sleep 1 - ... AND click element xpath=//*[@id="condistions_protocol"]/div/div[1]/div/div/div/ul/li[1] + ... AND click element xpath=//*[@id="interceptionadd_checkappshow0"][contains(text(), "${i}")] ... AND Create-Object-Search ${DohHostname} ${i} run keyword if "${Application}"=="Doh" and "${i}"=="QNAME" run keywords sleep 1 - ... AND click element xpath=//*[@id="condistions_protocol"]/div/div[1]/div/div/div/ul/li[2] + ... 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} ${denycode} [Documentation] 调用次关键字前需要添加必填参数: - ... ${code}:填入403或404 - ... ${Content}:填入TEXT或Profile - ... ${SearchorCreate}:填入Search或Create - ... ${block-text}:填入TEXT文本框内容 - ... ${ProfileName}:Profile的名字 - ... ${file}:上传文件路径 - ... ${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值 + ... ${denycode}:填入403或404或451 + ... ${action}:填入deny ... 添加subaction run keyword if "${action}"=="deny" and "${denycode}"=="403" run keywords sleep 1 ... AND click element id=manipulation_select_addAction ... AND sleep 1 - ... AND click element xpath=/html/body/div[10]/div[1]/div[1]/ul/li[1] + ... AND click element //span[.="${denycode}"] ... AND sleep 1 - run keyword if "${action}"=="deny" and "${subaction}"=="404" run keywords sleep 1 + run keyword if "${action}"=="deny" and "${denycode}"=="404" run keywords sleep 1 ... AND click element id=manipulation_select_addAction ... AND sleep 1 - ... AND click element xpath=/html/body/div[10]/div[1]/div[1]/ul/li[2] + ... AND click element //span[.="${denycode}"] ... AND sleep 1 - run keyword if "${action}"=="deny" and "${subaction}"=="451" run keywords sleep 1 + run keyword if "${action}"=="deny" and "${denycode}"=="451" run keywords sleep 1 ... AND click element id=manipulation_select_addAction ... AND sleep 1 - ... AND click element xpath=/html/body/div[10]/div[1]/div[1]/ul/li[2] + ... AND click element //span[.="${denycode}"] ... AND sleep 1 ... AND Deny-content - [Arguments] ${contenttype} ${SearchorCreate} ${ProfileName} ${file} + [Arguments] ${contenttype}=File ${SearchorCreate}=null ${ProfileName}=null ${file}=null ${textvalue}=null [Documentation] 调用次关键字前需要添加必填参数: ... ${code}:填入403或404 ... ${Content}:填入TEXT或Profile @@ -167,9 +142,9 @@ Deny-content ... ${block-text}:填入TEXT文本框内容 ... ${ProfileName}:Profile的名字 ... ${file}:上传文件路径 + ... ${textvalue}:填入text输入框内容 ... 添加block数据内容 sleep 1 - click element id=denyUserRegionBlock_code run keyword if "${contenttype}"=="File" run keywords sleep 1 ... AND click element id=manipulation_select_blockInfo ... AND sleep 1 @@ -178,6 +153,13 @@ Deny-content ... AND click element id=manipulation_select_htmlProfile ... AND sleep 1 ... AND Profile-SearchorCreate ${SearchorCreate} ${ProfileName} ${file} + run keyword if "${contenttype}"=="Text" run keywords sleep 1 + ... AND click element id=manipulation_select_blockInfo + ... AND sleep 1 + ... AND click ellement id=ResponseContentText + ... AND sllep 1 + ... AND input text id=manipulation_elInput_blockselect ${textvalue} + ... AND sleep 1 Profile-SearchorCreate [Arguments] ${SearchorCreate} ${ProfileName} ${file} [Documentation] 调用次关键字前需要添加必填参数: @@ -186,8 +168,6 @@ Profile-SearchorCreate ... ${file}:上传文件路径 ... 判断是新建还是搜索profile sleep 1 - click element id=html_profile - sleep 1 run keyword if "${SearchorCreate}"=="Search" run keywords sleep 1 ... AND input text xapth=/html/body/div/div[1]/div[1]/ul/div[1]/div/input ${ProfileName} ... AND sleep 1 @@ -202,7 +182,7 @@ Profile-SearchorCreate ... AND sleep 1 ... AND Choose File xpath=//*[@id="policy_Manipulation_create6"]/div[2]/form/div[2]/div/div/div/input ${file} #上传文件 ... AND sleep 1 - ... AND clcik element id=responseAddOk1 + ... AND click element id=responseAddOk1 ... AND sleep 1 ... ELSE log 传入参数错误 Deny-Redirect @@ -436,7 +416,7 @@ Enabled ... AND click element xpath=/html/body/div/div/div[3]/button[2] ... ELSE log 开启日志 -Security-Policies-OK +Proxy-Policies-OK sleep 1 click element id=proxyManipulationSuccess sleep 1 @@ -444,9 +424,9 @@ Create-Object-Search [Arguments] ${name} ${filter} [Documentation] 调用次关键字前需要添加必填参数: ... ${name}:填入是一个列表,列表内容为object的name - ... 选择search对象 + ... 选择search对象 sleep 1 - click element xpath=//*[@id="policy_paper_left"]/div[8]/div/div[1]/label[contains(text(), "${filter}")]/following-sibling::div/div + click element xpath=//*[@id="policy_paper_left"]/div[9]/div/div[1]/label[contains(text(), "${filter}")]/following-sibling::div/div sleep 1 FOR ${i} IN @{name} input text xpath=//*[@id="condistions_protocol"]/div[2]/p[contains(text(), "${filter}")]/following-sibling::div[2]/div/div[1]/input ${i} @@ -457,391 +437,10 @@ Create-Object-Search sleep 1 END -Create-Source - [Arguments] ${type1}=null ${CreateOrSearch}=null ${Add}=null ${name}=null - ... ${object_name}=null ${ipclienttext1}=null ${post}=null ${Country}=null ${City}=null - ... ${Protocols1}=null ${Degree}=null ${times}=null ${numbers}=null ${limits}=null ${keywordtext}=null - [Documentation] 调用次关键字前需要添加必填参数: - ... ${type1}:填入Ip或SUBID或Geography或IPLearning - ... ${CreateOrSearch}:填入Create或者Search - ... ${Add}:填入Address或Group - ... ${name}:名称 - ... ${ip_type}:填入Ip或者Geography或者IPLearning - ... ${ipclienttext1}:填入IPV4或6的值或range的ip段 - ... ${post}:填入端口 - ... ${Country}:列表形式,列表中是国家名字 - ... ${City}:列表形式,列表中是城市名字 - ... ${Protocols1}:填入HTTP或SSL或HTTPSSL - ... ${Degree}:填入1Degree或2Degree - ... ${times}:填入小时数,例如1或2 - ... ${numbers}:填入数值,例如1或10000 - ... ${limits}:填入数值,例如1或10000 - ... ${object_name}:列表形式,列表中是对象的名字 - ... ${keywordtext}:填入新建subid的内容 - ... 判断新建source选择用什么样的类型数据 - 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} ${post} ${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} ${post} ${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} ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits} - -Create-Destination - [Arguments] ${type1}=null ${CreateOrSearch}=null ${Add}=null ${name}=null - ... ${object_name}=null ${ipclienttext1}=null ${post}=null ${Country}=null ${City}=null - ... ${Protocols1}=null ${Degree}=null ${times}=null ${numbers}=null ${limits}=null ${keywordtext}=null - [Documentation] 调用次关键字前需要添加必填参数: - ... ${type1}:填入Ip或SUBID或Geography或IPLearning - ... ${CreateOrSearch}:填入Create或者Search - ... ${Add}:填入Address或Group - ... ${name}:名称 - ... ${ip_type}:填入Ip或者Geography或者IPLearning - ... ${ipclienttext1}:填入IPV4或6的值或range的ip段 - ... ${post}:填入端口 - ... ${Country}:列表形式,列表中是国家名字 - ... ${City}:列表形式,列表中是城市名字 - ... ${Protocols1}:填入HTTP或SSL或HTTPSSL - ... ${Degree}:填入1Degree或2Degree - ... ${times}:填入小时数,例如1或2 - ... ${numbers}:填入数值,例如1或10000 - ... ${limits}:填入数值,例如1或10000 - ... ${object_name}:列表形式,列表中是对象的名字 - ... ${keywordtext}:填入新建subid的内容 - ... 判断新建source选择用什么样的类型数据 - 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} - - -SourceIPCreateOrSearch - [Arguments] ${CreateOrSearch} ${Add} ${ip_type} ${name} ${object_name} ${ipclienttext1} - ... ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits} - [Documentation] 调用次关键字前需要添加必填参数: - ... ${CreateOrSearch}:填入Create或者Search - ... ${Add}:填入Address或Group - ... ${name}:名称 - ... ${ip_type}:填入Ip或者Geography或者IPLearning - ... ${ipclienttext1}:填入IPV4或6的值或range的ip段 - ... ${post}:填入端口 - ... ${Country}:列表形式,列表中是国家名字 - ... ${City}:列表形式,列表中是城市名字 - ... ${Protocols1}:填入HTTP或SSL或HTTPSSL - ... ${Degree}:填入1Degree或2Degree - ... ${times}:填入小时数,例如1或2 - ... ${numbers}:填入数值,例如1或10000 - ... ${limits}:填入数值,例如1或10000 - ... ${object_name}:列表形式,列表中是对象的名字 - ... 判断是新建ip还是搜索添加ip - run keyword if "${CreateOrSearch}"=="Create" run keywords sleep 1 - ... AND click element id=interceptionadd_proaddaddSource - ... AND SourceIPAdd ${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 ${object_name} -SUBIDCreateOrSearch - [Arguments] ${name} ${keywordtext} ${object_name} - [Documentation] 调用次关键字前需要添加必填参数: - ... ${CreateOrSearch}:填入Create或者Search - ... ${name}:名称 - ... ${keywordtext}:填入新建subid的内容 - ... ${object_name}:列表形式,列表中是对象的名字 - ... 判断是新建subid还是搜索添加subid - run keyword if "${CreateOrSearch}"=="Create" run keywords sleep 1 - ... 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} -DestinationIPCreateOrSearch - [Arguments] ${CreateOrSearch} ${Add} ${ip_type} ${name} ${object_name} ${ipclienttext1} - ... ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits} - [Documentation] 调用次关键字前需要添加必填参数: - ... ${CreateOrSearch}:填入Create或者Search - ... ${Add}:填入Address或Group - ... ${name}:名称 - ... ${ip_type}:填入Ip或者Geography或者IPLearning - ... ${ipclienttext1}:填入IPV4或6的值或range的ip段 - ... ${post}:填入端口 - ... ${Country}:列表形式,列表中是国家名字 - ... ${City}:列表形式,列表中是城市名字 - ... ${Protocols1}:填入HTTP或SSL或HTTPSSL - ... ${Degree}:填入1Degree或2Degree - ... ${times}:填入小时数,例如1或2 - ... ${numbers}:填入数值,例如1或10000 - ... ${limits}:填入数值,例如1或10000 - ... ${object_name}:列表形式,列表中是对象的名字 - ... 判断是新建ip还是搜索添加ip - run keyword if "${CreateOrSearch}"=="Create" run keywords sleep 1 - ... 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} -SourceSearch - [Arguments] ${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 - END -DestinationSearch - [Arguments] ${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 - END - -SUBIDAdd - [Arguments] ${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 - ... 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 click element xpath=/html/body/ul/li[2] - ... AND sleep 1 - ... AND SUBGroupAdd ${name} ${object_name} -SUBAddress - [Arguments] ${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 - Create-SubscriberID-text ${keywordtext} - sleep 1 - -SUBGroupAdd - [Arguments] ${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 - Create-Sub-Objects ${object_name} - NewObject.Create-ok -SourceIPAdd - [Arguments] ${Add} ${ip_type} ${name} ${object_name} ${ipclienttext1} ${post} ${Country} ${City} ${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 - ... AND click element xpath=/html/body/ul/li[1] - ... AND sleep 1 - ... AND SourceIPAddress ${name} ${ip_type} ${ipclienttext1} ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits} - ... ELSE IF "${Add}"=="Group" run keywords sleep 1 - ... AND click element xpath=/html/body/ul/li[2] - ... AND sleep 1 - ... AND SourceIPGroupAdd ${name} ${ip_type} ${object_name} -SourceIPAddress - [Arguments] ${name} ${ip_type} ${ipclienttext1} ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits} - [Documentation] 调用次关键字前需要添加必填参数: - ... ${name}:名称 - ... ${ip_type}:填入Ip或者Geography或者IPLearning - ... ${ipclienttext1}:填入IPV4或6的值或range的ip段 - ... ${post}:填入端口 - ... ${Country}:列表形式,列表中是国家名字 - ... ${City}:列表形式,列表中是城市名字 - ... ${Protocols1}:填入HTTP或SSL或HTTPSSL - ... ${Degree}:填入1Degree或2Degree - ... ${times}:填入小时数,例如1或2 - ... ${numbers}:填入数值,例如1或10000 - ... ${limits}:填入数值,例如1或10000 - ... 判断 新建选择用什么样的类型,并进行新建 - SourceCreate-name ${name} - sleep 1 - run keyword if "${ip_type}"=="Ip" run keywords click element xpath=//*[@id="policy_Manipulation2"]/div[1]/div[1]/div[2]/form/div[4]/div/div[1] - ... AND sleep 1 - ... AND NewObject.Create-ip-ClientIP-text ${ipclienttext1} ${post} - run keyword if "${ip_type}"=="Geography" run keywords click element id=objectAdd_ip1 - ... AND sleep 1 - ... AND click element xpath=//*[@id="policy_Manipulation2"]/div[1]/div[1]/div[2]/form/div[4]/div/div[1]/div[2] - ... AND sleep 1 - ... AND NewObject.Create-Geography ${Country} ${City} - ... AND sleep 1 - ... AND click element id=interceptionadd_allcancelobjec3t - ... AND sleep 1 - run keyword if "${ip_type}"=="IPLearning" run keywords click element id=objectAdd_ip2 - ... AND sleep 1 - ... AND click element xpath=//*[@id="policy_Manipulation2"]/div[1]/div[1]/div[2]/form/div[4]/div/div[1] - ... AND sleep 1 - ... AND input text xpath=//*[@id="policy_Manipulation2"]/div[1]/div[1]/div[2]/form/div[4]/div/div[4]/div/div[1]/div[2]/div[1]/div[1]/form/div[1]/div/div[1]/input ${fqdn} - ... AND sleep 1 - ... AND click element xpath=//*[@id="policy_Manipulation2"]/div[1]/div[1]/div[2]/form/div[5]/div[1]/div/div/div[2] - ... AND sleep 1 - ... AND Learn-From-Protocols ${Protocols1} - ... AND Learning-Depth ${Degree} - ... AND sleep 1 - ... AND input text xpath=//*[@id="policy_Manipulation2"]/div[1]/div[1]/div[2]/form/div[5]/div[3]/div/div[1]/input ${times} - ... AND sleep 1 - ... AND input text xpath=//*[@id="policy_Manipulation2"]/div[1]/div[1]/div[2]/form/div[5]/div[4]/div/div[1]/input ${numbers} - ... AND sleep 1 - ... AND input text xpath=//*[@id="policy_Manipulation2"]/div[1]/div[1]/div[2]/form/div[5]/div[5]/div/div[1]/input ${limits} - ... AND sleep 1 - sleep 1 - SourceCreate-ok - -DestinationIPAdd - [Arguments] ${Add} ${ip_type} ${name} ${object_name} ${ipclienttext1} ${post} ${Country} ${City} ${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 - ... AND click element xpath=/html/body/ul[contains(@id,'dropdown-menu' )and @x-placement='bottom-start']/child::li[1] - ... AND sleep 1 - ... AND DestinationIPAddress ${name} ${ip_type} ${ipclienttext1} ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits} - ... ELSE IF "${Add}"=="Group" run keywords sleep 1 - ... AND click element xpath=/html/body/ul[contains(@id,'dropdown-menu' )and @x-placement='bottom-start']/child::li[2] - ... AND sleep 1 - ... AND IPGroupAdd ${name} ${ip_type} ${object_name} -DestinationIPAddress - [Arguments] ${name} ${ip_type} ${ipclienttext1} ${post} ${Country} ${City} ${Protocols1} ${Degree} ${times} ${numbers} ${limits} - [Documentation] 调用次关键字前需要添加必填参数: - ... ${name}:名称 - ... ${ip_type}:填入Ip或者Geography或者IPLearning - ... ${ipclienttext1}:填入IPV4或6的值或range的ip段 - ... ${post}:填入端口 - ... ${Country}:列表形式,列表中是国家名字 - ... ${City}:列表形式,列表中是城市名字 - ... ${Protocols1}:填入HTTP或SSL或HTTPSSL - ... ${Degree}:填入1Degree或2Degree - ... ${times}:填入小时数,例如1或2 - ... ${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 - ... AND NewObject.Create-Geography ${Country} ${City} - ... AND sleep 1 - ... 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 -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] - -Learning-Depth - [Arguments] ${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] - -SourceIPGroupAdd - [Arguments] ${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] - Create-Sub-Objects ${object_name} - NewObject.Create-ok - -SourceCreate-name - [Arguments] ${objName} - sleep 2 - input text id=objectAdd_name ${objName} - -SourceCreate-ok - sleep 2 - 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} - -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] - Proxy-Source [Arguments] ${SourceType} ${SourceValue} - Wait Until Element Is Enabled xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[1]/span/div/div/div[2]/div/div 10 + sleep 3 click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[1]/span/div/div/div[2]/div/div sleep 1 run keyword if "${SourceType}"=="ID" run keywords sleep 1 @@ -895,10 +494,16 @@ Initialize-Policie ... 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 +Delete-Proxy-estimate + [Arguments] ${securityname} + run keyword if "${securityname}"!="null" run keywords sleep 1 + ... AND Delete-Proxy ${securityname} + ... ELSE log go on + Delete-Proxy [Arguments] ${securityname} - - Menu policys Security Policy + + Menu policys Proxy Policy sleep 2 Wait Until Element Is Enabled xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[1]/span/div/div/div[2]/div/div 10 click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[1]/span/div/div/div[2]/div/div @@ -917,6 +522,11 @@ Delete-Proxy Run Keyword And Ignore Error click element xpath=/html/body/div/div/div[3]/button[2] sleep 1 +Delete-object-estimate + [Arguments] ${obj} + run keyword if "${obj}"!="null" run keywords sleep 1 + ... AND Delete-object ${obj} + ... ELSE log go on Delete-object [Arguments] ${obj} FOR ${num} ${key} IN ENUMERATE @{obj} @@ -944,4 +554,4 @@ Forname sleep 1 Run Keyword And Ignore Error click element xpath=/html/body/div/div/div[3]/button[2] sleep 1 - END + END \ No newline at end of file diff --git a/02-Keyword/tsg_ui/proxyTCPOptions/ProxyTCPOptions.robot b/02-Keyword/tsg_ui/proxyTCPOptions/ProxyTCPOptions.robot new file mode 100644 index 0000000..314e495 --- /dev/null +++ b/02-Keyword/tsg_ui/proxyTCPOptions/ProxyTCPOptions.robot @@ -0,0 +1,243 @@ +*** Settings *** +Library Selenium2Library +Resource ../Menu.robot +Resource ../SecurityPolicy/SourceAndDestination.robot + +*** Keywords *** +Create-Proxy-TCP-Options + [Arguments] ${tcpname} + Sleep 1 + Menu settings Advanced + sleep 1 + click element id=Advanced/advanced #点击Proxy-TCP-Options + sleep 1 + click element id=proxyTCPCreate #点击Create按钮 + sleep 1 + input text id=advancedAdd_policyName ${tcpname} #输入name + sleep 1 + +TCPSource + [Arguments] ${Source}=yes ${policytype}=null ${type1}=null ${CreateOrSearch}=null ${Add}=null ${name}=null + ... ${object_name}=null ${ipclienttext1}=null ${post}=null ${Country}=null ${City}=null + ... ${Protocols1}=null ${Degree}=null ${times}=null ${numbers}=null ${limits}=null ${keywordtext}=null + #判断是否添加源ip,${Source}=yes,为添加源ip,否则不添加源ip + run keyword if "${Source}"=="yes" run keywords sleep 1 + ... AND click element xpath=/html/body/div[1]/div/div[3]/div[2]/div/div/div[1]/div[1]/div/div[2]/form/div[2]/div[1]/div/div #点击添加源ip + ... AND sleep 1 + ... AND Create-Source ${policytype} ${type1} ${CreateOrSearch} ${Add} ${name} + ... ${object_name} ${ipclienttext1} ${post} ${Country} ${City} + ... ${Protocols1} ${Degree} ${times} ${numbers} ${limits} ${keywordtext} + ... ELSE log 不添加源ip +TCPDestination + [Arguments] ${Destination}=yes ${policytype}=null ${type1}=null ${CreateOrSearch}=null ${Add}=null ${name}=null + ... ${object_name}=null ${ipclienttext1}=null ${post}=null ${Country}=null ${City}=null + ... ${Protocols1}=null ${Degree}=null ${times}=null ${numbers}=null ${limits}=null ${keywordtext}=null + #判断是否添加目的ip,${Destination}=yes,为添加目的ip,否则不添加目的ip + sleep 1 + run keyword if "${Destination}"=="yes" run keywords sleep 1 + ... AND click element xpath=/html/body/div[1]/div/div[3]/div[2]/div/div/div[1]/div[1]/div/div[2]/form/div[3]/div[1]/div/div #点击添加目的ip + ... AND sleep 1 + ... AND Create-Destination ${policytype} ${type1} ${CreateOrSearch} ${Add} ${name} + ... ${object_name} ${ipclienttext1} ${post} ${Country} ${City} + ... ${Protocols1} ${Degree} ${times} ${numbers} ${limits} ${keywordtext} + ... ELSE log 不添加目的ip +TCPFilter + [Arguments] ${Filtercreate} ${SNIname} ${Filter}=yes + #判断是否添加Filter,${Filter}=yes,为添加Filter,否则不添加Filter + run keyword if "${Filter}"=="yes" run keywords sleep 1 + ... AND Filter-create ${Filtercreate} ${SNIname} + ... ELSE log 不添加Filter +Filter-create + [Arguments] ${Filtercreate} ${SNIname} + FOR ${i} IN @{Filtercreate} + sleep 1 + click element id=interceptionadd_add_filter + sleep 1 + run keyword if "${i}"=="SNI" run keywords sleep 1 + ... AND click element id=interceptionadd_checkappshow0 + ... AND Create-Object-Search ${SNIname} ${i} + ... AND sleep 1 + END +Create-Object-Search + [Arguments] ${name} ${filter} + [Documentation] 调用次关键字前需要添加必填参数: + ... ${name}:填入是一个列表,列表内容为object的name + ... 选择search对象 + sleep 1 + click element xpath=//*[@id="policy_paper_left"]/div[2]/form/div[5]/div[1]/div[1]/label[contains(text(), "${filter}")]/following-sibling::div/div + sleep 1 + FOR ${i} IN @{name} + input text xpath=//*[@id="condistions_protocol"]/div[2]/p[contains(text(), "${filter}")]/following-sibling::div[2]/div/div[1]/input ${i} + sleep 1 + press keys xpath=//*[@id="condistions_protocol"]/div[2]/p[contains(text(), "${filter}")]/following-sibling::div[2]/div/div[1]/input ENTER + sleep 1 + click element xpath=//*[@id="condistions_protocol"]/div[2]/p[contains(text(), "${filter}")]/following-sibling::div[2]/div/div[2]/div/div/ul/li[1] + sleep 1 + END +TCP-Enable-TCP-Passthrough + [Arguments] ${Enable-TCP-Passthrough}=null + #判断是否开启Enable TCP Passthrough按钮,${Enable-TCP-Passthrough}=open,为开启,否则不添开启 + run keyword if "${Enable-TCP-Passthrough}"=="open" run keywords sleep 1 + ... AND click element xpath=//*[@id="proxytcpThrough"]/label[contains(text(), "Enable TCP Passthrough")]/following-sibling::div/div #点击Enable-TCP-Passthrough按钮开启 + ... AND sleep 1 + ... ELSE log 不开启 +TCP-Bypass-Duplicated-Packet + [Arguments] ${Bypass-Duplicated-Packet}=null + #判断是否开启Bypass Duplicated Packet按钮,${Bypass-Duplicated-Packet}=open,为开启,否则不添开启 + run keyword if "${Bypass-Duplicated-Packet}"=="open" run keywords sleep 1 + ... AND click element xpath=//*[@id="proxyduplicatedPacket"]/label[contains(text(), "Bypass Duplicated Packet")]/following-sibling::div/div #点击Bypass-Duplicated-Packet按钮开启 + ... AND sleep 1 + ... ELSE log 不开启 +TCP-Client-side-Parameters + [Arguments] ${clickelement}=/html/body/div[1]/div/div[3]/div[2]/div/div/div[1]/div[1]/div/div[2]/form/div[9]/div[2]/div[1] + ... ${ClientOverrideMSS}=null ${ClientMSSvalue}=null ${ClientNoDelay}=null ${Clientttlvalue}=null ${ClientKeepalive}=null ${ClientProbeNumber}=null + ... ${ClientIdleTime}=null ${ClientInterval}=null ${ClientUserTimeout}=null + sleep 1 + click element id=tab-first #点击Client-side Parameters + sleep 1 + #判断是否开启Override MSS按钮,${Override-MSS}=open,为开启,否则不添开启 + run keyword if "${ClientOverrideMSS}"=="open" run keywords sleep 1 + ... AND click element xpath=${clickelement}/div/form/div/label[contains(text(), "Override MSS")]/following-sibling::div/div #点击Override-MSS按钮开启 + ... AND sleep 1 + ... AND input text xpath=${clickelement}/div/form/div[2]/div/div/input ${ClientMSSvalue} #输入MSS内容 + ... AND sleep 1 + ... ELSE log 不开启 + #判断是否开启No Delay按钮,${No-Delay}=open,为开启,否则不添开启 + run keyword if "${ClientNoDelay}"=="open" run keywords sleep 1 + ... AND click element xpath=${clickelement}/div/form/div/label[contains(text(), "No Delay")]/following-sibling::div/div #点击No-Delay按钮开启 + ... AND sleep 1 + ... ELSE log 不开启 + input text xpath=${clickelement}/div/form/div/label[contains(text(), "TTL")]/following-sibling::div/div/input ${Clientttlvalue} #输入ttl内容 + sleep 1 + #判断是否开启Keepalive按钮,${Keepalive}=open,为开启,否则不添开启 + run keyword if "${ClientKeepalive}"=="open" run keywords sleep 1 + ... AND click element xpath=${clickelement}/div/form/div/label[contains(text(), "Keepalive")]/following-sibling::div/div #点击Keepalive按钮开启 + ... AND sleep 1 + ... AND input text xpath=${clickelement}/div/form/div/div/form/div[1]/label[contains(text(), "Probe Number")]/following-sibling::div/div/input ${ClientProbeNumber} #输入Probe Number内容 + ... AND sleep 1 + ... AND input text xpath=${clickelement}/div/form/div/div/form/div[2]/label[contains(text(), "Idle Time")]/following-sibling::div/div/input ${ClientIdleTime} #输入Idle Time内容 + ... AND sleep 1 + ... AND input text xpath=${clickelement}/div/form/div/div/form/div[3]/label[contains(text(), "Interval")]/following-sibling::div/div/input ${ClientInterval} #输入Interval内容 + ... AND sleep 1 + ... ELSE log 不开启 + input text xpath=${clickelement}/div/form/div/label[contains(text(), "User Timeout")]/following-sibling::div/div/input ${ClientUserTimeout} #输入User Timeout内容 + sleep 1 +TCP-Server-side-Parameters + [Arguments] ${serverelement}=/html/body/div[1]/div/div[3]/div[2]/div/div/div[1]/div[1]/div/div[2]/form/div[9]/div[2]/div[2] + ... ${ServerOverrideMSS}=null ${ServerMSSvalue}=null ${ServerNoDelay}=null ${Serverttlvalue}=null ${ServerKeepalive}=null ${ServerProbeNumber}=null + ... ${ServerIdleTime}=null ${ServerInterval}=null ${ServerUserTimeout}=null + click element id=tab-second #点击Server-side Parameters + sleep 1 + #判断是否开启Override MSS按钮,${Override-MSS}=open,为开启,否则不添开启 + run keyword if "${ServerOverrideMSS}"=="open" run keywords sleep 1 + ... AND click element xpath=${serverelement}/div/form/div/label[contains(text(), "Override MSS")]/following-sibling::div/div #点击Override-MSS按钮开启 + ... AND sleep 1 + ... AND input text xpath=${serverelement}/div/form/div[2]/div/div/input ${ServerMSSvalue} #输入MSS内容 + ... AND sleep 1 + ... ELSE log 不开启 + #判断是否开启No Delay按钮,${No-Delay}=open,为开启,否则不添开启 + run keyword if "${ServerNoDelay}"=="open" run keywords sleep 1 + ... AND click element xpath=${serverelement}/div/form/div/label[contains(text(), "No Delay")]/following-sibling::div/div #点击No-Delay按钮开启 + ... AND sleep 1 + ... ELSE log 不开启 + input text xpath=${serverelement}/div/form/div/label[contains(text(), "TTL")]/following-sibling::div/div/input ${Serverttlvalue} #输入ttl内容 + sleep 1 + #判断是否开启Keepalive按钮,${Keepalive}=open,为开启,否则不添开启 + run keyword if "${ServerKeepalive}"=="open" run keywords sleep 1 + ... AND click element xpath=${serverelement}/div/form/div/label[contains(text(), "Keepalive")]/following-sibling::div/div #点击Keepalive按钮开启 + ... AND sleep 1 + ... AND input text xpath=${serverelement}/div/form/div/div/form/div[1]/label[contains(text(), "Probe Number")]/following-sibling::div/div/input ${ServerProbeNumber} #输入Probe Number内容 + ... AND sleep 1 + ... AND input text xpath=${serverelement}/div/form/div/div/form/div[2]/label[contains(text(), "Idle Time")]/following-sibling::div/div/input ${ServerIdleTime} #输入Idle Time内容 + ... AND sleep 1 + ... AND input text xpath=${serverelement}/div/form/div/div/form/div[3]/label[contains(text(), "Interval")]/following-sibling::div/div/input ${ServerInterval} #输入Interval内容 + ... AND sleep 1 + ... ELSE log 不开启 + sleep 1 + input text xpath=${serverelement}/div/form/div/label[contains(text(), "User Timeout")]/following-sibling::div/div/input ${ServerUserTimeout} #输入User Timeout内容 + sleep 1 +TCP-OK + sleep 1 + click element id=proxyManipulationSuccess #点击OK + sleep 1 +TCP-Assertion + [Arguments] ${name} ${search} + Proxy-TCP-Options-Search ${name} ${search} #搜索刚新建的name + ${text1} Get Text xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[2]/div/div/p #获取点击后页面文本信息 + Should Be Equal As Strings ${text1} ${name} #断言 + + + +Proxy-TCP-Options-Search + [Arguments] ${value} ${search} + sleep 1 + click element id=sidebarAdvanced + sleep 1 + Wait Until Element Is Visible xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[3]/div[1]/div/div[1]/span/div/div/div[2]/div/div/div/input 20 + click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[3]/div[1]/div/div[1]/span/div/div/div[2]/div/div/div/input #点击搜索框 + sleep 1 + #判断是使用name搜索还是id搜索 + run keyword if "${search}"=="Name" run keywords sleep 1 + ... AND click element xpath=/html/body/div/div[1]/div[1]/ul/li[3] //*[@id="app"]/div/div[3]/div[2]/div/div[3]/div[1]/div/div[1]/span/div/div/div[2]/div/div[1]/div[3]/div/input + ... AND input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[3]/div[1]/div/div[1]/span/div/div/div[2]/div/div[1]/div[3]/div/input ${value} + ... ELSE IF "${search}"=="ID" run keywords sleep 1 + ... AND click element xpath=/html/body/div/div[1]/div[1]/ul/li[2] + ... AND input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[3]/div[1]/div/div[1]/span/div/div/div[2]/div/div[1]/div[3]/div/input ${value} + ... AND sleep 1 + click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[3]/div[1]/div/div[1]/span/div/i #点击搜索按钮 + sleep 1 + Run Keyword And Ignore Error click element xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1] #点击搜索到的列表 + sleep 1 + + +Delete-Proxy-estimate + [Arguments] ${securityname} + run keyword if "${securityname}"!="null" run keywords sleep 1 + ... AND Delete-Proxy ${securityname} + ... ELSE log go on + +Delete-Proxy + [Arguments] ${securityname} + + Menu settings Advanced + sleep 2 + Proxy-TCP-Options-Search ${securityname} Name + sleep 2 + Run Keyword And Ignore Error click element id=proxyTCPDel + sleep 1 + Run Keyword And Ignore Error click element xpath=/html/body/div/div/div[3]/button[2] + sleep 1 + +Delete-object-estimate + [Arguments] ${obj} + run keyword if "${obj}"!="null" run keywords sleep 1 + ... AND Delete-object ${obj} + ... ELSE log go on +Delete-object + [Arguments] ${obj} + FOR ${num} ${key} IN ENUMERATE @{obj} + Forname ${obj}[${key}] ${key} + + END + +Forname + [Arguments] ${objectname} ${key} + FOR ${i} IN @{objectname} + Menu objects ${key} + sleep 2 + click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[1]/span/div/div/div[2]/div/div/div/input #点击输入框 + sleep 2 + click element xpath=/html/body/div/div[1]/div[1]/ul/li[3] #点击name为搜索类型 + sleep 2 + input text xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[1]/span/div/div/div[2]/div/div[1]/div[3]/div/input ${i} #输入搜索内容 + sleep 2 + click element xpath=//*[@id="app"]/div/div[3]/div[2]/div/div[1]/div[1]/span/div/i #点击搜索按钮 + sleep 2 + Run Keyword And Ignore Error click element xpath=//*[@id="ly-table1-listcontent"]/div/div[3]/table/tbody/tr[1]/td[1]/div/div/span #选择搜索到的列表 + sleep 2 + sleep 1 + Run Keyword And Ignore Error click element id=objectDel #点击删除按钮 + sleep 1 + Run Keyword And Ignore Error click element xpath=/html/body/div/div/div[3]/button[2] + sleep 1 + END \ No newline at end of file diff --git a/02-Keyword/tsg_ui/securityPolicy/InterceptSSLModule.robot b/02-Keyword/tsg_ui/securityPolicy/InterceptSSLModule.robot deleted file mode 100644 index c604573..0000000 --- a/02-Keyword/tsg_ui/securityPolicy/InterceptSSLModule.robot +++ /dev/null @@ -1,122 +0,0 @@ -*** Settings *** -Library Selenium2Library - -*** Keywords *** -Keyring-create - [Arguments] ${keyring-name} ${file} ${file1} ${1or2} ${type} ${type1} - [Documentation] 引用次关键字,填入必填参数 - ... 必填参数: - ... ${keyring-name}:新建页面name输入框里的内容 - ... ${file}:上传文件所在本地的路径 - ... ${file1}:上传文件所在本地的路径 - ... ${1or2}:填入1 或者其他数值 - ... ${type}:上传证书类型的元素 - ... ${type1}:上传证书加密解密算法的元素 - click element id=interceptionadd_eventkeying #点击下拉框 - sleep 1 - click element id=interceptionadd_keyadd #点击+号添加证书 - sleep 2 - input text id=keyringsadd_name ${keyring-name} #输入证书name - sleep 1 - Choose File xpath=//*[@id="proxy"]/div[10]/div/div/div[2]/form/div[2]/div/div/div/input ${file} #上传证书文件 - sleep 2 - Choose File xpath=//*[@id="proxy"]/div[10]/div/div/div[2]/form/div[4]/div/div/div/input ${file1} #上传证书文件 - ${select} Set Variable ${1or2} - Run Keyword If '${select}'=='1' click id=keyringsadd_customized - Run Keyword If '${select}'=='1' input id=reissueExpiryDate 10 - click element id=certificateType_input #点击下拉框 - sleep 1 - click element ${type} #选择证书类型 - sleep 1 - click element id=keyringsadd_publicKeyAlgo #点击下拉框 - sleep 1 - click element ${type1} #选择加密解密类型 - sleep 1 - click element id=parentobj_submit #点击ok - -Keyring-search - [Arguments] ${name} - [Documentation] 条用此关键字前需要给必填参数:${name} - ... ${name}:创建的keyring的name - click element id=tab-0 #点击Keyring - sleep 1 - click element id=interceptionadd_eventkeying #点击下拉框 - sleep 1 - input text id=card_keyringName ${name} #搜索框输入 - Sleep 1 - Press key id=card_keyringName \\13 #回车键 - sleep 1 - click element id=card_keylist0 #点击列表 - -Certificate Checks - [Arguments] ${Type} - [Documentation] 在调用此关键字前,需要添加必填参数${Type} - ... ${Type}为Fail-close或者是Pass-through \ \ \ 代表Certificate Checks 里的两个按钮 - click element id=tab-1 #点击Certificate Checks - sleep 1 - run keyword if "${Type}"=="Fail-close" click element id=card_fileoption0 - ... ELSE IF "${Type}"=="Pass-through" click element id=card_fileoption1 #选择Fail-close或者pass-through - -Dynamic Bypass - [Arguments] ${Type} - [Documentation] 调用此关键字前 需要给一个必填参数${Type} - ... ${Type}参数为EV或者CT或者MA或者OPE或者CP \ 对应Dynamic Bypass 五个按钮 - click element id=tab-3 #点击Dynamic Bypass - sleep 1 - click element id=mutual_authentication_swith - sleep 1 - click element id=undefined_swith - sleep 1 - click element id=cert_pinning1_swith - sleep 1 - run keyword if "${Type}"=="EV" click element id=ev_cert_swith - ... ELSE IF "${Type}"=="CT" click element id=cert_transparency_swith - ... ELSE IF "${Type}"=="MA" click element id=mutual_authentication_swith - ... ELSE IF "${Type}"=="OPE" click element id=undefined_swith - ... ELSE IF "${Type}"=="CP" click element id=cert_pinning1_swith - -Certificate Checks-close - [Documentation] 次关键字为关闭Certificate Checks的四个按钮 - click element id=tab-1 #点击Certificate Checks - sleep 1 - click element id=cn_swith - sleep 1 - click element id=issuer_swith - sleep 1 - click element id=self_signed_swith - sleep 1 - click element id=expiration_swith - -Protocol Version - [Arguments] ${Type} ${Type1} ${Type2} - [Documentation] 调用次关键字前需要添加必填参数: - ... ${Type}:填入MCV或者AH2 - ... ${Type1}:对应最小版本号(填入:3.0或者1.0或者1.1或者1.2或者1.3) - ... ${Type2}:对应最大版本号(填入:3.0或者1.0或者1.1或者1.2或者1.3) - click element id=tab-4 - sleep 1 - run keyword if "${Type}"=="MCV" run keywords click element id=interceptionadd_sslver_swith - ... AND Mirror Client Versions-close ${Type1} ${Type2} - ... ELSE IF "${Type}"=="AH2" click element id=interceptionaddallhttp_swith - -Mirror Client Versions-close - [Arguments] ${Type} ${Type1} - [Documentation] 调用次关键字前需要添加必填参数: - ... ${Type}:对应最小版本号(填入:3.0或者1.0或者1.1或者1.2或者1.3) - ... ${Type1}:对应最大版本号(填入:3.0或者1.0或者1.1或者1.2或者1.3) - sleep 1 - click element id=interceptionadd_sslmin - sleep 1 - run keyword if "${Type}"=="3.0" click element id=pro_min0 - ... ELSE IF "${Type}"=="1.0" click element id=pro_min1 - ... ELSE IF "${Type}"=="1.1" click element id=pro_min2 - ... ELSE IF "${Type}"=="1.2" click element id=pro_min3 - ... ELSE IF "${Type}"=="1.3" click element id=pro_min4 - sleep 1 - click element id=interceptionadd_sslmax - sleep 1 - run keyword if "${Type1}"=="3.0" click element id=pro_max0 - ... ELSE IF "${Type1}"=="1.0" click element id=pro_max1 - ... ELSE IF "${Type1}"=="1.1" click element id=pro_max2 - ... ELSE IF "${Typeq}"=="1.2" click element id=pro_max3 - ... ELSE IF "${Typeq}"=="1.3" click element id=pro_max4