locked
Modifying cookie in Web Test not Captured in Fiddler RRS feed

  • Question

  • I am using a pre-request plugin to modify a cookie value. I need to append additional information to a existing cookie. In my plugin, I add a "Cookie" header to the request with the appended value but this cookie value is not being captured by Fiddler when the web test executes. In Visual Studio 2012, the request's raw request shows the cookie value I am trying to add but Fiddler seems to capture a different value.

    I have also tried adding the cookie header in the web test design view which didn't work. (that is why you see two cookie headers)

    Attached is an image to illustrate what I am seeing.

    Monday, October 7, 2013 3:14 PM

Answers

  • Hi Duy,

    Thanks for your response.

    It is difficult to report a bug when I'm not able to package this project for public access.

    If so, I’m afraid that I have no idea about this issue. If you cannot determine your answer here or on your own, to help you resolve this issue, consider opening a support case with us. Visit this link to see the various support options that are available to better meet your needs:  http://support.microsoft.com/default.aspx?id=fh;en-us;offerprophone. Thanks for your understanding.

    Sincerely,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, October 18, 2013 3:05 AM

All replies

  • Hi Duy,

    Thank you for posting in the MSDN forum.

    Do you mean that you modify the cookie in your web test request in VS IDE? And then you use the Fiddler tool to capture the cookie which was changed in web test request? As my understanding, we use the Fiddler to capture the request, and then import it to the VS IDE, so it seems that it is not the correct ordered. I mean that if you could modify certain value in your web URL viewed in web browser, and then you could use the Fiddler tool to capture and check it. If you change it in web test, I’m afraid that it is not the correct action, since it is running after you use the Fiddler to capture the previous requests. Maybe you could check the URL in your web browser, and check whether the specific value has been changed, and then use the Fiddler to capture it.

    If I have misunderstood anything, please make free feel to let me know.

    In addition, for the specific Fiddler tool issue, maybe you could get better support from the Fiddler forum here:

    http://www.fiddleforum.com/fiddleforum/index.php?PHPSESSID=3c326e390f479c10b42415dcf1873984&

    A document shared us some information about view cookie information.

    http://fiddler2.com/documentation/Observe-Traffic/Tasks/ScanCookies

    Best Regards,


    Jack Zhai[MSFT]
    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support
    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Tuesday, October 8, 2013 8:56 AM
  • I don't understand what you are trying to say. If I use a Visual Studio pre-request plugin to change a cookie value, using Fiddler to capture the HTTP traffic, shouldn't I be able to see the changed value?
    Tuesday, October 8, 2013 1:19 PM
  • Fiddler is often recommended as a way of recording requests and responses to generate a web test. Are you trying to use Fiddler to record a test as it runs?

    Assuming you are recording a test as it it is played back then have you compared what Fiddler shows to what the Visual Studio test log shows.

    You say you have a plugin to modify the cookie. Are you sure it is running. I often confuse myself with plugins not doing as I expect so I often use the e.WebTest.AddCommentToResult to check that a plugin is being called and that it is doing what I expect.

    Regards

    Adrian

    Tuesday, October 8, 2013 3:16 PM
  • "Assuming you are recording a test as it it is played back then have you compared what Fiddler shows to what the Visual Studio test log shows." - That is exactly what I am doing.

    I know the plugin is running because I can debug into the plugin and you can see in the screenshot, the cookie header has the additional information I added. But Fiddler does not capture this value when I play back the webtest.

    Tuesday, October 8, 2013 3:20 PM
  • Thanks for Adrian’s help.

    Hi Duy,

    Thanks for your response.

    Sorry for my misunderstanding about this issue.

    Just to make this issue clearly.

    1. You record a web test with Fiddler/web test recorder.
    2. You write the plug-in and change the cookie value.
    3. Run the web tests, and use the Fiddler to capture the cookie value, you could get the new cookie value in your web test result, but it is not the correct value captured like that you have changed in your web test request when you use the Fiddler tool.

    Am I right?

    If so, my suggestion is that you could check whether the value is the same value before you change the cookie value, for example, use the Fiddler to record the same web test, and capture and get the cookie value A, import the test to your VS, and then add the plug-in for your web test, and then run it again, use the Fiddler to capture this request again, as you said that you would get the cookie value B, and then compare it with the previous cookie value A, whether they have the same value?

    Please make sure that your web test run normally after you change the cookie value in VS.

    Maybe you share us the main code about the pre-request plugin, we would make sure that we change the value before it sends the request. If we make sure that it works well in web tests requests in VS IDE, I’m afraid that it would be the Fiddler tool issue. As my precious reply, the Fiddler has his own support forum, so if possible, you could post this issue to the Fiddler forum:

    http://fiddler2.com/support, and there you would get dedicated support from the Fiddler expert. Thanks for your cooperation.

    Of course, if possible, you could share me a simple sample, I will try to check it with your plug-in using the Fiddler tool. Please attach your Visual Studio project and test project (include the plug-in), you can upload it to the sky drive, and then share the download link in your post.

    If there's any concern, please feel free to let me know.

    Sincerely,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, October 9, 2013 7:54 AM
  • "Assuming you are recording a test as it it is played back then have you compared what Fiddler shows to what the Visual Studio test log shows." - that is what the image illustrates. I am able to step into the plug in so I know it is running.
    Thursday, October 10, 2013 3:18 AM
  • "...Run the web tests, and use the Fiddler to capture the cookie value, you could get the new cookie value in your web test result, but it is not the correct value captured like that you have changed in your web test request when you use the Fiddler tool.  Am I right?" - Exactly.

    The plugin fetches the existing cookie value, appends a string in front of it, then it add a "Cookie" header to the request with the appended value. I will upload the actual code shortly.

    (If the image is too small, right click and copy image location and paste into a new tab.)


    • Edited by Duy.Nguyen Thursday, October 10, 2013 1:38 PM
    Thursday, October 10, 2013 3:25 AM
  • Hi Duy,

    It seems that the test request sends unsuccessfully, if it really is the Fiddler tool issue, I suggest you submit a feedback to the Fiddler tool forum.

    In addition, maybe you could use other tools/the third tools which could capture the cookies value, and then check it again. Maybe the HttpWatch could help.

    Best Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, October 11, 2013 6:01 AM
  • Will HTTP Watch record traffic from a Visual Studio web test play back? Also, the Basic Edition will not allow me to view sites that are not part of the Alexa Top 20.
    Friday, October 11, 2013 1:38 PM
  • Hi Duy,

    Thanks for your response.

    It is just an idea if you could get a tool which could capture the cookie value. Actually I don’t permit to install this kind of tool in my side. I just know that it could extend cookie information like this document.

    Note: This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you.

    Microsoft does not control these sites and has not tested any software or information found on these sites;

    Therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there.

    There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.

    As our previous discussion, we could make sure that you could change the cookie value in your web test request, the real issue you want to know is that why the Fiddler couldn’t capture the correct cookie value, it is the Fiddler tool issue, since we don’t support the Fiddler tool issue, we just use it when we record a web test as another way. So if you want to get dedicated support, please post this issue to the Fiddler tool forum. Thanks for your understanding.

    Would you mind changing the issue type to General Discussion because this issue is related to the Fiddler tool? Maybe other community members who get the similar issue could provide useful information here. If you could provide the sample and just let me repro it and make sure that whether the Fiddler tool capture the same wrong value as yours in my test Environment, you could send your web project and test project to v-jake at microsoft dot com. Of course, if you get any information from the Fiddler forum, you could share it here.

    Sincerely


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, October 14, 2013 6:35 AM
  • I don't believe it is a fiddler issue. I believe that Visual Studio is not sending the request with the modified cookie value. It may appear so in Visual Studio, but the actual web request is different. Unfortunately, I can't send a sample site because the application is hosted internally and there is no public access.
    Monday, October 14, 2013 1:43 PM
  • Hi Duy,

    I believe that Visual Studio is not sending the request with the modified cookie value.

    Actually it is the issue which concern me.

    1. Whether your web test result is passed after you change the value?
    2. Whether this specific request sends successfully in your web test requests?
    3. Like the following screen shot, you shared us the information about the "Request", could you click “Response” in the following web test result? What information do you get there?

    Best Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, October 15, 2013 5:20 AM
  • This particular request passes but there are other requests that do not pass. But I believe it is because the application uses a Flash plugin that Visual Studio does not support. But this cookie behavior is concerning.
    Tuesday, October 15, 2013 1:37 PM
  • Hi Duy,

    Glad to receive your reply.

    If the specific request sends successfully, I doubt that it is not the web test issue.

    Since it is hard for me to repro this issue, I’m afraid that this question requires a more in-depth level of support, to get the issue confirmed and diagnose by product team, would you please create connect report for it? You will get email notification for update.http://connect.microsoft.com/VisualStudio/feedback/CreateFeedback.aspx, if you submit it, you could share us the link here, so we could know the latest information about this issue. Thanks for your understanding.

    Best Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, October 16, 2013 6:33 AM
  • Hi Duy,

    I am writing to check the status of the issue on your side.

    Would you mind letting us know the latest information about this issue?

    Do you submit this issue to the connect report? If not, could you submit it? If you have submitted it, do you get any latest information from the product team expert? Please share us the connect report link here.

    Have a nice weekend,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, October 18, 2013 2:09 AM
  • It is difficult to report a bug when I'm not able to package this project for public access.
    Friday, October 18, 2013 2:17 AM
  • Hi Duy,

    Thanks for your response.

    It is difficult to report a bug when I'm not able to package this project for public access.

    If so, I’m afraid that I have no idea about this issue. If you cannot determine your answer here or on your own, to help you resolve this issue, consider opening a support case with us. Visit this link to see the various support options that are available to better meet your needs:  http://support.microsoft.com/default.aspx?id=fh;en-us;offerprophone. Thanks for your understanding.

    Sincerely,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, October 18, 2013 3:05 AM