[英]JMeter: How to inject date from today till past 10 days?
There is a scenario where user will inject today's record, then yesterday's, then day before yesterday, likewise past 10 days.有一种情况,用户将注入今天的记录,然后是昨天的,然后是前天,同样是过去 10 天。
How may I achieve this?我怎样才能做到这一点?
You can use__timeShift() function which allows you to generate dates in past/future with arbitrary offsets in desired format:您可以使用__timeShift() function来生成过去/未来的日期,并以所需的格式使用任意偏移量:
${__timeShift(dd-MM-yyyy,,,,)}
${__timeShift(dd-MM-yyyy,,,,)}
${__timeShift(dd-MM-yyyy,,-P1D,,)}
${__timeShift(dd-MM-yyyy,,-P1D,,)}
${__timeShift(dd-MM-yyyy,,-P2D,,)}
${__timeShift(dd-MM-yyyy,,-P2D,,)}
More information: Creating Dates in JMeter Using the TimeShift Function更多信息: 使用 TimeShift 在 JMeter 中创建日期 Function
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.