This is a migrated thread and some comments may be shown as answers.

Use of HttpProxy results in System.TimeoutException

2 Answers 127 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Matt
Top achievements
Rank 1
Matt asked on 30 Jun 2011, 03:26 PM
I would like to use the HttpProxy to add a special http header when performing a test.  However, I am not able to execute a simple test using the HttpProxy.

Whenever I set the UseHttpProxy value to true, my test will fail with a System.TimeoutException.  A popup window  "ArtOfTest.Runner has stopped working" message appears.

the browser does navigate to the page.  I can view the page in the browser.  At the end of the test, the crash occurrs.  The test does not fail if I remove the UseHttpProxy line.

System configuration...
Test Studio 2011.1.609.0
Running Windows 7 Pro 64-bit SP1
4GB RAM
Added ArtOfTest.WebAii.HttpProxy.exe and ArtOfTest.Runner.to windows firewall exceptions

Test setup...

[CodedStep(@"Navigate to : 'http://www.mckerinsoftware.com/'")]
public void apibranchtest_CodedStep()
{
         Manager.Settings.Web.UseHttpProxy = true;
  
         // Navigate to : 'http://www.mckerinsoftware.com/'
        ActiveBrowser.NavigateTo(http://www.mckerinsoftware.com/);
}

Log entry...

Overall Result: Fail
System.TimeoutException: The operation has timed out.
   at System.IO.Pipes.NamedPipeClientStream.Connect(Int32 timeout)
   at ArtOfTest.WebAii.Messaging.Process.BrowserProvisioner.EndService()
   at ArtOfTest.WebAii.Core.Manager.End()
   at ArtOfTest.WebAii.Core.Manager.Dispose(Boolean disposing)
   at ArtOfTest.WebAii.Design.Execution.TestExecuteProxy.ShutDown()
   at ArtOfTest.WebAii.Design.Execution.ExecutionEngine.ExecuteTest(Test testcase, Settings settings, String testBinaryFolder, String deploymentFolder, ExecutionType exeType, Guid firstStepGuid, Guid lastStepGuid, IntPtr existingBrowserHandle, DebuggerOptions debuggerOptions)
------------------------------------------------------------
'6/30/2011 8:12:24 AM' - Overall Result: Fail
'6/30/2011 8:12:24 AM' - Duration: [0 min: 0 sec: 10 msec]
------------------------------------------------------------

Other note...
On the Help menu when I View the Application log, I see the following message even during a successful test when the UseHttpProxy line is commented out.  I do not know if this is related, but wanted to provide as much info as possible to help with a resolution.

Error: PipeCommunication.AsyncPipeRead() : EXCEPTION ("Pipe Null State: False")

Type: ObjectDisposedException

Message: Cannot access a closed pipe.

Call Stack:

at System.IO.__Error.PipeNotOpen()

at System.IO.Pipes.PipeStream.CheckReadOperations()

at System.IO.Pipes.PipeStream.BeginRead(Byte[] buffer, Int32 offset, Int32 count, AsyncCallback callback, Object state)

at ArtOfTest.WebAii.Messaging.Process.PipeCommunication.AsyncPipeRead(PipeStream pipe, Byte[] bytes, Int32 offset, Int32 count)

2 Answers, 1 is accepted

Sort by
0
Cody
Telerik team
answered on 30 Jun 2011, 04:08 PM
Hello Matt,

I am sorry for the confusion. The UseHttpProxy must be set before the browser is launched. By the time a coded step gets control it's too late. You have two options to overcome this:

1) In your closed step. Close and reopen the browser using code like this:

ActiveBrowser.Close();
Manager.Settings.Web.UseHttpProxy = true;
Manager.LaunchNewBrowser();
2) Set SilverlightEnabled as shown in the attached screenshots. Even though you may not be using Silverlight, it has the side effect of turning on our HTTP proxy which our Silverlight automation depends on.
 

Greetings,
Cody
the Telerik team
Register today for a live 'What's New in Test Studio R1 2011 SP2' event on Tuesday, July 19 at 2pm EST!

Have you looked at the new Online User Guide for Telerik Test Studio?
0
Matt
Top achievements
Rank 1
answered on 30 Jun 2011, 04:52 PM
Thank you!  That works great.  I appreciate the help.
Tags
General Discussions
Asked by
Matt
Top achievements
Rank 1
Answers by
Cody
Telerik team
Matt
Top achievements
Rank 1
Share this question
or