This question is locked. New answers and comments are not allowed.
I am trying to use the HTTP proxy with the code in the block below. The Set web proxy set is run as step 1 of the test to initialize the settings and relaunch the browser. When I get to the AddBeforeResponseListener I am getting a null reference exception( Object reference not set to an instance of an object..) I am clearly missing an initialization step somewhere but I am not sure where.
I am use the TS plugin version 2012.1.420.0 with VS2010 on a win7 64 bit box.
I am use the TS plugin version 2012.1.420.0 with VS2010 on a win7 64 bit box.
[CodedStep(@"Set WebProxy")] public void TradeList_CodedStep4() { ActiveBrowser.Close(); Manager.Settings.Web.UseHttpProxy = true; Manager.LaunchNewBrowser(); } [CodedStep(@"Click 'ContentPlaceHolderRwDldFilesCLbGenerateBulkReportLink'")] public void TradeList_CodedStep3() { ResponseListenerInfo li = new ResponseListenerInfo(GetFileFromHeaderInfo); Manager.Http.AddBeforeResponseListener(li); // Click 'ContentPlaceHolderRwDldFilesCLbGenerateBulkReportLink' Pages.TamaracIncCom7.ContentPlaceHolderRwDldFilesCLbGenerateBulkReportLink.Click(false); Manager.Http.RemoveBeforeResponseListener(li); //string getPostBack = (string)GetExtractedValue("BulkReportJavaScript"); //string parsedPostBack = getPostBack.Substring(11); //var response = Actions.InvokeScript(parsedPostBack); } private void GetFileFromHeaderInfo(object sender, HttpResponseEventArgs e) { System.Collections.Specialized.NameValueCollection headers = e.Response.Headers; }