Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要使用 JMeter 测试一个应用程序,其中会话 ID 是 URL 的一部分(在 URL 的中间)。例如(sessionId= SID-123456):www.testServer.de/my/app/SID-123456/search.html
SID-123456
www.testServer.de/my/app/SID-123456/search.html
如何在 JMeter 测试中将会话 ID 放在 URL 中?
在 Jmeter 中,“PATH”的 HTTP 请求字段将接受变量。
因此,您只需从登录页面(或任何地方)提取会话 ID,将其存储到变量中,然后让您的 HTTP 请求路径读取“/my/app/${sid}/search.html
线程组看起来像这样:
Threadgroup -- Login Page ---- Regex 提取 SID -- Search Page