英文:
What is XPath Expressions to extract this data?
问题
XPath 表达式来提取第二行(订单号)的内容是:
//text()[2]
英文:
ORDER_ID (next line)
1209314
what will be the XPath expression to fetch only the 2nd line that is the order id, it is in string format and got this data from a JDBC request. The sql query was -- select order_id from sub where value="abc"
Tried ways like
//OrderNumber/text()
//Order_id/text()
答案1
得分: 1
-
XPath Extractor 用于 XML 数据。
-
在 JDBC Request 中,如果你正确配置了它,JMeter 应该会将结果保存到 JMeter 变量 中,不需要提取任何内容。如果你在 JDBC Request 采样器中指定了一个“变量名称”,例如
ORDER_ID
,JMeter 会创建以下变量:ORDER_ID_1=第一行的值 ORDER_ID_2=第二行的值 ... ORDER_ID_#=查询返回的行数
演示:
更多信息:
英文:
-
XPath Extractor is for XML data.
-
You don't need to extract anything from the JDBC Request, given you properly configure it JMeter should save the result into a JMeter Variable itself. If you specify a "Variable Name" in the JDBC Request sampler, for example
ORDER_ID
JMeter will create the following variables:ORDER_ID_1=value from first row ORDER_ID_2=value from second row ... ORDER_ID_#=number of rows returned by the query
Demo:
More information:
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论