I have a problem. I am using Regular Expression Extractor in Jmeter. I have two regex.
I can get the value from this.
Reference Name: as_fid_addtobasket
Regular Expression: <input type="hidden" name="as_fid" value="(.+?)" />
Template: $1$
But i can't get the value from this one.
> Reference Name: DynamicTempOrderProductGuid
>
> Regular Expression: <input data-val="true" data-val-required="The
> TempOrderProductGuid field is required."
> id="OrderProducts_1__TempOrderProductGuid"
> name="OrderProducts[1].TempOrderProductGuid" type="hidden"
> value="(.+?)" />
>
> Template: $1$
> >
Here is my result. The second one doesn't get the value. Where is the thing i missed?
POST data: OrderProducts.index=1&OrderProducts%5B1%5D.TempOrderProductGuid=%24%7BDynamicTempOrderProductGuid%7D&OrderProducts%5B1%5D.Count=1&OrderProducts%5B1%5D.ReceiverModel.OrderReceiver.NameRec=Test+ama%C3%A7l%C4%B1d%C4%B1r.+L%C3%BCtfen+dikkate+almay%C4%B1n%C4%B1z&OrderProducts%5B1%5D.ReceiverModel.OrderReceiver.PhoneRec=05352233285&OrderProducts%5B1%5D.ReceiverModel.OrderReceiver.OSSendingReason=&OrderProducts%5B1%5D.ReceiverModel.OrderReceiver.OSReceiverAddressType=&OrderProducts%5B1%5D.ReceiverModel.OrderReceiver.CompanyNameRec=&OrderProducts%5B1%5D.ReceiverModel.OrderReceiver.AddressLineRec=Test+ama%C3%A7l%C4%B1d%C4%B1r.+L%C3%BCtfen+dikkate+almay%C4%B1n%C4%B1z&OrderProducts%5B1%5D.ProductCode=se213&OrderProducts%5B1%5D.TempOrderProductGuid=%24%7Btokentoken%7D&totalProducts=1&as_fid=efWZ0i4RGLmC2nBWk%2FA1
I would recommend using XPath Extractor instead as regular expressions are pretty dependent on layout, attributes order, spaces, etc. and can be a real headache to develop and test for non-experienced used. Especially multi-line ones.
XPath expression for extracting value from as_fid
input will look like:
//input[@id='OrderProducts_1__TempOrderProductGuid']/@value
Some clues:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With