How to Fetch or extract value from Div tag using Jmeter

蹲街弑〆低调 提交于 2019-12-12 01:56:11

问题


I want to fetch OTP value(123456) from Div tag, as it changes every time.
How can i do this in Jmeter? I have some idea that, it can done by xpath extractor & reguler expression..but doesn't successful in dong so.. Please help me. Code Sample is like this.

<div id="messages">
<div class="section clearfix"> 
<div class="messages status"> 
<h2 class="element-invisible">Status message</h2> OTP has been sent to your registered email id.  OTP is 123456</div></div></div>


I want OTP value in a variable...so that i can use that dynamically.

回答1:


Use Regular expression extractor as a post processor like,

Later you can use that value anywhere using ${OTP_val} variable



来源:https://stackoverflow.com/questions/26796222/how-to-fetch-or-extract-value-from-div-tag-using-jmeter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!