You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jmeter-dev@jakarta.apache.org by bu...@apache.org on 2005/10/20 15:35:14 UTC
DO NOT REPLY [Bug 37183] New: -
[PATCH] New XPathResponse function to extract data from Response
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=37183>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=37183
Summary: [PATCH] New XPathResponse function to extract data from
Response
Product: JMeter
Version: Nightly (Please specify date)
Platform: Other
OS/Version: other
Status: NEW
Severity: enhancement
Priority: P5
Component: Main
AssignedTo: jmeter-dev@jakarta.apache.org
ReportedBy: hpaluch@gitus.cz
Hi folks!
I created a new JMeter function, that allow to extract value from HTML
response using XPath query. This way it should be much more reliable to obtain
values of select/option etc than making complex regex.
This function is complement to existing XPath function - that is capable to
query files only.
Typical usage:
${__XPathResponse(/html/head/title,myTitle)}
- extracts Title from HTML response and put it to myTitle variable
${__XPathResponse(//form[@name='countryForm']//select[@name='country']/option
[text()='Czech Republic'])/@value}
- extracts value attribute of option element that match text 'Czech
Republic'. It is very handy feature when we know text of option element but
need to get its value (usually some numerical id from database).
Bugs/notes:
* no DOM caching - DOM tree is created on every function invocation
* need to do better exception handling
It would be nice to have handy response.getDataAsDomHtml() or similar to create
DOM on demand for every possible caller (XPathAssertion, XPathResponse etc..),
but currently I have no idea, what would be acceptable solution.
Any idea?
--
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org