From a66d0b04f7ffdbd59ccc259ff973324bfc763a2e Mon Sep 17 00:00:00 2001 From: damies13 Date: Sat, 8 Apr 2023 20:26:51 +1000 Subject: [PATCH 1/5] tryton --- .../Tryton/tryton_1680844256.har | 2 +- .../Tryton/tryton_1680844256.robot | 217 ++++++++++++++++++ 2 files changed, 218 insertions(+), 1 deletion(-) create mode 100644 Tests/BrowserLibraryHarFiles/Tryton/tryton_1680844256.robot diff --git a/Tests/BrowserLibraryHarFiles/Tryton/tryton_1680844256.har b/Tests/BrowserLibraryHarFiles/Tryton/tryton_1680844256.har index 81ef5d3..db16efa 100644 --- a/Tests/BrowserLibraryHarFiles/Tryton/tryton_1680844256.har +++ b/Tests/BrowserLibraryHarFiles/Tryton/tryton_1680844256.har @@ -17280,4 +17280,4 @@ } ] } -} \ No newline at end of file +} diff --git a/Tests/BrowserLibraryHarFiles/Tryton/tryton_1680844256.robot b/Tests/BrowserLibraryHarFiles/Tryton/tryton_1680844256.robot new file mode 100644 index 0000000..cc4da13 --- /dev/null +++ b/Tests/BrowserLibraryHarFiles/Tryton/tryton_1680844256.robot @@ -0,0 +1,217 @@ +*** Settings *** +Library RequestsLibrary +Library String + +*** Variables *** +${accept} text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7 +${accept-language} en-GB,en;q=0.9 +${sec-ch-ua} "Not A(Brand";v="24", "Chromium";v="110" +${sec-ch-ua-mobile} ?0 +${sec-ch-ua-platform} "Linux" +${sec-fetch-dest} document +${sec-fetch-mode} navigate +${sec-fetch-site} none +${sec-fetch-user} ?1 +${user-agent} Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36 +${sec-fetch-dest_1} script +${sec-fetch-mode_1} no-cors +${sec-fetch-site_1} same-origin +${path_path} /bower_components/jquery/dist/jquery.min.js +${path_path_1} /bower_components/bootstrap/dist/js/bootstrap.min.js +${path_path_2} /bower_components/moment/min/moment.min.js +${path_path_3} /bower_components/gettext.js/dist/gettext.min.js +${path_path_4} /bower_components/d3/d3.min.js +${path_path_5} /bower_components/c3/c3.min.js +${path_path_6} /bower_components/papaparse/papaparse.min.js +${path_path_7} /bower_components/fullcalendar/dist/fullcalendar.min.js +${path_path_8} /bower_components/mousetrap/mousetrap.min.js +${path_path_9} /bower_components/Sortable/Sortable.min.js +${accept_1} text/css,*/*;q=0.1 +${sec-fetch-dest_2} style +${path_path_10} /custom.js +${path_path_11} /custom.css +${accept_2} application/json, text/javascript, */*; q=0.01 +${sec-fetch-dest_3} empty +${x-requested-with} XMLHttpRequest +${path_path_12} /locale/en_GB.json +${accept_3} image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8 +${path_path_13} /images/tryton-icon.png +${authorization} Session ZGVtbzoyOjg4MDhiOTRiODRlODE3ZmU4ZDM0MjU4NWYxMDc2YmNiZjQyYmY0YjlmMjZmZWJiMjRhOGIwNDZmODg1ZDcxNDM= +${client} 76d9d2b5-992c-4e46-b1c2-da1ef9676c40 + +*** Test Cases *** +tryton_1680844256 + Create Session sess_demo_tryton_org https://demo.tryton.org disable_warnings=1 + tryton_1680844256 page@2f780477cb30c000b346dbe753276485 + + +*** Keywords *** +Get Substring LRB + [Documentation] Get Substring using Left and Right Boundaries + [Arguments] ${string} ${LeftB} ${RightB} + ${left}= Fetch From Right ${string} ${LeftB} + ${match}= Fetch From Left ${left} ${RightB} + [Return] ${match} + +tryton_1680844256 page@2f780477cb30c000b346dbe753276485 + [Documentation] tryton_1680844256 | tryton_1680844256 page@2f780477cb30c000b346dbe753276485 | Tryton + ${sec-ch-ua_sub}= Get Substring LRB ${sec-ch-ua} "Not A(Brand";v="24", "Chromium";v=" 10" + &{Headers}= Create dictionary accept=${accept} accept-language=${accept-language} sec-ch-ua=${sec-ch-ua} sec-ch-ua-mobile=${sec-ch-ua-mobile} sec-ch-ua-platform=${sec-ch-ua-platform} sec-fetch-dest=${sec-fetch-dest} sec-fetch-mode=${sec-fetch-mode} sec-fetch-site=${sec-fetch-site} sec-fetch-user=${sec-fetch-user} upgrade-insecure-requests=${sec-ch-ua_sub} user-agent=${user-agent} + &{Cookies}= Create dictionary + Update Session sess_demo_tryton_org ${Headers} ${Cookies} + ${sec-ch-ua_sub_1}= Get Substring LRB ${sec-ch-ua} "Not A(Brand";v="24", "Chromium";v=" 10" + &{Req_Headers}= Create dictionary upgrade-insecure-requests=${sec-ch-ua_sub_1} + ${resp_0}= GET On Session sess_demo_tryton_org url=/ headers=${Req_Headers} expected_status=307 allow_redirects=${False} + ${sec-ch-ua_sub_2}= Get Substring LRB ${sec-ch-ua} "Not A(Brand";v="24", "Chromium";v=" 10" + &{Req_Headers}= Create dictionary upgrade-insecure-requests=${sec-ch-ua_sub_2} + Set Global Variable ${location} ${resp_0.headers["location"]} + ${path}= Get Substring ${location} 0 -9 + ${resp_1}= GET On Session sess_demo_tryton_org url=${path} headers=${Req_Headers} expected_status=200 + ${accept_sub}= Get Substring LRB ${accept} text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng, ;q=0.8,application/signed-exchange;v=b3;q=0.7 + &{Req_Headers}= Create dictionary accept=${accept_sub} referer=${path} sec-fetch-dest=${sec-fetch-dest_1} sec-fetch-mode=${sec-fetch-mode_1} sec-fetch-site=${sec-fetch-site_1} + ${location_sub}= Fetch From Left ${location} ://demo6.6.tryton.org/#demo6.6/ + ${location_sub_1}= Get Substring LRB ${location} https:// /#demo6.6/ + ${resp_2}= GET On Session sess_demo_tryton_org url=${location_sub}://${location_sub_1}${path_path} headers=${Req_Headers} expected_status=200 + ${accept_sub_1}= Get Substring LRB ${accept} text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng, ;q=0.8,application/signed-exchange;v=b3;q=0.7 + &{Req_Headers}= Create dictionary accept=${accept_sub_1} referer=${path} sec-fetch-dest=${sec-fetch-dest_1} sec-fetch-mode=${sec-fetch-mode_1} sec-fetch-site=${sec-fetch-site_1} + ${location_sub_2}= Fetch From Left ${location} ://demo6.6.tryton.org/#demo6.6/ + ${resp_3}= GET On Session sess_demo_tryton_org url=${location_sub_2}://${location_sub_1}${path_path_1} headers=${Req_Headers} expected_status=200 + ${accept_sub_2}= Get Substring LRB ${accept} text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng, ;q=0.8,application/signed-exchange;v=b3;q=0.7 + &{Req_Headers}= Create dictionary accept=${accept_sub_2} referer=${path} sec-fetch-dest=${sec-fetch-dest_1} sec-fetch-mode=${sec-fetch-mode_1} sec-fetch-site=${sec-fetch-site_1} + ${location_sub_3}= Fetch From Left ${location} ://demo6.6.tryton.org/#demo6.6/ + ${resp_4}= GET On Session sess_demo_tryton_org url=${location_sub_3}://${location_sub_1}${path_path_2} headers=${Req_Headers} expected_status=200 + ${accept_sub_3}= Get Substring LRB ${accept} text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng, ;q=0.8,application/signed-exchange;v=b3;q=0.7 + &{Req_Headers}= Create dictionary accept=${accept_sub_3} referer=${path} sec-fetch-dest=${sec-fetch-dest_1} sec-fetch-mode=${sec-fetch-mode_1} sec-fetch-site=${sec-fetch-site_1} + ${location_sub_4}= Fetch From Left ${location} ://demo6.6.tryton.org/#demo6.6/ + ${path_path_2_sub}= Fetch From Left ${path_path_2} /moment.min.js + ${resp_5}= GET On Session sess_demo_tryton_org url=${location_sub_4}://${location_sub_1}${path_path_2_sub}/locales.min.js headers=${Req_Headers} expected_status=200 + ${accept_sub_4}= Get Substring LRB ${accept} text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng, ;q=0.8,application/signed-exchange;v=b3;q=0.7 + &{Req_Headers}= Create dictionary accept=${accept_sub_4} referer=${path} sec-fetch-dest=${sec-fetch-dest_1} sec-fetch-mode=${sec-fetch-mode_1} sec-fetch-site=${sec-fetch-site_1} + ${location_sub_5}= Fetch From Left ${location} ://demo6.6.tryton.org/#demo6.6/ + ${resp_6}= GET On Session sess_demo_tryton_org url=${location_sub_5}://${location_sub_1}${path_path_3} headers=${Req_Headers} expected_status=200 + ${accept_sub_5}= Get Substring LRB ${accept} text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng, ;q=0.8,application/signed-exchange;v=b3;q=0.7 + &{Req_Headers}= Create dictionary accept=${accept_sub_5} referer=${path} sec-fetch-dest=${sec-fetch-dest_1} sec-fetch-mode=${sec-fetch-mode_1} sec-fetch-site=${sec-fetch-site_1} + ${location_sub_6}= Fetch From Left ${location} ://demo6.6.tryton.org/#demo6.6/ + ${resp_7}= GET On Session sess_demo_tryton_org url=${location_sub_6}://${location_sub_1}${path_path_4} headers=${Req_Headers} expected_status=200 + ${accept_sub_6}= Get Substring LRB ${accept} text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng, ;q=0.8,application/signed-exchange;v=b3;q=0.7 + &{Req_Headers}= Create dictionary accept=${accept_sub_6} referer=${path} sec-fetch-dest=${sec-fetch-dest_1} sec-fetch-mode=${sec-fetch-mode_1} sec-fetch-site=${sec-fetch-site_1} + ${location_sub_7}= Fetch From Left ${location} ://demo6.6.tryton.org/#demo6.6/ + ${resp_8}= GET On Session sess_demo_tryton_org url=${location_sub_7}://${location_sub_1}${path_path_5} headers=${Req_Headers} expected_status=200 + ${accept_sub_7}= Get Substring LRB ${accept} text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng, ;q=0.8,application/signed-exchange;v=b3;q=0.7 + &{Req_Headers}= Create dictionary accept=${accept_sub_7} referer=${path} sec-fetch-dest=${sec-fetch-dest_1} sec-fetch-mode=${sec-fetch-mode_1} sec-fetch-site=${sec-fetch-site_1} + ${location_sub_8}= Fetch From Left ${location} ://demo6.6.tryton.org/#demo6.6/ + ${resp_9}= GET On Session sess_demo_tryton_org url=${location_sub_8}://${location_sub_1}${path_path_6} headers=${Req_Headers} expected_status=200 + ${accept_sub_8}= Get Substring LRB ${accept} text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng, ;q=0.8,application/signed-exchange;v=b3;q=0.7 + &{Req_Headers}= Create dictionary accept=${accept_sub_8} referer=${path} sec-fetch-dest=${sec-fetch-dest_1} sec-fetch-mode=${sec-fetch-mode_1} sec-fetch-site=${sec-fetch-site_1} + ${location_sub_9}= Fetch From Left ${location} ://demo6.6.tryton.org/#demo6.6/ + ${resp_10}= GET On Session sess_demo_tryton_org url=${location_sub_9}://${location_sub_1}${path_path_7} headers=${Req_Headers} expected_status=200 + ${accept_sub_9}= Get Substring LRB ${accept} text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng, ;q=0.8,application/signed-exchange;v=b3;q=0.7 + &{Req_Headers}= Create dictionary accept=${accept_sub_9} referer=${path} sec-fetch-dest=${sec-fetch-dest_1} sec-fetch-mode=${sec-fetch-mode_1} sec-fetch-site=${sec-fetch-site_1} + ${location_sub_10}= Fetch From Left ${location} ://demo6.6.tryton.org/#demo6.6/ + ${path_path_7_sub}= Fetch From Left ${path_path_7} /fullcalendar.min.js + ${resp_11}= GET On Session sess_demo_tryton_org url=${location_sub_10}://${location_sub_1}${path_path_7_sub}/locale-all.js headers=${Req_Headers} expected_status=200 + ${accept_sub_10}= Get Substring LRB ${accept} text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng, ;q=0.8,application/signed-exchange;v=b3;q=0.7 + &{Req_Headers}= Create dictionary accept=${accept_sub_10} referer=${path} sec-fetch-dest=${sec-fetch-dest_1} sec-fetch-mode=${sec-fetch-mode_1} sec-fetch-site=${sec-fetch-site_1} + ${location_sub_11}= Fetch From Left ${location} ://demo6.6.tryton.org/#demo6.6/ + ${resp_12}= GET On Session sess_demo_tryton_org url=${location_sub_11}://${location_sub_1}${path_path_8} headers=${Req_Headers} expected_status=200 + ${accept_sub_11}= Get Substring LRB ${accept} text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng, ;q=0.8,application/signed-exchange;v=b3;q=0.7 + &{Req_Headers}= Create dictionary accept=${accept_sub_11} referer=${path} sec-fetch-dest=${sec-fetch-dest_1} sec-fetch-mode=${sec-fetch-mode_1} sec-fetch-site=${sec-fetch-site_1} + ${location_sub_12}= Fetch From Left ${location} ://demo6.6.tryton.org/#demo6.6/ + ${resp_13}= GET On Session sess_demo_tryton_org url=${location_sub_12}://${location_sub_1}${path_path_9} headers=${Req_Headers} expected_status=200 + &{Req_Headers}= Create dictionary accept=${accept_1} referer=${path} sec-fetch-dest=${sec-fetch-dest_2} sec-fetch-mode=${sec-fetch-mode_1} sec-fetch-site=${sec-fetch-site_1} + ${location_sub_13}= Fetch From Left ${location} ://demo6.6.tryton.org/#demo6.6/ + ${path_path_5_sub}= Fetch From Left ${path_path_5} /c3.min.js + ${resp_14}= GET On Session sess_demo_tryton_org url=${location_sub_13}://${location_sub_1}${path_path_5_sub}/c3.min.css headers=${Req_Headers} expected_status=200 + &{Req_Headers}= Create dictionary accept=${accept_1} referer=${path} sec-fetch-dest=${sec-fetch-dest_2} sec-fetch-mode=${sec-fetch-mode_1} sec-fetch-site=${sec-fetch-site_1} + ${location_sub_14}= Fetch From Left ${location} ://demo6.6.tryton.org/#demo6.6/ + ${resp_15}= GET On Session sess_demo_tryton_org url=${location_sub_14}://${location_sub_1}${path_path_7_sub}/fullcalendar.min.css headers=${Req_Headers} expected_status=200 + ${accept_sub_12}= Get Substring LRB ${accept} text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng, ;q=0.8,application/signed-exchange;v=b3;q=0.7 + &{Req_Headers}= Create dictionary accept=${accept_sub_12} referer=${path} sec-fetch-dest=${sec-fetch-dest_1} sec-fetch-mode=${sec-fetch-mode_1} sec-fetch-site=${sec-fetch-site_1} + ${location_sub_15}= Fetch From Left ${location} ://demo6.6.tryton.org/#demo6.6/ + ${path_path_sub}= Get Substring LRB ${path_path} /bower_components/jquery /jquery.min.js + ${resp_16}= GET On Session sess_demo_tryton_org url=${location_sub_15}://${location_sub_1}${path_path_sub}/tryton-sao.min.js headers=${Req_Headers} expected_status=200 + ${method_4}= Get Substring LRB ${resp_16.text} tItem("sao_device_cookies")),e=t&&this.database in t?t[this.database][this.login]:null,e=Sao.rpc({method:" ",params:[e,{}]},this);e.done(e=>{t=(t=JSON.parse(localStorage.getItem("sao_device_cookies")))||{},t + Set Global Variable ${method_4} + ${method_3}= Get Substring LRB ${resp_16.text} ase]&&(o=n[this.database][this.login]);return new Sao.Login(function(e){return e.device_cookie=o,{method:" ",params:[i,e,Sao.i18n.getlang()]}},this).run().then(e=>{this.login=i,this.user_id=e[0],this.session + Set Global Variable ${method_3} + ${method_2}= Get Substring LRB ${resp_16.text} on.processing.show();return jQuery.ajax({contentType:"application/json",data:JSON.stringify({id:0,method:" ",params:[]}),dataType:"json",url:"/",type:"post",complete:[function(){Sao.common.processing.hide(e) + Set Global Variable ${method_2} + ${regx_match}= evaluate re.search("on\\.processing\\.show\\(\\);return\\ jQuery\\.ajax\\(\\{contentType:\\"application/json\\",data:JSON\\.stringify\\(\\{id:0,method:\\"(.*?)\\",params:\\[\\]\\}\\),dataType:\\"json\\",url:\\"/\\",type:\\"post\\",complete:\\[function\\(\\)\\{Sao\\.common\\.processing\\.hide\\(e\\)", """${resp_16.text}""").group(0) re + ${method_1}= Get Substring LRB ${regx_match} on.processing.show();return jQuery.ajax({contentType:"application/json",data:JSON.stringify({id:0,method:" ",params:[]}),dataType:"json",url:"/",type:"post",complete:[function(){Sao.common.processing.hide(e) + Set Global Variable ${method_1} + ${regx_match}= evaluate re.search("on\\.processing\\.show\\(\\);return\\ jQuery\\.ajax\\(\\{contentType:\\"application/json\\",data:JSON\\.stringify\\(\\{id:0,method:\\"(.*?)\\",params:\\[\\]\\}\\),dataType:\\"json\\",url:\\"/\\",type:\\"post\\",complete:\\[function\\(\\)\\{Sao\\.common\\.processing\\.hide\\(e\\)", """${resp_16.text}""").group(0) re + ${method}= Get Substring LRB ${regx_match} on.processing.show();return jQuery.ajax({contentType:"application/json",data:JSON.stringify({id:0,method:" ",params:[]}),dataType:"json",url:"/",type:"post",complete:[function(){Sao.common.processing.hide(e) + Set Global Variable ${method} + &{Req_Headers}= Create dictionary accept=${accept_1} referer=${path} sec-fetch-dest=${sec-fetch-dest_2} sec-fetch-mode=${sec-fetch-mode_1} sec-fetch-site=${sec-fetch-site_1} + ${location_sub_16}= Fetch From Left ${location} ://demo6.6.tryton.org/#demo6.6/ + ${path_path_sub_1}= Get Substring LRB ${path_path} /bower_components/jquery /jquery.min.js + ${resp_17}= GET On Session sess_demo_tryton_org url=${location_sub_16}://${location_sub_1}${path_path_sub_1}/tryton-sao.min.css headers=${Req_Headers} expected_status=200 + ${accept_sub_13}= Get Substring LRB ${accept} text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng, ;q=0.8,application/signed-exchange;v=b3;q=0.7 + &{Req_Headers}= Create dictionary accept=${accept_sub_13} referer=${path} sec-fetch-dest=${sec-fetch-dest_1} sec-fetch-mode=${sec-fetch-mode_1} sec-fetch-site=${sec-fetch-site_1} + ${location_sub_17}= Fetch From Left ${location} ://demo6.6.tryton.org/#demo6.6/ + ${resp_18}= GET On Session sess_demo_tryton_org url=${location_sub_17}://${location_sub_1}${path_path_10} headers=${Req_Headers} expected_status=405 + &{Req_Headers}= Create dictionary accept=${accept_1} referer=${path} sec-fetch-dest=${sec-fetch-dest_2} sec-fetch-mode=${sec-fetch-mode_1} sec-fetch-site=${sec-fetch-site_1} + ${location_sub_18}= Fetch From Left ${location} ://demo6.6.tryton.org/#demo6.6/ + ${resp_19}= GET On Session sess_demo_tryton_org url=${location_sub_18}://${location_sub_1}${path_path_11} headers=${Req_Headers} expected_status=405 + ${sec-fetch-mode_1_sub}= Fetch From Right ${sec-fetch-mode_1} no- + &{Req_Headers}= Create dictionary accept=${accept_2} referer=${path} sec-fetch-dest=${sec-fetch-dest_3} sec-fetch-mode=${sec-fetch-mode_1_sub} sec-fetch-site=${sec-fetch-site_1} x-requested-with=${x-requested-with} + ${location_sub_19}= Fetch From Left ${location} ://demo6.6.tryton.org/#demo6.6/ + ${resp_20}= GET On Session sess_demo_tryton_org url=${location_sub_19}://${location_sub_1}${path_path_12} headers=${Req_Headers} expected_status=405 + ${accept_sub_14}= Get Substring LRB ${accept} text/html,application/xhtml+xml,application/xml;q=0.9, /avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7 + &{Req_Headers}= Create dictionary accept=${accept_3} referer=${path} sec-fetch-dest=${accept_sub_14} sec-fetch-mode=${sec-fetch-mode_1} sec-fetch-site=${sec-fetch-site_1} + ${location_sub_20}= Fetch From Left ${location} ://demo6.6.tryton.org/#demo6.6/ + ${resp_21}= GET On Session sess_demo_tryton_org url=${location_sub_20}://${location_sub_1}${path_path_13} headers=${Req_Headers} expected_status=200 + ${sec-fetch-mode_1_sub_1}= Fetch From Right ${sec-fetch-mode_1} no- + &{Req_Headers}= Create dictionary accept=${accept_2} referer=${path} sec-fetch-dest=${sec-fetch-dest_3} sec-fetch-mode=${sec-fetch-mode_1_sub_1} sec-fetch-site=${sec-fetch-site_1} x-requested-with=${x-requested-with} + ${location_sub_21}= Fetch From Left ${location} ://demo6.6.tryton.org/#demo6.6/ + ${path_path_12_sub}= Fetch From Left ${path_path_12} /en_GB.json + ${resp_22}= GET On Session sess_demo_tryton_org url=${location_sub_21}://${location_sub_1}${path_path_12_sub}/en.json headers=${Req_Headers} expected_status=405 + ${accept_2_sub}= Fetch From Left ${accept_2} , text/javascript, */*; q=0.01 + ${location_sub_22}= Fetch From Left ${location} /#demo6.6/ + ${sec-fetch-mode_1_sub_2}= Fetch From Right ${sec-fetch-mode_1} no- + &{Req_Headers}= Create dictionary accept=${accept_2} content-type=${accept_2_sub} origin=${location_sub_22} referer=${path} sec-fetch-dest=${sec-fetch-dest_3} sec-fetch-mode=${sec-fetch-mode_1_sub_2} sec-fetch-site=${sec-fetch-site_1} x-requested-with=${x-requested-with} + ${accept_sub_15}= Get Substring LRB ${accept} text/html,application/xhtml+xml,application/xml;q= .9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7 + @{json_23_params}= Create List + &{json_23}= Create Dictionary id=${accept_sub_15} method=${method} params=${json_23_params} + &{postdata_23}= Create dictionary + ${resp_23}= POST On Session sess_demo_tryton_org url=${path} headers=${Req_Headers} expected_status=200 json=${json_23} data=${postdata_23} + ${sec-fetch-mode_1_sub_3}= Fetch From Right ${sec-fetch-mode_1} no- + &{Req_Headers}= Create dictionary accept=${accept_2} content-type=${accept_2_sub} origin=${location_sub_22} referer=${path} sec-fetch-dest=${sec-fetch-dest_3} sec-fetch-mode=${sec-fetch-mode_1_sub_3} sec-fetch-site=${sec-fetch-site_1} x-requested-with=${x-requested-with} + ${accept_sub_16}= Get Substring LRB ${accept} text/html,application/xhtml+xml,application/xml;q= .9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7 + @{json_24_params}= Create List + &{json_24}= Create Dictionary id=${accept_sub_16} method=${method_1} params=${json_24_params} + &{postdata_24}= Create dictionary + ${resp_24}= POST On Session sess_demo_tryton_org url=${path} headers=${Req_Headers} expected_status=200 json=${json_24} data=${postdata_24} + ${sec-fetch-mode_1_sub_4}= Fetch From Right ${sec-fetch-mode_1} no- + &{Req_Headers}= Create dictionary accept=${accept_2} content-type=${accept_2_sub} origin=${location_sub_22} referer=${path} sec-fetch-dest=${sec-fetch-dest_3} sec-fetch-mode=${sec-fetch-mode_1_sub_4} sec-fetch-site=${sec-fetch-site_1} x-requested-with=${x-requested-with} + ${accept_sub_17}= Get Substring LRB ${accept} text/html,application/xhtml+xml,application/xml;q= .9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7 + @{json_25_params}= Create List + &{json_25}= Create Dictionary id=${accept_sub_17} method=${method_2} params=${json_25_params} + &{postdata_25}= Create dictionary + ${resp_25}= POST On Session sess_demo_tryton_org url=${path} headers=${Req_Headers} expected_status=200 json=${json_25} data=${postdata_25} + ${sec-fetch-mode_1_sub_5}= Fetch From Right ${sec-fetch-mode_1} no- + &{Req_Headers}= Create dictionary accept=${accept_2} content-type=${accept_2_sub} origin=${location_sub_22} referer=${path} sec-fetch-dest=${sec-fetch-dest_3} sec-fetch-mode=${sec-fetch-mode_1_sub_5} sec-fetch-site=${sec-fetch-site_1} x-requested-with=${x-requested-with} + ${location_sub_23}= Get Substring LRB ${location} https:// 6.6.tryton.org/#demo6.6/ + ${accept-language_sub}= Fetch From Left ${accept-language} -GB,en;q=0.9 + ${accept_sub_18}= Get Substring LRB ${accept} text/html,application/xhtml+xml,application/xml;q= .9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7 + &{json_26_params_1}= Create Dictionary device_cookie=${None} + @{json_26_params}= Create List ${location_sub_23} ${json_26_params_1} ${accept-language_sub} + &{json_26}= Create Dictionary method=${method_3} params=${json_26_params} id=${accept_sub_18} + &{postdata_26}= Create dictionary + ${location_sub_24}= Fetch From Left ${location} ://demo6.6.tryton.org/#demo6.6/ + ${location_sub_25}= Get Substring LRB ${location} https:/ .tryton.org/#demo6.6/ + ${accept_sub_19}= Get Substring LRB ${accept} text html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7 + ${resp_26}= POST On Session sess_demo_tryton_org url=${location_sub_24}://${location_sub_1}${location_sub_25}${accept_sub_19} headers=${Req_Headers} expected_status=200 json=${json_26} data=${postdata_26} + ${sec-fetch-mode_1_sub_6}= Fetch From Right ${sec-fetch-mode_1} no- + &{Req_Headers}= Create dictionary accept=${accept_2} authorization=${authorization} content-type=${accept_2_sub} origin=${location_sub_22} referer=${path} sec-fetch-dest=${sec-fetch-dest_3} sec-fetch-mode=${sec-fetch-mode_1_sub_6} sec-fetch-site=${sec-fetch-site_1} x-requested-with=${x-requested-with} + ${accept_sub_20}= Get Substring LRB ${accept} text/html,application/xhtml+xml,application/xml;q= .9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7 + &{json_27_params_1}= Create Dictionary client=${client} + @{json_27_params}= Create List ${json_27_params_1} + &{json_27}= Create Dictionary id=${accept_sub_20} method=${method_4} params=${json_27_params} + &{postdata_27}= Create dictionary + ${location_sub_26}= Fetch From Left ${location} ://demo6.6.tryton.org/#demo6.6/ + ${location_sub_27}= Get Substring LRB ${location} https:/ .tryton.org/#demo6.6/ + ${accept_sub_21}= Get Substring LRB ${accept} text html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7 + ${resp_27}= POST On Session sess_demo_tryton_org url=${location_sub_26}://${location_sub_1}${location_sub_27}${accept_sub_21} headers=${Req_Headers} expected_status=200 json=${json_27} data=${postdata_27} + + From 3bf5c522e7f10f486674a1501c53bc4be1e622e7 Mon Sep 17 00:00:00 2001 From: damies13 Date: Sat, 8 Apr 2023 20:30:46 +1000 Subject: [PATCH 2/5] try finding url path without leading / Issue #4 --- src/modules/h2r_url.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/modules/h2r_url.py b/src/modules/h2r_url.py index 93a0cc0..bb88f61 100644 --- a/src/modules/h2r_url.py +++ b/src/modules/h2r_url.py @@ -112,6 +112,13 @@ def url_path(self): if path is None: return None + if path == opath and path[0] == '/': + subopath = opath[1:] + subpath = self.parent.find_variable(key + "_path", subopath, False) + self.parent.debugmsg(7, "subpath:", subpath) + if subpath != subopath: + path = '/' + subpath + if path != opath: retarr.append(path) From adbff896c002f25e185bd2ed9b4f6d671b2b3dc2 Mon Sep 17 00:00:00 2001 From: damies13 Date: Sun, 9 Apr 2023 00:25:36 +1000 Subject: [PATCH 3/5] Fix a few URL related bugs Issue #4 --- src/modules/h2r_base.py | 39 +++++++++++++++++++++++++++++++++------ src/modules/h2r_http.py | 33 +++++++++++++++++++++++---------- src/modules/h2r_url.py | 13 ++++++++++--- 3 files changed, 66 insertions(+), 19 deletions(-) diff --git a/src/modules/h2r_base.py b/src/modules/h2r_base.py index b7a8a57..c17ecd3 100644 --- a/src/modules/h2r_base.py +++ b/src/modules/h2r_base.py @@ -22,11 +22,15 @@ def __init__(self, parent): # Register Paersers # - ep = "00:self.h2r_base.exiting_paramkey" + ep = "00:self.h2r_base.existing_paramkey" if ep not in self.parent.parsers: self.parent.parsers[ep] = {} - ep = "01:self.h2r_base.exiting_paramval" + ep = "01:self.h2r_base.existing_paramval" + if ep not in self.parent.parsers: + self.parent.parsers[ep] = {} + + ep = "03:self.h2r_base.existing_paramsubval" if ep not in self.parent.parsers: self.parent.parsers[ep] = {} @@ -57,7 +61,7 @@ def __init__(self, parent): # Paersers # - def exiting_paramkey(self): + def existing_paramkey(self): self.parent.debugmsg(6, "has key already been found") searchvals = self.parent.parserdata["searchvals"] @@ -93,7 +97,7 @@ def exiting_paramkey(self): - def exiting_paramval(self): + def existing_paramval(self): self.parent.debugmsg(6, "has value already been found") kwname = self.parent.parserdata["kwname"] key = self.parent.parserdata["key"] @@ -123,11 +127,34 @@ def exiting_paramval(self): newvalue = self.parent.workingdata["paramvalues"][searchval] return newvalue + return None + + def existing_paramsubval(self): + self.parent.debugmsg(6, "has value already been found") + kwname = self.parent.parserdata["kwname"] + key = self.parent.parserdata["key"] + + possiblekeys = [] + possiblekeyn = [] + for searchkey in self.parent.parserdata["searchkeys"]: + possiblekeys.append("${"+searchkey+"}") + possiblekeyn.append(searchkey) + i = 1 + newname = searchkey+"_"+str(i) + while newname in self.parent.workingdata["paramnames"]: + possiblekeys.append("${"+newname+"}") + possiblekeyn.append(newname) + i += 1 + newname = searchkey+"_"+str(i) + # self.debugmsg(9, "newname:", newname) + self.parent.debugmsg(6, "possiblekeys:", possiblekeys) + + for searchval in self.parent.parserdata["searchvals"]: + for pval in self.parent.workingdata["paramvalues"]: if searchval in pval: - self.parent.debugmsg(6, "searchval (", searchval, ") is substring of existing pval (", pval, ")") pvalkey = self.parent.workingdata["paramvalues"][pval] - self.parent.debugmsg(6, "pvalkey:", pvalkey) + self.parent.debugmsg(6, "searchval (", searchval, ") is substring of existing pval (", pval, ") pvalkey:", pvalkey) pvalkeyname = pvalkey if pvalkey[:2] == "${": diff --git a/src/modules/h2r_http.py b/src/modules/h2r_http.py index 2ad0a36..c2063d2 100644 --- a/src/modules/h2r_http.py +++ b/src/modules/h2r_http.py @@ -66,9 +66,13 @@ def response_headers(self): self.parent.debugmsg(6, "headers Parser") searchkeys = self.parent.parserdata["searchkeys"] + self.parent.debugmsg(7, "searchkeys:", self.parent.parserdata["searchkeys"]) searchvals = self.parent.parserdata["searchvals"] + self.parent.debugmsg(7, "searchvals:", self.parent.parserdata["searchvals"]) kwname = self.parent.parserdata["kwname"] + self.parent.debugmsg(6, "kwname:", self.parent.parserdata["kwname"]) key = self.parent.parserdata["key"] + self.parent.debugmsg(6, "key:", self.parent.parserdata["key"]) for searchval in searchvals.keys(): self.parent.debugmsg(8, "searchval:", searchval) @@ -79,8 +83,13 @@ def response_headers(self): for e in self.parent.workingdata["history"]: resp = e["entrycount"]+1 + self.parent.debugmsg(6, "resp:", resp, " entrycount:", e["entrycount"]) ekwname = e["kwname"] + self.parent.debugmsg(6, "ekwname:", ekwname) estep = self.parent.find_estep(resp, ekwname) + self.parent.debugmsg(6, "estep:", estep) + + resp = e["entrycount"] # check headers self.parent.debugmsg(7, "is searchval in headers:", searchval) @@ -104,29 +113,31 @@ def response_headers(self): newkey = self.parent.saveparam(key, searchval) - line = "Set Global Variable ${"+newkey+"} ${resp_"+str(resp + estep)+".headers[\""+hkey+"\"]}" - self.parent.outdata["*** Keywords ***"][ekwname].append(line) + line = "Set Global Variable ${"+newkey+"} ${resp_"+str(resp)+".headers[\""+hkey+"\"]}" + # self.parent.outdata["*** Keywords ***"][ekwname].append(line) + self.parent.outdata["*** Keywords ***"][ekwname].insert(estep, line) newvalue = "${"+newkey+"}" return newvalue if len(searchval) > 10 and searchval in h["value"]: hkey = h["name"] - self.parent.debugmsg(8, "found searchval (",searchval,") as hkey (",hkey,") for key (",key,") in header for ", e["request"]["url"]) + self.parent.debugmsg(6, "found searchval (",searchval,") as hkey (",hkey,") for key (",key,") in header for ", e["request"]["url"]) hvalue = h["value"] newkey = self.parent.saveparam(hkey, hvalue) # Set Global Variable ${Location} ${resp_0.headers["Location"]} - line = "Set Global Variable ${"+newkey+"} ${resp_"+str(resp + estep)+".headers[\""+hkey+"\"]}" + line = "Set Global Variable ${"+newkey+"} ${resp_"+str(resp)+".headers[\""+hkey+"\"]}" - self.parent.debugmsg(8, "line:", line) - self.parent.debugmsg(8, "ekwname:", ekwname, " estep:", estep) + self.parent.debugmsg(6, "line:", line) + self.parent.debugmsg(6, "ekwname:", ekwname, " estep:", estep) self.parent.debugmsg(9, "ekwname[]:", self.parent.outdata["*** Keywords ***"][ekwname]) - self.parent.outdata["*** Keywords ***"][ekwname].append(line) + # self.parent.outdata["*** Keywords ***"][ekwname].append(line) + self.parent.outdata["*** Keywords ***"][ekwname].insert(estep, line) - self.parent.debugmsg(8, "hvalue:", hvalue, " searchval:", searchval) + self.parent.debugmsg(6, "hvalue:", hvalue, " searchval:", searchval) newkey0 = newkey newkey = self.parent.saveparam(key, searchval) @@ -141,9 +152,11 @@ def response_headers(self): if elen > 0: line = "${"+newkey+"}= Get Substring ${" + newkey0 + "} " + str(vpos) + " -" + str(elen) self.parent.outdata["*** Keywords ***"][ekwname].append(line) + # self.parent.outdata["*** Keywords ***"][ekwname].insert(estep + 1, line) else: line = "${"+newkey+"}= Get Substring ${" + newkey0 + "} " + str(vpos) self.parent.outdata["*** Keywords ***"][ekwname].append(line) + # self.parent.outdata["*** Keywords ***"][ekwname].insert(estep + 1, line) newvalue = "${"+newkey+"}" @@ -277,7 +290,7 @@ def request_uripath(self, entry): return entry def request_headers(self, entry): - self.parent.debugmsg(6, "headers processor") + self.parent.debugmsg(6, "headers processor, kwname:", entry["kwname"]) self.parent.debugmsg(9, "entry:", entry) self.parent.debugmsg(8, "sessiondata:", self.parent.workingdata["sessiondata"]) @@ -310,7 +323,7 @@ def request_headers(self, entry): def request_cookies(self, entry): - self.parent.debugmsg(6, "headers cookies") + self.parent.debugmsg(6, "headers cookies, kwname:", entry["kwname"]) self.parent.debugmsg(9, "entry:", entry) # The original code didn't have do anthing to handle cookies beyond the original session diff --git a/src/modules/h2r_url.py b/src/modules/h2r_url.py index bb88f61..48d1df4 100644 --- a/src/modules/h2r_url.py +++ b/src/modules/h2r_url.py @@ -112,15 +112,20 @@ def url_path(self): if path is None: return None + if path != opath: + retarr.append(path) + self.parent.debugmsg(5, "path:", path) + # return path + if path == opath and path[0] == '/': subopath = opath[1:] subpath = self.parent.find_variable(key + "_path", subopath, False) self.parent.debugmsg(7, "subpath:", subpath) if subpath != subopath: path = '/' + subpath - - if path != opath: - retarr.append(path) + self.parent.debugmsg(5, "path:", path) + retarr.append(path) + # return path if path == opath: patharr = path.split("/") @@ -142,6 +147,7 @@ def url_path(self): if newpathbeg != pathbeg or newpathend != pathend: path = newpathbeg + newpathend retarr.append(path) + # return path # try to find match for end of the path patharr = path.split("/") @@ -175,6 +181,7 @@ def url_path(self): if newpathbeg != pathbeg or newpathend != pathend: path = newpathbeg + newpathend retarr.append(path) + # return path self.parent.debugmsg(8, "match.group(2):", match.group(2)) if match.group(2) is not None and len(match.group(2))>1: From 464fe71d07a8eac4eda2e0f782b0894b7900f9be Mon Sep 17 00:00:00 2001 From: damies13 Date: Sun, 9 Apr 2023 00:37:02 +1000 Subject: [PATCH 4/5] Tuning existing_paramval Issue #4 --- src/har2rfreq.py | 2 +- src/modules/h2r_base.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/har2rfreq.py b/src/har2rfreq.py index 71aabee..3386de8 100644 --- a/src/har2rfreq.py +++ b/src/har2rfreq.py @@ -237,7 +237,7 @@ def find_estep(self, respno, kwname): def find_variable(self, key, value, lastresort=True): self.debugmsg(6, "") - self.debugmsg(6, "key:", key, " value:", value) + self.debugmsg(5, " key:", key, " value:", value) # reset parserdata self.parserdata = {} diff --git a/src/modules/h2r_base.py b/src/modules/h2r_base.py index c17ecd3..e6607de 100644 --- a/src/modules/h2r_base.py +++ b/src/modules/h2r_base.py @@ -123,7 +123,7 @@ def existing_paramval(self): if self.parent.workingdata["paramvalues"][searchval] in possiblekeys: newvalue = self.parent.workingdata["paramvalues"][searchval] return newvalue - if len(searchval)>10: + if len(searchval)>2: newvalue = self.parent.workingdata["paramvalues"][searchval] return newvalue From 01f164ca374615ec67742dd70d2d5730bad216a1 Mon Sep 17 00:00:00 2001 From: damies13 Date: Sun, 9 Apr 2023 00:58:40 +1000 Subject: [PATCH 5/5] Fix re.findall mismatch Issue #4 --- src/har2rfreq.py | 7 +++---- src/modules/h2r_html.py | 3 ++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/har2rfreq.py b/src/har2rfreq.py index 3386de8..b68cae6 100644 --- a/src/har2rfreq.py +++ b/src/har2rfreq.py @@ -565,15 +565,14 @@ def process_list(self, key, listdata): def saveparam(self, name, value): # - - newname = name + self.debugmsg(9, "newname:", newname) if name in self.workingdata["paramnames"]: i = 0 while newname in self.workingdata["paramnames"]: self.debugmsg(9, "newname:", newname) i += 1 - newname = name + "_{}".format(i) + newname = "{}_{}".format(name, i) self.debugmsg(9, "newname:", newname) @@ -591,7 +590,7 @@ def saveparam(self, name, value): if value not in self.workingdata["paramvalues"]: self.workingdata["paramvalues"][value] = "${"+newname+"}" - self.debugmsg(9, "saved", "${"+newname+"}", "=", value) + self.debugmsg(5, "saved", "${"+newname+"}", "=", value) return newname def add_test_case(self, tcname): diff --git a/src/modules/h2r_html.py b/src/modules/h2r_html.py index 866c59f..59db989 100644 --- a/src/modules/h2r_html.py +++ b/src/modules/h2r_html.py @@ -323,7 +323,7 @@ def html_body(self): self.parent.debugmsg(5, "ptn:", ptn, " found match:", match) # matchurls = list(match.groups()) # self.parent.debugmsg(6, "matchurls:", matchurls) - i = 1 + i = 0 # needs to be 0 because of re.findall not re.search (if re.search should be 1) for matchurl in match: if matchurl == searchval: self.parent.debugmsg(5, "i:", i, " matchurl:", matchurl, " searchval:", searchval) @@ -335,6 +335,7 @@ def html_body(self): # line = "${"+newkey+"}= evaluate re.findall(\"" + reptn + "\", \"\"\"${resp_"+str(resp)+".text}\"\"\")[" + str(i) + "] re" line = "${"+newkey+"}= evaluate re.findall(\"\"\"" + ptn + "\"\"\", \"\"\"${resp_"+str(resp)+".text}\"\"\")[" + str(i) + "] re" + self.parent.debugmsg(5, "line:", line) self.parent.outdata["*** Keywords ***"][ekwname].insert(estep, line) newvalue = "${"+newkey+"}" self.parent.debugmsg(5, "newvalue:", newvalue)