XPath表达式来提取这些数据是什么?

huangapple go评论51阅读模式
英文:

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

  1. XPath Extractor 用于 XML 数据。

  2. 在 JDBC Request 中,如果你正确配置了它,JMeter 应该会将结果保存到 JMeter 变量 中,不需要提取任何内容。如果你在 JDBC Request 采样器中指定了一个“变量名称”,例如 ORDER_ID,JMeter 会创建以下变量:

     ORDER_ID_1=第一行的值
     ORDER_ID_2=第二行的值
     ...
     ORDER_ID_#=查询返回的行数
    

演示:

XPath表达式来提取这些数据是什么?

更多信息:

英文:
  1. XPath Extractor is for XML data.

  2. 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:

XPath表达式来提取这些数据是什么?

More information:

huangapple
  • 本文由 发表于 2023年5月11日 19:56:26
  • 转载请务必保留本文链接:https://go.coder-hub.com/76227398.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定