Skip to content

Commit 5d0d6b6

Browse files
author
mmizin
authored
DCA-1063:Add ability to run confluence actions as specific user; Update documentation; (#556)
1 parent 1e3eda4 commit 5d0d6b6

File tree

2 files changed

+111
-1
lines changed

2 files changed

+111
-1
lines changed

app/jmeter/confluence.jmx

Lines changed: 110 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8845,6 +8845,115 @@ vars.put(&quot;p_uuid&quot;, UUID.randomUUID().toString());</stringProp>
88458845
<stringProp name="ThroughputController.percentThroughput">${perc_standalone_extension}</stringProp>
88468846
</ThroughputController>
88478847
<hashTree>
8848+
<GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="run_as_specific_user" enabled="false"/>
8849+
<hashTree>
8850+
<Arguments guiclass="ArgumentsPanel" testclass="Arguments" testname="username:password" enabled="true">
8851+
<collectionProp name="Arguments.arguments">
8852+
<elementProp name="app_specific_username" elementType="Argument">
8853+
<stringProp name="Argument.name">app_specific_username</stringProp>
8854+
<stringProp name="Argument.value">admin</stringProp>
8855+
<stringProp name="Argument.metadata">=</stringProp>
8856+
</elementProp>
8857+
<elementProp name="app_specific_password" elementType="Argument">
8858+
<stringProp name="Argument.name">app_specific_password</stringProp>
8859+
<stringProp name="Argument.value">admin</stringProp>
8860+
<stringProp name="Argument.metadata">=</stringProp>
8861+
</elementProp>
8862+
</collectionProp>
8863+
</Arguments>
8864+
<hashTree/>
8865+
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="login_as_specific_user" enabled="true">
8866+
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true">
8867+
<collectionProp name="Arguments.arguments">
8868+
<elementProp name="os_cookie" elementType="HTTPArgument">
8869+
<boolProp name="HTTPArgument.always_encode">false</boolProp>
8870+
<stringProp name="Argument.name">os_cookie</stringProp>
8871+
<stringProp name="Argument.value">true</stringProp>
8872+
<stringProp name="Argument.metadata">=</stringProp>
8873+
<boolProp name="HTTPArgument.use_equals">true</boolProp>
8874+
</elementProp>
8875+
<elementProp name="login" elementType="HTTPArgument">
8876+
<boolProp name="HTTPArgument.always_encode">false</boolProp>
8877+
<stringProp name="Argument.name">login</stringProp>
8878+
<stringProp name="Argument.value">Log+in</stringProp>
8879+
<stringProp name="Argument.metadata">=</stringProp>
8880+
<boolProp name="HTTPArgument.use_equals">true</boolProp>
8881+
</elementProp>
8882+
<elementProp name="os_destination" elementType="HTTPArgument">
8883+
<boolProp name="HTTPArgument.always_encode">false</boolProp>
8884+
<stringProp name="Argument.name">os_destination</stringProp>
8885+
<stringProp name="Argument.value">%2Findex.action</stringProp>
8886+
<stringProp name="Argument.metadata">=</stringProp>
8887+
<boolProp name="HTTPArgument.use_equals">true</boolProp>
8888+
</elementProp>
8889+
</collectionProp>
8890+
</elementProp>
8891+
<stringProp name="HTTPSampler.domain"></stringProp>
8892+
<stringProp name="HTTPSampler.port"></stringProp>
8893+
<stringProp name="HTTPSampler.protocol"></stringProp>
8894+
<stringProp name="HTTPSampler.contentEncoding"></stringProp>
8895+
<stringProp name="HTTPSampler.path">${application.postfix}/dologin.action</stringProp>
8896+
<stringProp name="HTTPSampler.method">POST</stringProp>
8897+
<boolProp name="HTTPSampler.follow_redirects">false</boolProp>
8898+
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
8899+
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
8900+
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
8901+
<stringProp name="HTTPSampler.embedded_url_re"></stringProp>
8902+
<stringProp name="HTTPSampler.connect_timeout"></stringProp>
8903+
<stringProp name="HTTPSampler.response_timeout"></stringProp>
8904+
<stringProp name="TestPlan.comments">Detected the start of a redirect chain</stringProp>
8905+
</HTTPSamplerProxy>
8906+
<hashTree>
8907+
<HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true">
8908+
<collectionProp name="HeaderManager.headers">
8909+
<elementProp name="Accept-Language" elementType="Header">
8910+
<stringProp name="Header.name">Accept-Language</stringProp>
8911+
<stringProp name="Header.value">en-US,en;q=0.5</stringProp>
8912+
</elementProp>
8913+
<elementProp name="Upgrade-Insecure-Requests" elementType="Header">
8914+
<stringProp name="Header.name">Upgrade-Insecure-Requests</stringProp>
8915+
<stringProp name="Header.value">1</stringProp>
8916+
</elementProp>
8917+
<elementProp name="Content-Type" elementType="Header">
8918+
<stringProp name="Header.name">Content-Type</stringProp>
8919+
<stringProp name="Header.value">application/x-www-form-urlencoded</stringProp>
8920+
</elementProp>
8921+
<elementProp name="Accept-Encoding" elementType="Header">
8922+
<stringProp name="Header.name">Accept-Encoding</stringProp>
8923+
<stringProp name="Header.value">gzip, deflate</stringProp>
8924+
</elementProp>
8925+
<elementProp name="Accept" elementType="Header">
8926+
<stringProp name="Header.name">Accept</stringProp>
8927+
<stringProp name="Header.value">text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8</stringProp>
8928+
</elementProp>
8929+
<elementProp name="" elementType="Header">
8930+
<stringProp name="Header.name">Authorization</stringProp>
8931+
<stringProp name="Header.value">Basic ${auth}</stringProp>
8932+
</elementProp>
8933+
</collectionProp>
8934+
</HeaderManager>
8935+
<hashTree/>
8936+
<JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="login as ${app_specific_username}:${app_specific_password}" enabled="true">
8937+
<stringProp name="scriptLanguage">groovy</stringProp>
8938+
<stringProp name="parameters"></stringProp>
8939+
<stringProp name="filename"></stringProp>
8940+
<stringProp name="cacheKey">true</stringProp>
8941+
<stringProp name="script">import org.apache.commons.codec.binary.Base64;
8942+
String auth_params = vars.get(&quot;app_specific_username&quot;) + &quot;:&quot; + vars.get(&quot;app_specific_password&quot;);
8943+
byte[] encodedUsernamePassword = Base64.encodeBase64(auth_params.getBytes());
8944+
vars.put(&quot;auth&quot;,new String(encodedUsernamePassword));</stringProp>
8945+
</JSR223PreProcessor>
8946+
<hashTree/>
8947+
<JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PostProcessor" testname="remove_request_result_from_view" enabled="true">
8948+
<stringProp name="scriptLanguage">groovy</stringProp>
8949+
<stringProp name="parameters"></stringProp>
8950+
<stringProp name="filename"></stringProp>
8951+
<stringProp name="cacheKey">true</stringProp>
8952+
<stringProp name="script">prev.setIgnore()</stringProp>
8953+
</JSR223PostProcessor>
8954+
<hashTree/>
8955+
</hashTree>
8956+
</hashTree>
88488957
<TransactionController guiclass="TransactionControllerGui" testclass="TransactionController" testname="jmeter_app_specific_action" enabled="true">
88498958
<boolProp name="TransactionController.includeTimers">false</boolProp>
88508959
<boolProp name="TransactionController.parent">true</boolProp>
@@ -9024,4 +9133,4 @@ if ( sleep_time &gt; 0 ) {
90249133
<hashTree/>
90259134
</hashTree>
90269135
</hashTree>
9027-
</jmeterTestPlan>
9136+
</jmeterTestPlan>

docs/dc-apps-performance-toolkit-user-guide-confluence.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ For example, for app-specific action development you could set percentage of `st
277277
1. Right-click on `View Results Tree` and disable this controller. It is important to disable `View Results Tree` controller before full-scale results generation.
278278
1. Click **Save** button.
279279
1. To make `standalone_extension` executable during toolkit run edit `dc-app-performance-toolkit/app/confluence.yml` and set execution percentage of `standalone_extension` accordingly to your use case frequency.
280+
1. App-specific tests could be run (if needed) as a specific user. In the `standalone_extension` uncomment `run_as_specific_user` controller. Navigate to the `username:password` config element and update values for `app_specific_username` and `app_specific_password` names with your specific user credentials.
280281
1. Run toolkit to ensure that all JMeter actions including `standalone_extension` are successful.
281282

282283
##### Using JMeter variables from the base script

0 commit comments

Comments
 (0)