Click here to Skip to main content
15,899,754 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
I am writing C# Coded UI Tests in Visual Studio 2010. To enhance the testing, I need to access all the responses coming back from the server. For instance, I am testing the Add New Member use case, if user’s attempt to add a new member fails, and the UI doesn't show neither the success or failure massage, I want to be able to get more detail from the http response and show the appropriate respond to the tester.

My code first open an instance of

C#
SHDocVw.ShellWindows allBrowsers = new SHDocVw.ShellWindows();

                if (allBrowsers.Count > 1)
                {

                    MessageBox.Show("Number active browsers = " + allBrowsers.Count + "." + " Please close all windows and try again...");

                    throw new Exception("Multiple IE Instances not allow ");

                }

                p = Process.Start("iexplore.exe", "http://bing/");

                BrowserWindow win = new BrowserWindow();

                current.SearchProperties[BrowserWindow.PropertyNames.Name] = "Bing";

               if (p == null) throw new Exception("Could not launch IE");


Now, I need to somehow capture all the responses that server sends back to requests going out from the instance of win object?

I am not sure if there is any way to do with HttpContext or such.

Thanks

Ali
Posted
Updated 25-Feb-11 7:35am
v2

1 solution

You're not going to get that using your Test code when you're running external processes. You'll need to use a tool like Fiddler[^] to grab all the HTTP traffic.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900