UC07 remake random page

This commit is contained in:
Ермаков 2026-03-29 00:42:42 +03:00
parent 93bb99ac6f
commit 64f28d4b9b

View File

@ -6681,7 +6681,7 @@ vars.put(&quot;ASSIGNED_TO&quot;, &quot;${assigned}&quot;)</stringProp>
</collectionProp> </collectionProp>
</HeaderManager> </HeaderManager>
<hashTree/> <hashTree/>
<JSONPostProcessor guiclass="JSONPostProcessorGui" testclass="JSONPostProcessor" testname="TOTAL_TICKETS &lt;&lt;&lt; JE" enabled="true"> <JSONPostProcessor guiclass="JSONPostProcessorGui" testclass="JSONPostProcessor" testname="TOTAL_TICKETS &lt;&lt;&lt; JE">
<stringProp name="JSONPostProcessor.referenceNames">TOTAL_TICKETS</stringProp> <stringProp name="JSONPostProcessor.referenceNames">TOTAL_TICKETS</stringProp>
<stringProp name="JSONPostProcessor.jsonPathExprs">$..recordsTotal</stringProp> <stringProp name="JSONPostProcessor.jsonPathExprs">$..recordsTotal</stringProp>
<stringProp name="JSONPostProcessor.match_numbers">1</stringProp> <stringProp name="JSONPostProcessor.match_numbers">1</stringProp>
@ -7266,16 +7266,19 @@ vars.put(&quot;ASSIGNED_TO&quot;, &quot;${assigned}&quot;)</stringProp>
<stringProp name="JSONPostProcessor.defaultValues">Not_found_RANDOM_ID_TICKET_RE</stringProp> <stringProp name="JSONPostProcessor.defaultValues">Not_found_RANDOM_ID_TICKET_RE</stringProp>
</JSONPostProcessor> </JSONPostProcessor>
<hashTree/> <hashTree/>
<JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="START_PAGINATION &gt;&gt;&gt; JSR223" enabled="true"> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="START_PAGINATION &gt;&gt;&gt; JSR223">
<stringProp name="scriptLanguage">groovy</stringProp> <stringProp name="scriptLanguage">groovy</stringProp>
<stringProp name="parameters"></stringProp> <stringProp name="parameters"></stringProp>
<stringProp name="filename"></stringProp> <stringProp name="filename"></stringProp>
<stringProp name="cacheKey">true</stringProp> <stringProp name="cacheKey">true</stringProp>
<stringProp name="script">Integer total = vars.get(&quot;TOTAL_TICKETS&quot;) as Integer <stringProp name="script">Integer total = vars.get(&quot;TOTAL_TICKETS&quot;) as Integer
Integer RANDOM_PAGE = new Random().nextInt(total) Integer total_page = total / 25
Integer start = RANDOM_PAGE / 25 if (total % 25 &gt; 0){
vars.put(&quot;DRAW&quot;, &quot;${start}&quot;) total_page = total_page + 1
start = start * 25 }
Integer random_page = new Random().nextInt(total_page)
vars.put(&quot;DRAW&quot;, &quot;${random_page}&quot;)
Integer start = random_page * 25
vars.put(&quot;START_PAGINATION&quot;, &quot;${start}&quot;)</stringProp> vars.put(&quot;START_PAGINATION&quot;, &quot;${start}&quot;)</stringProp>
</JSR223PreProcessor> </JSR223PreProcessor>
<hashTree/> <hashTree/>
@ -7512,7 +7515,7 @@ vars.put(&quot;START_PAGINATION&quot;, &quot;${start}&quot;)</stringProp>
</elementProp> </elementProp>
</HTTPSamplerProxy> </HTTPSamplerProxy>
<hashTree> <hashTree>
<HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager">
<collectionProp name="HeaderManager.headers"> <collectionProp name="HeaderManager.headers">
<elementProp name="Referer" elementType="Header"> <elementProp name="Referer" elementType="Header">
<stringProp name="Header.name">Referer</stringProp> <stringProp name="Header.name">Referer</stringProp>
@ -23574,7 +23577,7 @@ if (variable != &quot;0&quot;){
</JSONPostProcessor> </JSONPostProcessor>
<hashTree/> <hashTree/>
</hashTree> </hashTree>
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="&lt;_/datatables_ticket_list/__queryEncoded__" enabled="true"> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="&lt;_/datatables_ticket_list/__queryEncoded__">
<stringProp name="TestPlan.comments">Переключился на 2-ую страницу</stringProp> <stringProp name="TestPlan.comments">Переключился на 2-ую страницу</stringProp>
<stringProp name="HTTPSampler.domain">${HOSTNAME}</stringProp> <stringProp name="HTTPSampler.domain">${HOSTNAME}</stringProp>
<stringProp name="HTTPSampler.port">${PORT}</stringProp> <stringProp name="HTTPSampler.port">${PORT}</stringProp>
@ -24152,7 +24155,7 @@ if (variable != &quot;0&quot;){
<stringProp name="JSONPostProcessor.defaultValues">Not_found_RANDOM_ID_TICKET_RE</stringProp> <stringProp name="JSONPostProcessor.defaultValues">Not_found_RANDOM_ID_TICKET_RE</stringProp>
</JSONPostProcessor> </JSONPostProcessor>
<hashTree/> <hashTree/>
<JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="START_PAGINATION &gt;&gt;&gt; JSR223" enabled="true"> <JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="START_PAGINATION &gt;&gt;&gt; JSR223">
<stringProp name="scriptLanguage">groovy</stringProp> <stringProp name="scriptLanguage">groovy</stringProp>
<stringProp name="parameters"></stringProp> <stringProp name="parameters"></stringProp>
<stringProp name="filename"></stringProp> <stringProp name="filename"></stringProp>
@ -24165,6 +24168,23 @@ start = start * 25
vars.put(&quot;START_PAGINATION&quot;, &quot;${start}&quot;)</stringProp> vars.put(&quot;START_PAGINATION&quot;, &quot;${start}&quot;)</stringProp>
</JSR223PreProcessor> </JSR223PreProcessor>
<hashTree/> <hashTree/>
<JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="START_PAGINATION_2 &gt;&gt;&gt; JSR223">
<stringProp name="scriptLanguage">groovy</stringProp>
<stringProp name="parameters"></stringProp>
<stringProp name="filename"></stringProp>
<stringProp name="cacheKey">true</stringProp>
<stringProp name="script">Integer total = vars.get(&quot;TOTAL_TICKETS&quot;) as Integer
Integer total_page = total / 25
if (total % 25 &gt; 0){
total_page = total_page + 1
}
Integer random_page = new Random().nextInt(total_page)
vars.put(&quot;DRAW&quot;, &quot;${random_page}&quot;)
Integer start = random_page * 25
vars.put(&quot;START_PAGINATION&quot;, &quot;${start}&quot;)</stringProp>
<stringProp name="TestPlan.comments">Better version</stringProp>
</JSR223PreProcessor>
<hashTree/>
</hashTree> </hashTree>
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="&lt;_/tickets/__ticket__/" enabled="true"> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="&lt;_/tickets/__ticket__/" enabled="true">
<stringProp name="HTTPSampler.domain">${HOSTNAME}</stringProp> <stringProp name="HTTPSampler.domain">${HOSTNAME}</stringProp>
@ -24573,7 +24593,7 @@ if (variable != &quot;0&quot;){
<connectTime>true</connectTime> <connectTime>true</connectTime>
</value> </value>
</objProp> </objProp>
<stringProp name="filename">(?=class=&quot;radio-inline&quot;)(.*)(\d)(.*)(?!=&apos;checked&apos;)&lt;/label&gt;</stringProp> <stringProp name="filename"></stringProp>
</ResultCollector> </ResultCollector>
<hashTree/> <hashTree/>
</hashTree> </hashTree>