Dynamic value in the first request of webtest
-
27 กุมภาพันธ์ 2555 10:06
Hi,
In my scenario, I am getting a dynamic value(session id) in the very first request(homepage) of the webtest. It is being used in the "expected response url" property of that very request. I am able to extract this value but unable to correlate. Any pointers on how can I correlate this value?
I know that to handle a dynamic value we extract it in its previous request but here the first request itself is failing because of correlation issue. How to solve this problem?
ตอบทั้งหมด
-
29 กุมภาพันธ์ 2555 2:14ผู้ดูแล
Hi rishabhw,
Thank you for your active participation in the MSDN community!
This is a good blog about Web Test Recorder Plug-in: Extract Session ID from URI Path, it told about how to extract the Session ID and correlate the recorded Web test requests by implementing a Web test recorder plug-in. Hope it helps.
Have a nice day,
Jack Zhai [MSFT]
MSDN Community Support | Feedback to us
-
29 กุมภาพันธ์ 2555 5:39
You could also try setting Follow Redirects to False http://msdn.microsoft.com/en-us/library/bb514183.aspx
Thanks,
Anuj
http://www.anujchaudhary.com
- แก้ไขโดย AnujChaudharyMicrosoft 29 กุมภาพันธ์ 2555 5:39
-
1 มีนาคม 2555 12:36
Thank you Anuj and Jack for your continuos help.
i have found the solution and it is related to cooki-less implementation
How to handle ASP.NET Cookie-less Sessions ASP.NET allows session IDs to be passed as part of the URL requests, which can cause problems with VSTS playback. To deal with this issue, use the following steps: 1. Record the web test as normal 2. When the recording is done, you should see the very first request has no session ID in it, but all of the rest do. This first request also has a REDIRECT to the same URL, but with the session ID included. 3. For this request, turn off “Follow Redirects” and then add an extraction rule to get the value of the session (see example below). 4. Since you turned off redirects on the first request, you need to add a second request manually to the redirected page to capture any HIDDEN parameters. 5. Use “Quick Replace” to change all other hard-coded session IDs to the context you extracted in step 3
- ทำเครื่องหมายเป็นคำตอบโดย rishabhw 1 มีนาคม 2555 12:46
-
2 มีนาคม 2555 1:51ผู้ดูแล
Hi rishabhw,
Glad to see this issue has been resolved and thank you for sharing your solutions & experience here. It will be very beneficial for other community members who have similar questions.
Best Regards,
Jack Zhai [MSFT]
MSDN Community Support | Feedback to us
-
12 มีนาคม 2555 9:21
Hi rishabhw,
I have followed the instructions as you mentioned and I've found this solution in the Visual Studio Performance Testing Quick Reference Guide.
However, it doesn't work well in my web test.
I have already dynamic parameterized the session id yet the web server does not allow to login and return"500 Internal Server Error".
"Exception Details: System.NullReferenceException: Object reference not set to an instance of an object."
Appreciate if there's any useful tips or solution. Many thanks.
-
13 มีนาคม 2555 7:29
Hi Ching,
From the screenshot it seems the third request should be the first one. For this request turn off 'follow redirects' property and below this request should be your redirected url .You need not add extraction rule again in this newly added url.Please follow the instructions properly again.
But I still feel that there will be some different problems again because of 2 'login' pages. Try this and let me know if it helps.
-
14 มีนาคม 2555 6:54
Hi rishabhw,
Thanks for your reply.
I have already got where was my mistake and get it corrected.
For those who might interested in my situation, I followed the instructions in the guide, I duplicated the first request {{StagingWebServer}}/login.aspx and put as the second request. This caused new session id created.
Then I found out the second request should be the url of {{StagingWebServer}}/{{ExtSessionID}}/login.aspx instead.
Thanks.