I need get attr. values componentId
and interactionstate
from html via JMeter, i try with XPath extractor but I can`t do that.
<html>
<body>
...
<form ...>
<form class="UIForm" id="UINavigationComposer" action="/portal/intranet/home?portal:componentId=d934d0f3-d465-4c1d-880a-45f54b3c48e2&interactionstate=JBPNS_rO0ABXcwAAt1aWNvbXBvbmVudAAAAAEAFFVJTmF2aWdhdGlvbkNvbXBvc2VyAAdfX0VPRl9f&portal:type=action" method="post">
<form ...>
...
</body>
</html>
I try to use xpath query:
/html/body/form@[id=UINavigationComposer]/@action
but obtain error:
Assertion failure message: /html/body/form@[id=UINavigationComposer]; => The reference to entity "portal:action" must end with the ';' delimiter.
I think you have a little lapse in your xpath query. Put @ near the id attribute like below
/html/body/form[@id=UINavigationComposer]/@action
or use something like this:
//form[@id='UINavigationComposer']/@action
So, the first step - to extract full action value and store it in separate jmeter variable (e.g. ACTION_TEST), using either RegEx or Xpath Extractor.
The second step - to extract from this variable values for componentId and interactionstate.
RegEx Extractor in jmeter 2.5 (since 2.3.2, afair) has option "Apply to ... Jmeter Variable".
You can add 2 additional RegEx Extractors each with ${ACTION_TEST} in "Apply to ... Jmeter Variable" option and correcponding queries:
componentId=(.+?);
interactionstate=(.+?);
Hope this will work.