I just caught up with this thread. I'm attaching a jmeter script we have in the
hope it will help you out.
1. goes to the myRutgers uPortal welcome page
2. goes to the CAS sign-in page
3. submits userid/password (driven from a data file in form of "netid\tpassword"
4. retreives myRutgers portal login page
5. waits random amount of time
6. logs out of portal
a. User Defined Variables - allows you to configure for your portal/cas setup
b. CSV Data Set Config - allows you to specify your netid/password data file
c. it retrieves data fields dynamically out of the CAS form/response
I'm not fully up to speed on jmeter yet, but it seems to work for us. Let me
know if you have any questions (or suggestions for improvements).
Dan
tom tom wrote:
I changed the script and now everything working fine.
We do not need to extract the service ticket as well as we do not need to
call the
serviceValidate etc.
JMeter got the Follow Redirects Attribute which we can make use of.
Only thing we need to extract is the lt (Login ticket)
After that for subsequest requests enable the Follow Directs.
Let me know if some one needs the jmx script.
My next step is to integrate with the uPortal and see how can I
switch between tabs.
iztok wrote:
When I ran the script it complained about missing _eventId, hence I
included
that as a parameter (in addition I included _currentStateId=viewLoginForm
as
well).
ok...
Also I had to change the protocol to https with port 8443 as that's what
running in our development machines.
sure...
<cas:authenticationFailure code='INVALID_TICKET'>
ticket '***${ServiceTicket}***' not recognized
This clearly says the the regular expression extractor has not extracted
the
ticket properly.
i think that is a good bet at this point.
Location:
http://localhost:8080/uPortal/Login?ticket=ST-13-0qUdJ6rV9scbdguEMCU
ok, that is good. it means you logged in and have a service ticket.
now all you have to do is extract the ticket and use it.
BTW, i think it is also possible to get jmeter to follow redirects, so
that might be an option as the [successful] login response is a 302.
Then I changed the regular expression extractor look into the header
instead
of the body.
but still it does not seem pick the ticket.
dont know. you will have to do some work to figure it out. from
memory, but default, the jmeter regex doobie looks at the whole
response, so headers and body.
I have attached the modified script.
sorry, i dont have the setup or the time to look at this right now.
we are using cas 3.03 integrated with uPortal 2.5.1.
we were using cas 303 and later 304 on weblogic 9.1
good luck.
iztok
iztok wrote:
there are no problems load testing with jmeter.
use regular expressions to extract the value into the variable. this
is described in the jmeter help.
then pass the variable as a post parameter.
i have attached the test. this was used successfully with cas 303 and
304
iztok
On 9/13/06, tom tom <[EMAIL PROTECTED]> wrote:
We have integrated uPortal 2.5.1 and CAS 3.03.
We are using JMeter 2.2 to do the load testing. Even though we
passparameters like username,password and service.
It does not seem to work.
Has any one tried out this.
Should we pass some more parameters like (which is in the CAS login
page)
<input type="hidden" name="lt"
value="F5466104-A8BC-3141-0F01-695926862676"
/>
If so how can we give this as a parameter to the JMeter as this is a
dynamic
field.
Thanks,
--
View this message in context:
http://www.nabble.com/CAS-with-JMeter-tf2262934.html#a6278896
Sent from the CAS Users forum at Nabble.com.
_______________________________________________
Yale CAS mailing list
[email protected]
http://tp.its.yale.edu/mailman/listinfo/cas
--
View this message in context:
http://www.nabble.com/CAS-with-JMeter-tf2262934.html#a6298254
Sent from the CAS Users forum at Nabble.com.
_______________________________________________
Yale CAS mailing list
[email protected]
http://tp.its.yale.edu/mailman/listinfo/cas
_______________________________________________
Yale CAS mailing list
[email protected]
http://tp.its.yale.edu/mailman/listinfo/cas
--
Dan Mindler
Consulting Application Developer
Enterprise Systems & Services, Rutgers University
voice: 732 445-5429 | fax: 661 770-9330 | [EMAIL PROTECTED]
<jmeterTestPlan version="1.2" properties="1.8">
<hashTree>
<TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Test Plan"
enabled="true">
<elementProp name="TestPlan.user_defined_variables"
elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments"
testname="User Defined Variables" enabled="true">
<collectionProp name="Arguments.arguments"/>
</elementProp>
<stringProp name="TestPlan.user_define_classpath"></stringProp>
<boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
<boolProp name="TestPlan.functional_mode">false</boolProp>
<stringProp name="TestPlan.comments"></stringProp>
</TestPlan>
<hashTree>
<Arguments guiclass="ArgumentsPanel" testclass="Arguments" testname="User
Defined Variables" enabled="true">
<collectionProp name="Arguments.arguments">
<elementProp name="myrhost" elementType="Argument">
<stringProp name="Argument.metadata">=</stringProp>
<stringProp name="Argument.value">toronado.rutgers.edu</stringProp>
<stringProp name="Argument.name">myrhost</stringProp>
</elementProp>
<elementProp name="myrport" elementType="Argument">
<stringProp name="Argument.metadata">=</stringProp>
<stringProp name="Argument.value">443</stringProp>
<stringProp name="Argument.name">myrport</stringProp>
</elementProp>
<elementProp name="myruri" elementType="Argument">
<stringProp name="Argument.metadata">=</stringProp>
<stringProp name="Argument.value">/portallt/</stringProp>
<stringProp name="Argument.name">myruri</stringProp>
</elementProp>
<elementProp name="myrprotocol" elementType="Argument">
<stringProp name="Argument.metadata">=</stringProp>
<stringProp name="Argument.value">https</stringProp>
<stringProp name="Argument.name">myrprotocol</stringProp>
</elementProp>
<elementProp name="cashost" elementType="Argument">
<stringProp name="Argument.metadata">=</stringProp>
<stringProp
name="Argument.value">loadtest-cas.rutgers.edu</stringProp>
<stringProp name="Argument.name">cashost</stringProp>
</elementProp>
<elementProp name="casport" elementType="Argument">
<stringProp name="Argument.metadata">=</stringProp>
<stringProp name="Argument.value">443</stringProp>
<stringProp name="Argument.name">casport</stringProp>
</elementProp>
<elementProp name="casuri" elementType="Argument">
<stringProp name="Argument.metadata">=</stringProp>
<stringProp name="Argument.value">/login</stringProp>
<stringProp name="Argument.name">casuri</stringProp>
</elementProp>
<elementProp name="casprotocol" elementType="Argument">
<stringProp name="Argument.metadata">=</stringProp>
<stringProp name="Argument.value">https</stringProp>
<stringProp name="Argument.name">casprotocol</stringProp>
</elementProp>
<elementProp name="casservice" elementType="Argument">
<stringProp name="Argument.metadata">=</stringProp>
<stringProp
name="Argument.value">https://toronado.rutgers.edu/portallt/Authentication</stringProp>
<stringProp name="Argument.name">casservice</stringProp>
</elementProp>
<elementProp name="casauthenticationtype" elementType="Argument">
<stringProp name="Argument.metadata">=</stringProp>
<stringProp name="Argument.value">Kerberos</stringProp>
<stringProp name="Argument.name">casauthenticationtype</stringProp>
</elementProp>
<elementProp name="myrlogouturi" elementType="Argument">
<stringProp name="Argument.metadata">=</stringProp>
<stringProp name="Argument.value">/portallt/Logout</stringProp>
<stringProp name="Argument.name">myrlogouturi</stringProp>
</elementProp>
</collectionProp>
</Arguments>
<hashTree/>
<HeaderManager guiclass="HeaderPanel" testclass="HeaderManager"
testname="HTTP Header Manager" enabled="true">
<collectionProp name="HeaderManager.headers">
<elementProp name="" elementType="Header">
<stringProp name="Header.value">Mozilla/5.0 (Windows; U; Windows NT
5.1; en-US; rv:1.8.0.4) Gecko/20060508 Firefox/1.5.0.4</stringProp>
<stringProp name="Header.name">User-Agent</stringProp>
</elementProp>
<elementProp name="" elementType="Header">
<stringProp
name="Header.value">text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5</stringProp>
<stringProp name="Header.name">Accept</stringProp>
</elementProp>
<elementProp name="" elementType="Header">
<stringProp name="Header.value">en-us,en;q=0.5</stringProp>
<stringProp name="Header.name">Accept-Language</stringProp>
</elementProp>
<elementProp name="" elementType="Header">
<stringProp name="Header.value">gzip,deflate</stringProp>
<stringProp name="Header.name">Accept-Encoding</stringProp>
</elementProp>
<elementProp name="" elementType="Header">
<stringProp
name="Header.value">ISO-8859-1,utf-8;q=0.7,*;q=0.7</stringProp>
<stringProp name="Header.name">Accept-Charset</stringProp>
</elementProp>
<elementProp name="" elementType="Header">
<stringProp name="Header.value">300</stringProp>
<stringProp name="Header.name">Keep-Alive</stringProp>
</elementProp>
<elementProp name="" elementType="Header">
<stringProp name="Header.value">keep-alive</stringProp>
<stringProp name="Header.name">Connection</stringProp>
</elementProp>
</collectionProp>
</HeaderManager>
<hashTree/>
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup"
testname="Thread Group" enabled="true">
<longProp name="ThreadGroup.start_time">1153156680000</longProp>
<stringProp name="ThreadGroup.delay"></stringProp>
<stringProp name="ThreadGroup.duration"></stringProp>
<stringProp name="ThreadGroup.num_threads">2</stringProp>
<boolProp name="ThreadGroup.scheduler">false</boolProp>
<elementProp name="ThreadGroup.main_controller"
elementType="LoopController" guiclass="LoopControlPanel"
testclass="LoopController" testname="Loop Controller" enabled="true">
<intProp name="LoopController.loops">-1</intProp>
<boolProp name="LoopController.continue_forever">false</boolProp>
</elementProp>
<longProp name="ThreadGroup.end_time">1153156680000</longProp>
<stringProp name="ThreadGroup.on_sample_error">stopthread</stringProp>
<stringProp name="ThreadGroup.ramp_time">1</stringProp>
</ThreadGroup>
<hashTree>
<CSVDataSet guiclass="TestBeanGUI" testclass="CSVDataSet" testname="CSV
Data Set Config" enabled="true">
<stringProp name="delimiter">\t</stringProp>
<stringProp name="variableNames">username,password</stringProp>
<boolProp name="recycle">true</boolProp>
<stringProp name="filename">data/ida-f.txt</stringProp>
</CSVDataSet>
<hashTree/>
<CookieManager guiclass="CookiePanel" testclass="CookieManager"
testname="HTTP Cookie Manager" enabled="true">
<boolProp name="CookieManager.clearEachIteration">true</boolProp>
<collectionProp name="CookieManager.cookies"/>
</CookieManager>
<hashTree/>
<HTTPSampler2 guiclass="HttpTestSampleGui2" testclass="HTTPSampler2"
testname="MYR welcome page" enabled="true">
<stringProp name="HTTPSampler.path">${myruri}</stringProp>
<stringProp name="HTTPSampler.method">GET</stringProp>
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
<stringProp name="HTTPSampler.protocol">${myrprotocol}</stringProp>
<boolProp name="HTTPSampler.image_parser">true</boolProp>
<boolProp name="HTTPSampler.follow_redirects">true</boolProp>
<stringProp name="HTTPSampler.port">${myrport}</stringProp>
<elementProp name="HTTPsampler.Arguments" elementType="Arguments"
guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined
Variables" enabled="true">
<collectionProp name="Arguments.arguments"/>
</elementProp>
<stringProp name="HTTPSampler.mimetype"></stringProp>
<stringProp name="HTTPSampler.FILE_FIELD"></stringProp>
<stringProp name="HTTPSampler.monitor">false</stringProp>
<stringProp name="HTTPSampler.domain">${myrhost}</stringProp>
<stringProp name="HTTPSampler.FILE_NAME"></stringProp>
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
</HTTPSampler2>
<hashTree/>
<HTTPSampler2 guiclass="HttpTestSampleGui2" testclass="HTTPSampler2"
testname="CAS login page" enabled="true">
<stringProp name="HTTPSampler.path">${casuri}</stringProp>
<stringProp name="HTTPSampler.method">GET</stringProp>
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
<stringProp name="HTTPSampler.protocol">${casprotocol}</stringProp>
<boolProp name="HTTPSampler.image_parser">true</boolProp>
<boolProp name="HTTPSampler.follow_redirects">true</boolProp>
<stringProp name="HTTPSampler.port">${casport}</stringProp>
<elementProp name="HTTPsampler.Arguments" elementType="Arguments"
guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined
Variables" enabled="true">
<collectionProp name="Arguments.arguments">
<elementProp name="" elementType="HTTPArgument">
<stringProp name="Argument.metadata">=</stringProp>
<stringProp name="Argument.value">${casservice}</stringProp>
<boolProp name="HTTPArgument.use_equals">true</boolProp>
<stringProp name="Argument.name">service</stringProp>
<boolProp name="HTTPArgument.always_encode">true</boolProp>
</elementProp>
<elementProp name="" elementType="HTTPArgument">
<stringProp name="Argument.metadata">=</stringProp>
<stringProp name="Argument.value">true</stringProp>
<boolProp name="HTTPArgument.use_equals">true</boolProp>
<stringProp name="Argument.name">renew</stringProp>
<boolProp name="HTTPArgument.always_encode">false</boolProp>
</elementProp>
</collectionProp>
</elementProp>
<stringProp name="HTTPSampler.mimetype"></stringProp>
<stringProp name="HTTPSampler.FILE_FIELD"></stringProp>
<stringProp name="HTTPSampler.monitor">false</stringProp>
<stringProp name="HTTPSampler.domain">${cashost}</stringProp>
<stringProp name="HTTPSampler.FILE_NAME"></stringProp>
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
</HTTPSampler2>
<hashTree>
<XPathExtractor guiclass="XPathExtractorGui"
testclass="XPathExtractor" testname="X lt" enabled="true">
<stringProp name="XPathExtractor.xpathQuery">//form//[EMAIL
PROTECTED]"lt"]/@value</stringProp>
<stringProp name="XPathExtractor.refname">CAS_lt</stringProp>
<stringProp name="XPathExtractor.default"></stringProp>
<boolProp name="XPathExtractor.tolerant">true</boolProp>
</XPathExtractor>
<hashTree/>
<XPathExtractor guiclass="XPathExtractorGui"
testclass="XPathExtractor" testname="X _currentStateId" enabled="true">
<stringProp name="XPathExtractor.xpathQuery">//form//[EMAIL
PROTECTED]"_currentStateId"]/@value</stringProp>
<stringProp
name="XPathExtractor.refname">CAS__currentStateId</stringProp>
<stringProp name="XPathExtractor.default"></stringProp>
<boolProp name="XPathExtractor.tolerant">true</boolProp>
</XPathExtractor>
<hashTree/>
<XPathExtractor guiclass="XPathExtractorGui"
testclass="XPathExtractor" testname="X _eventId" enabled="true">
<stringProp name="XPathExtractor.xpathQuery">//form//[EMAIL
PROTECTED]"_eventId"]/@value</stringProp>
<stringProp name="XPathExtractor.refname">CAS__eventId</stringProp>
<stringProp name="XPathExtractor.default"></stringProp>
<boolProp name="XPathExtractor.tolerant">true</boolProp>
</XPathExtractor>
<hashTree/>
</hashTree>
<HTTPSampler2 guiclass="HttpTestSampleGui2" testclass="HTTPSampler2"
testname="CAS submit page" enabled="true">
<stringProp
name="HTTPSampler.path">${casuri}?service=${casservice}&renew=true</stringProp>
<stringProp name="HTTPSampler.method">POST</stringProp>
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
<stringProp name="HTTPSampler.protocol">${casprotocol}</stringProp>
<boolProp name="HTTPSampler.image_parser">true</boolProp>
<boolProp name="HTTPSampler.follow_redirects">true</boolProp>
<stringProp name="HTTPSampler.port">${casport}</stringProp>
<elementProp name="HTTPsampler.Arguments" elementType="Arguments"
guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined
Variables" enabled="true">
<collectionProp name="Arguments.arguments">
<elementProp name="" elementType="HTTPArgument">
<stringProp name="Argument.metadata">=</stringProp>
<stringProp name="Argument.value">${CAS_lt}</stringProp>
<boolProp name="HTTPArgument.use_equals">true</boolProp>
<stringProp name="Argument.name">lt</stringProp>
<boolProp name="HTTPArgument.always_encode">false</boolProp>
</elementProp>
<elementProp name="" elementType="HTTPArgument">
<stringProp name="Argument.metadata">=</stringProp>
<stringProp
name="Argument.value">${CAS__currentStateId}</stringProp>
<boolProp name="HTTPArgument.use_equals">true</boolProp>
<stringProp name="Argument.name">_currentStateId</stringProp>
<boolProp name="HTTPArgument.always_encode">false</boolProp>
</elementProp>
<elementProp name="" elementType="HTTPArgument">
<stringProp name="Argument.metadata">=</stringProp>
<stringProp name="Argument.value">${CAS__eventId}</stringProp>
<boolProp name="HTTPArgument.use_equals">true</boolProp>
<stringProp name="Argument.name">_eventId</stringProp>
<boolProp name="HTTPArgument.always_encode">false</boolProp>
</elementProp>
<elementProp name="" elementType="HTTPArgument">
<stringProp name="Argument.metadata">=</stringProp>
<stringProp name="Argument.value">${username}</stringProp>
<boolProp name="HTTPArgument.use_equals">true</boolProp>
<stringProp name="Argument.name">username</stringProp>
<boolProp name="HTTPArgument.always_encode">true</boolProp>
</elementProp>
<elementProp name="" elementType="HTTPArgument">
<stringProp name="Argument.metadata">=</stringProp>
<stringProp name="Argument.value">${password}</stringProp>
<boolProp name="HTTPArgument.use_equals">true</boolProp>
<stringProp name="Argument.name">password</stringProp>
<boolProp name="HTTPArgument.always_encode">true</boolProp>
</elementProp>
<elementProp name="" elementType="HTTPArgument">
<stringProp name="Argument.metadata">=</stringProp>
<stringProp
name="Argument.value">${casauthenticationtype}</stringProp>
<boolProp name="HTTPArgument.use_equals">true</boolProp>
<stringProp name="Argument.name">authenticationType</stringProp>
<boolProp name="HTTPArgument.always_encode">false</boolProp>
</elementProp>
</collectionProp>
</elementProp>
<stringProp name="HTTPSampler.mimetype"></stringProp>
<stringProp name="HTTPSampler.FILE_FIELD"></stringProp>
<stringProp name="HTTPSampler.monitor">false</stringProp>
<stringProp name="HTTPSampler.domain">${cashost}</stringProp>
<stringProp name="HTTPSampler.FILE_NAME"></stringProp>
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
</HTTPSampler2>
<hashTree/>
<UniformRandomTimer guiclass="UniformRandomTimerGui"
testclass="UniformRandomTimer" testname="Uniform Random Timer" enabled="true">
<stringProp name="RandomTimer.range">100</stringProp>
<stringProp name="ConstantTimer.delay">0</stringProp>
</UniformRandomTimer>
<hashTree/>
<HTTPSampler2 guiclass="HttpTestSampleGui2" testclass="HTTPSampler2"
testname="MYR Logout" enabled="true">
<stringProp name="HTTPSampler.path">${myrlogouturi}</stringProp>
<stringProp name="HTTPSampler.method">GET</stringProp>
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
<stringProp name="HTTPSampler.protocol">${myrprotocol}</stringProp>
<boolProp name="HTTPSampler.image_parser">true</boolProp>
<boolProp name="HTTPSampler.follow_redirects">true</boolProp>
<stringProp name="HTTPSampler.port">${myrport}</stringProp>
<elementProp name="HTTPsampler.Arguments" elementType="Arguments"
guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined
Variables" enabled="true">
<collectionProp name="Arguments.arguments"/>
</elementProp>
<stringProp name="HTTPSampler.mimetype"></stringProp>
<stringProp name="HTTPSampler.FILE_FIELD"></stringProp>
<stringProp name="HTTPSampler.monitor">false</stringProp>
<stringProp name="HTTPSampler.domain">${myrhost}</stringProp>
<stringProp name="HTTPSampler.FILE_NAME"></stringProp>
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
</HTTPSampler2>
<hashTree/>
<ResultCollector guiclass="SummaryReport" testclass="ResultCollector"
testname="Summary Report" enabled="true">
<objProp>
<value class="SampleSaveConfiguration">
<time>true</time>
<latency>true</latency>
<timestamp>true</timestamp>
<success>true</success>
<label>true</label>
<code>true</code>
<message>true</message>
<threadName>true</threadName>
<dataType>true</dataType>
<encoding>false</encoding>
<assertions>true</assertions>
<subresults>true</subresults>
<responseData>false</responseData>
<samplerData>false</samplerData>
<xml>false</xml>
<fieldNames>false</fieldNames>
<responseHeaders>false</responseHeaders>
<requestHeaders>false</requestHeaders>
<responseDataOnError>false</responseDataOnError>
<saveAssertionResultsFailureMessage>false</saveAssertionResultsFailureMessage>
<assertionsResultsToSave>0</assertionsResultsToSave>
</value>
<name>saveConfig</name>
</objProp>
<stringProp name="filename"></stringProp>
<boolProp name="ResultCollector.error_logging">false</boolProp>
</ResultCollector>
<hashTree/>
<ResultCollector guiclass="ViewResultsFullVisualizer"
testclass="ResultCollector" testname="View Results Tree" enabled="true">
<objProp>
<value class="SampleSaveConfiguration">
<time>true</time>
<latency>true</latency>
<timestamp>true</timestamp>
<success>true</success>
<label>true</label>
<code>true</code>
<message>true</message>
<threadName>true</threadName>
<dataType>true</dataType>
<encoding>false</encoding>
<assertions>true</assertions>
<subresults>true</subresults>
<responseData>false</responseData>
<samplerData>false</samplerData>
<xml>false</xml>
<fieldNames>false</fieldNames>
<responseHeaders>false</responseHeaders>
<requestHeaders>false</requestHeaders>
<responseDataOnError>false</responseDataOnError>
<saveAssertionResultsFailureMessage>false</saveAssertionResultsFailureMessage>
<assertionsResultsToSave>0</assertionsResultsToSave>
</value>
<name>saveConfig</name>
</objProp>
<stringProp name="filename"></stringProp>
<boolProp name="ResultCollector.error_logging">false</boolProp>
</ResultCollector>
<hashTree/>
</hashTree>
</hashTree>
</hashTree>
</jmeterTestPlan>
_______________________________________________
Yale CAS mailing list
[email protected]
http://tp.its.yale.edu/mailman/listinfo/cas