I just started my career as a Junior Tester
Step1: Requested XML Data using HTTP Request
Path: /vitalhub/rest/patientlists
ResponseData:<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<patientLists lastRefresh="2015-11-16T15:48:21.050-05:00" count="4">
<patientList modifiable="false" uid="0000000000204016">
<vhSysSrc>cerner</vhSysSrc>
<name>Test List</name>
</patientList>
<patientList modifiable="false" uid="0000000000204019">
<vhSysSrc>cerner</vhSysSrc>
<name>123</name>
</patientList>
<patientList modifiable="false" uid="0000000000204021">
<vhSysSrc>cerner</vhSysSrc>
<name>Random Patient List</name>
</patientList>
<patientList modifiable="false" uid="0000000000204023">
<vhSysSrc>cerner</vhSysSrc>
<name>Custom List</name>
</patientList>
</patientLists>
Step2: Added a XpathExtractor as
Reference Name: listName
Xpath Query:patientLists/patientList/name/text()
Step3: Added debugSampler and these were the results
JMeterVariables:
JMeterThread.last_sample_ok=true
JMeterThread.pack=org.apache.jmeter.threads.SamplePackage@393d25f8
START.HMS=134134
START.MS=1447267294003
START.YMD=20151111
TESTSTART.MS=1447709583847
applicationDomain=VitalHubChart
bulkCiphers=NONE
deviceId= dev1
devicePassword=vitalhub123
key=55fbcb5c-f71a-42ce-995e-72a7c44145b3
key_1=55fbcb5c-f71a-42ce-995e-72a7c44145b3
key_matchNr=1
listName=Test List
listName_1=Test List
listName_2=123
listName_3=Random Patient List
listName_4=Custom List
listName_matchNr=4
password=testcp
sessionId=f3e8a037-d6e6-4ed4-b5db-993c713417f0
sessionId_1=f3e8a037-d6e6-4ed4-b5db-993c713417f0
sessionId_matchNr=1
user=testcp
userName=testcp
userPass= testcp
Step4: Added an other Http Request to get the results by using ListName
Path: /vitalhub/rest/patientLists/name/${listName_1}
By using Step4 I can just get info of a single list. I have to change it to listName_2..4
to get different list results
How can I automate these requests?
I tried using foreach
loop and RegularExpressionExtractor
and tried using BeanShellPostProcessor
, but was unable to solve it
I would be thankful if anyone can answer my question.