簡體   English   中英

307 Jmeter 中的臨時重定向消息,

[英]307 Temporary redirect message in Jmeter,

我正在嘗試對應用程序進行性能測試,在該應用程序中,當用戶使用憑據點擊登錄 URL 時,它會重定向到另一個 URL 並繼續進行。

我檢查了提供給 Url 的 Csrf 令牌,它是正確的。 我還檢查了 header 數據中提供的用戶憑據,它也是正確的。 我什至檢查了 session id 並且它是 static 直到重定向發生。 我無法為活動的 session 提取令牌,因為重定向發生錯誤。 有人可以幫助解決這種情況下的問題。

嘗試使用跟隨重定向選項並獲得以下錯誤..嘗試自動重定向時未發現錯誤,但顯示了無效的 session 響應。

請求:在此處輸入圖像描述

響應:在此處輸入圖像描述

根據307 臨時重定向狀態描述:

HTTP 307 Temporary Redirect重定向狀態響應碼表示請求的資源已暫時移動到Location標頭給出的 URL。

JMeter 應該遵循重定向並向目標 URL 發出請求,如果沒有 - 使用Redirect automaticallyFollow redirects框:

在此處輸入圖像描述

In any case you should be able to extract the target URL from the Location header using ie Regular Expression Extractor and put the resulting URL into "Path" section of the next HTTP Request sampler

Also JMeter should treat HTTP Status 307 as success (as well as any other HTTP status code below 400) so maybe you have an Assertion somewhere which artificially fails the Sampler based on the status code (ie checking if it's equal to 200 )

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM