public override IEnumerator <WebTestRequest> GetRequestEnumerator()
        {
            this.UserName = System.Environment.MachineName + "\\ContosoPartner2User9";
            this.Password = winUserPassword;

            // Initialize validation rules that apply to all requests in the WebTest
            if ((this.Context.ValidationLevel >= Microsoft.VisualStudio.TestTools.WebTesting.ValidationLevel.Low))
            {
                ValidateResponseUrl validationRule1 = new ValidateResponseUrl();
                this.ValidateResponse += new EventHandler <ValidationEventArgs>(validationRule1.Validate);
            }

            WebTestRequest request1 = new WebTestRequest(hostURL + "/sites/productcatalog/category.aspx");

            request1.QueryStringParameters.Add("categoryid", "0", false, false);
            ExtractHiddenFields extractionRule1 = new ExtractHiddenFields();

            extractionRule1.Required             = true;
            extractionRule1.HtmlDecode           = true;
            extractionRule1.ContextParameterName = "1";
            request1.ExtractValues += new EventHandler <ExtractionEventArgs>(extractionRule1.Extract);
            ExtractHiddenFields extractionRule2 = new ExtractHiddenFields();

            extractionRule2.Required             = true;
            extractionRule2.HtmlDecode           = true;
            extractionRule2.ContextParameterName = "2";
            request1.ExtractValues += new EventHandler <ExtractionEventArgs>(extractionRule2.Extract);
            ExtractHiddenFields extractionRule3 = new ExtractHiddenFields();

            extractionRule3.Required             = true;
            extractionRule3.HtmlDecode           = true;
            extractionRule3.ContextParameterName = "3";
            request1.ExtractValues += new EventHandler <ExtractionEventArgs>(extractionRule3.Extract);

            //Extract CategoryDetail WebPart guid
            ExtractAttributeValue extractionRule23 = new ExtractAttributeValue();

            extractionRule23.TagName             = "div";
            extractionRule23.AttributeName       = "WebPartID";
            extractionRule23.MatchAttributeName  = "id";
            extractionRule23.MatchAttributeValue = "WebPartWPQ3";
            extractionRule23.HtmlDecode          = true;
            extractionRule23.Required            = true;
            extractionRule23.Index = 0;
            extractionRule23.ContextParameterName = "CategoryDetailWebPartGuid";
            request1.ExtractValues += new EventHandler <ExtractionEventArgs>(extractionRule23.Extract);

            //Extract CategoryList WebPart guid
            ExtractAttributeValue extractionRule33 = new ExtractAttributeValue();

            extractionRule33.TagName             = "div";
            extractionRule33.AttributeName       = "WebPartID";
            extractionRule33.MatchAttributeName  = "id";
            extractionRule33.MatchAttributeValue = "WebPartWPQ4";
            extractionRule33.HtmlDecode          = true;
            extractionRule33.Required            = true;
            extractionRule33.Index = 0;
            extractionRule33.ContextParameterName = "CategoryListWebPartGuid";
            request1.ExtractValues += new EventHandler <ExtractionEventArgs>(extractionRule33.Extract);

            //Extract CategoryList WebPart guid
            ExtractAttributeValue extractionRule43 = new ExtractAttributeValue();

            extractionRule43.TagName             = "div";
            extractionRule43.AttributeName       = "WebPartID";
            extractionRule43.MatchAttributeName  = "id";
            extractionRule43.MatchAttributeValue = "WebPartWPQ5";
            extractionRule43.HtmlDecode          = true;
            extractionRule43.Required            = true;
            extractionRule43.Index = 0;
            extractionRule43.ContextParameterName = "ProductListWebPartGuid";
            request1.ExtractValues += new EventHandler <ExtractionEventArgs>(extractionRule43.Extract);
            //Check for Root Category
            ValidationRuleFindText validationRule11 = new ValidationRuleFindText();

            validationRule11.FindText             = "Root Category";
            validationRule11.IgnoreCase           = true;
            validationRule11.UseRegularExpression = false;
            validationRule11.PassIfTextFound      = true;
            request1.ValidateResponse            += new EventHandler <ValidationEventArgs>(validationRule11.Validate);

            //Check for Category Details Webpart title
            ValidationRuleFindText validationRule12 = new ValidationRuleFindText();

            validationRule12.FindText             = "Category Details";
            validationRule12.IgnoreCase           = true;
            validationRule12.UseRegularExpression = false;
            validationRule12.PassIfTextFound      = true;
            request1.ValidateResponse            += new EventHandler <ValidationEventArgs>(validationRule12.Validate);

            //Check for Category List Webpart title
            ValidationRuleFindText validationRule13 = new ValidationRuleFindText();

            validationRule13.FindText             = "Category List";
            validationRule13.IgnoreCase           = true;
            validationRule13.UseRegularExpression = false;
            validationRule13.PassIfTextFound      = true;
            request1.ValidateResponse            += new EventHandler <ValidationEventArgs>(validationRule13.Validate);

            //Check for Product List Webpart title
            ValidationRuleFindText validationRule14 = new ValidationRuleFindText();

            validationRule14.FindText             = "Product List";
            validationRule14.IgnoreCase           = true;
            validationRule14.UseRegularExpression = false;
            validationRule14.PassIfTextFound      = true;
            request1.ValidateResponse            += new EventHandler <ValidationEventArgs>(validationRule14.Validate);

            yield return(request1);

            string CategoryDetailWebPartGuid = Context["CategoryDetailWebPartGuid"].ToString();
            string CategoryListWebPartGuid   = Context["CategoryListWebPartGuid"].ToString();
            string ProductListWebPartGuid    = Context["ProductListWebPartGuid"].ToString();


            request1 = null;

            WebTestRequest request2 = new WebTestRequest(hostURL + "/sites/productcatalog/category.aspx");

            request2.Method = "POST";
            request2.QueryStringParameters.Add("categoryid", "0", false, false);
            FormPostHttpBody request2Body = new FormPostHttpBody();

            request2Body.FormPostParameters.Add("MSO_PageHashCode", this.Context["$HIDDEN1.MSO_PageHashCode"].ToString());
            // request2Body.FormPostParameters.Add("__SPSCEditMenu", this.Context["$HIDDEN1.__SPSCEditMenu"].ToString());
            //request2Body.FormPostParameters.Add("MSOWebPartPage_PostbackSource", this.Context["$HIDDEN1.MSOWebPartPage_PostbackSource"].ToString());
            request2Body.FormPostParameters.Add("MSOTlPn_SelectedWpId", this.Context["$HIDDEN1.MSOTlPn_SelectedWpId"].ToString());
            request2Body.FormPostParameters.Add("MSOTlPn_View", this.Context["$HIDDEN1.MSOTlPn_View"].ToString());
            request2Body.FormPostParameters.Add("MSOTlPn_ShowSettings", this.Context["$HIDDEN1.MSOTlPn_ShowSettings"].ToString());
            request2Body.FormPostParameters.Add("MSOGallery_SelectedLibrary", this.Context["$HIDDEN1.MSOGallery_SelectedLibrary"].ToString());
            request2Body.FormPostParameters.Add("MSOGallery_FilterString", this.Context["$HIDDEN1.MSOGallery_FilterString"].ToString());
            request2Body.FormPostParameters.Add("MSOTlPn_Button", this.Context["$HIDDEN1.MSOTlPn_Button"].ToString());
            request2Body.FormPostParameters.Add("__EVENTTARGET", this.Context["$HIDDEN1.__EVENTTARGET"].ToString());
            request2Body.FormPostParameters.Add("__EVENTARGUMENT", this.Context["$HIDDEN1.__EVENTARGUMENT"].ToString());
            request2Body.FormPostParameters.Add("__REQUESTDIGEST", this.Context["$HIDDEN1.__REQUESTDIGEST"].ToString());
            //request2Body.FormPostParameters.Add("MSOAuthoringConsole_FormContext", this.Context["$HIDDEN1.MSOAuthoringConsole_FormContext"].ToString());
            //request2Body.FormPostParameters.Add("MSOAC_EditDuringWorkflow", this.Context["$HIDDEN1.MSOAC_EditDuringWorkflow"].ToString());
            request2Body.FormPostParameters.Add("MSOSPWebPartManager_DisplayModeName", this.Context["$HIDDEN1.MSOSPWebPartManager_DisplayModeName"].ToString());
            request2Body.FormPostParameters.Add("MSOWebPartPage_Shared", this.Context["$HIDDEN1.MSOWebPartPage_Shared"].ToString());
            request2Body.FormPostParameters.Add("MSOLayout_LayoutChanges", this.Context["$HIDDEN1.MSOLayout_LayoutChanges"].ToString());
            request2Body.FormPostParameters.Add("MSOLayout_InDesignMode", this.Context["$HIDDEN1.MSOLayout_InDesignMode"].ToString());
            request2Body.FormPostParameters.Add("MSOSPWebPartManager_OldDisplayModeName", this.Context["$HIDDEN1.MSOSPWebPartManager_OldDisplayModeName"].ToString());
            request2Body.FormPostParameters.Add("MSOSPWebPartManager_StartWebPartEditingName", this.Context["$HIDDEN1.MSOSPWebPartManager_StartWebPartEditingName"].ToString());
            request2Body.FormPostParameters.Add("BDC_ActionsMenuProxyPageWebUrl", this.Context["$HIDDEN1.BDC_ActionsMenuProxyPageWebUrl"].ToString());
            request2Body.FormPostParameters.Add("__VIEWSTATE", this.Context["$HIDDEN1.__VIEWSTATE"].ToString());
            request2Body.FormPostParameters.Add("__spDummyText1", "");
            request2Body.FormPostParameters.Add("__spDummyText2", "");
            request2Body.FormPostParameters.Add("__CALLBACKID", "ctl00$m$g_" + CategoryDetailWebPartGuid.Replace("-", "_").ToString());
            request2Body.FormPostParameters.Add("__CALLBACKPARAM", "GetLongRunningUI");
            request2Body.FormPostParameters.Add("__EVENTVALIDATION", this.Context["$HIDDEN1.__EVENTVALIDATION"].ToString());
            request2.Body = request2Body;

            //Check for CategoryId
            ValidationRuleFindText validationRule21 = new ValidationRuleFindText();

            validationRule21.FindText             = @"<nobr>CategoryId:</nobr></td><td class=""ms-descriptiontext ms-alignleft"" width=""100%"">0</td>";
            validationRule21.IgnoreCase           = true;
            validationRule21.UseRegularExpression = false;
            validationRule21.PassIfTextFound      = true;
            request2.ValidateResponse            += new EventHandler <ValidationEventArgs>(validationRule21.Validate);

            //Check for CategoryName
            ValidationRuleFindText validationRule22 = new ValidationRuleFindText();

            validationRule22.FindText             = @"<nobr>Name:</nobr></td><td class=""ms-descriptiontext ms-alignleft"" width=""100%"">Root Category</td>";
            validationRule22.IgnoreCase           = true;
            validationRule22.UseRegularExpression = false;
            validationRule22.PassIfTextFound      = true;
            request2.ValidateResponse            += new EventHandler <ValidationEventArgs>(validationRule22.Validate);
            yield return(request2);

            request2 = null;

            WebTestRequest request3 = new WebTestRequest(hostURL + "/sites/productcatalog/category.aspx");

            request3.Method = "POST";
            request3.QueryStringParameters.Add("categoryid", "0", false, false);
            FormPostHttpBody request3Body = new FormPostHttpBody();

            request3Body.FormPostParameters.Add("MSO_PageHashCode", this.Context["$HIDDEN2.MSO_PageHashCode"].ToString());
            //request3Body.FormPostParameters.Add("__SPSCEditMenu", this.Context["$HIDDEN2.__SPSCEditMenu"].ToString());
            //request3Body.FormPostParameters.Add("MSOWebPartPage_PostbackSource", this.Context["$HIDDEN2.MSOWebPartPage_PostbackSource"].ToString());
            request3Body.FormPostParameters.Add("MSOTlPn_SelectedWpId", this.Context["$HIDDEN2.MSOTlPn_SelectedWpId"].ToString());
            request3Body.FormPostParameters.Add("MSOTlPn_View", this.Context["$HIDDEN2.MSOTlPn_View"].ToString());
            request3Body.FormPostParameters.Add("MSOTlPn_ShowSettings", this.Context["$HIDDEN2.MSOTlPn_ShowSettings"].ToString());
            request3Body.FormPostParameters.Add("MSOGallery_SelectedLibrary", this.Context["$HIDDEN2.MSOGallery_SelectedLibrary"].ToString());
            request3Body.FormPostParameters.Add("MSOGallery_FilterString", this.Context["$HIDDEN2.MSOGallery_FilterString"].ToString());
            request3Body.FormPostParameters.Add("MSOTlPn_Button", this.Context["$HIDDEN2.MSOTlPn_Button"].ToString());
            request3Body.FormPostParameters.Add("__EVENTTARGET", this.Context["$HIDDEN2.__EVENTTARGET"].ToString());
            request3Body.FormPostParameters.Add("__EVENTARGUMENT", this.Context["$HIDDEN2.__EVENTARGUMENT"].ToString());
            request3Body.FormPostParameters.Add("__REQUESTDIGEST", this.Context["$HIDDEN2.__REQUESTDIGEST"].ToString());
            //request3Body.FormPostParameters.Add("MSOAuthoringConsole_FormContext", this.Context["$HIDDEN2.MSOAuthoringConsole_FormContext"].ToString());
            //request3Body.FormPostParameters.Add("MSOAC_EditDuringWorkflow", this.Context["$HIDDEN2.MSOAC_EditDuringWorkflow"].ToString());
            request3Body.FormPostParameters.Add("MSOSPWebPartManager_DisplayModeName", this.Context["$HIDDEN2.MSOSPWebPartManager_DisplayModeName"].ToString());
            request3Body.FormPostParameters.Add("MSOWebPartPage_Shared", this.Context["$HIDDEN2.MSOWebPartPage_Shared"].ToString());
            request3Body.FormPostParameters.Add("MSOLayout_LayoutChanges", this.Context["$HIDDEN2.MSOLayout_LayoutChanges"].ToString());
            request3Body.FormPostParameters.Add("MSOLayout_InDesignMode", this.Context["$HIDDEN2.MSOLayout_InDesignMode"].ToString());
            request3Body.FormPostParameters.Add("MSOSPWebPartManager_OldDisplayModeName", this.Context["$HIDDEN2.MSOSPWebPartManager_OldDisplayModeName"].ToString());
            request3Body.FormPostParameters.Add("MSOSPWebPartManager_StartWebPartEditingName", this.Context["$HIDDEN2.MSOSPWebPartManager_StartWebPartEditingName"].ToString());
            request3Body.FormPostParameters.Add("BDC_ActionsMenuProxyPageWebUrl", this.Context["$HIDDEN2.BDC_ActionsMenuProxyPageWebUrl"].ToString());
            request3Body.FormPostParameters.Add("__VIEWSTATE", this.Context["$HIDDEN2.__VIEWSTATE"].ToString());
            request3Body.FormPostParameters.Add("__spDummyText1", "");
            request3Body.FormPostParameters.Add("__spDummyText2", "");
            request3Body.FormPostParameters.Add("__CALLBACKID", "ctl00$m$g_" + CategoryListWebPartGuid.Replace("-", "_").ToString());
            request3Body.FormPostParameters.Add("__CALLBACKPARAM", "GetLongRunningUI");
            request3Body.FormPostParameters.Add("__EVENTVALIDATION", this.Context["$HIDDEN2.__EVENTVALIDATION"].ToString());

            request3.Body = request3Body;
            ValidationRuleFindText validationRule31 = new ValidationRuleFindText();

            validationRule31.FindText = @"<a onclick=""event.cancelBubble=true"" href=""" + hostURL + "/sites/productcatalog/_layouts/ProfileRedirect.aspx?Application=ContosoProductCatalogService&amp;Entity=Category&amp;ItemId=__bk40003300\" onkeydown=\"actionMenuOnKeyDown('Loading...','Physician Equipment',false,'ContosoProductCatalogService','Category','__bk40003300');\">Physician Equipment<img src=\"/_layouts/images/blank.gif\" border=\"0\" alt=\"\"></a>";
            //validationRule31.FindText = @"<a onclick=""event.cancelBubble=true"" onkeydown=""actionMenuOnKeyDown('Loading...','Dental Equipment',false,'ContosoProductCatalogService','Category','__bk40001300');"">Dental Equipment<img src=""/_layouts/images/blank.gif"" border=""0"" alt=""""></a>";
            validationRule31.IgnoreCase           = true;
            validationRule31.UseRegularExpression = false;
            validationRule31.PassIfTextFound      = true;
            request3.ValidateResponse            += new EventHandler <ValidationEventArgs>(validationRule31.Validate);

            yield return(request3);

            request3 = null;

            WebTestRequest request4 = new WebTestRequest(hostURL + "/sites/productcatalog/category.aspx");

            request4.Method = "POST";
            request4.QueryStringParameters.Add("categoryid", "0", false, false);
            FormPostHttpBody request4Body = new FormPostHttpBody();

            request4Body.FormPostParameters.Add("MSO_PageHashCode", this.Context["$HIDDEN3.MSO_PageHashCode"].ToString());
            //request4Body.FormPostParameters.Add("__SPSCEditMenu", this.Context["$HIDDEN3.__SPSCEditMenu"].ToString());
            //request4Body.FormPostParameters.Add("MSOWebPartPage_PostbackSource", this.Context["$HIDDEN3.MSOWebPartPage_PostbackSource"].ToString());
            request4Body.FormPostParameters.Add("MSOTlPn_SelectedWpId", this.Context["$HIDDEN3.MSOTlPn_SelectedWpId"].ToString());
            request4Body.FormPostParameters.Add("MSOTlPn_View", this.Context["$HIDDEN3.MSOTlPn_View"].ToString());
            request4Body.FormPostParameters.Add("MSOTlPn_ShowSettings", this.Context["$HIDDEN3.MSOTlPn_ShowSettings"].ToString());
            request4Body.FormPostParameters.Add("MSOGallery_SelectedLibrary", this.Context["$HIDDEN3.MSOGallery_SelectedLibrary"].ToString());
            request4Body.FormPostParameters.Add("MSOGallery_FilterString", this.Context["$HIDDEN3.MSOGallery_FilterString"].ToString());
            request4Body.FormPostParameters.Add("MSOTlPn_Button", this.Context["$HIDDEN3.MSOTlPn_Button"].ToString());
            request4Body.FormPostParameters.Add("__EVENTTARGET", this.Context["$HIDDEN3.__EVENTTARGET"].ToString());
            request4Body.FormPostParameters.Add("__EVENTARGUMENT", this.Context["$HIDDEN3.__EVENTARGUMENT"].ToString());
            request4Body.FormPostParameters.Add("__REQUESTDIGEST", this.Context["$HIDDEN3.__REQUESTDIGEST"].ToString());
            //request4Body.FormPostParameters.Add("MSOAuthoringConsole_FormContext", this.Context["$HIDDEN3.MSOAuthoringConsole_FormContext"].ToString());
            //request4Body.FormPostParameters.Add("MSOAC_EditDuringWorkflow", this.Context["$HIDDEN3.MSOAC_EditDuringWorkflow"].ToString());
            request4Body.FormPostParameters.Add("MSOSPWebPartManager_DisplayModeName", this.Context["$HIDDEN3.MSOSPWebPartManager_DisplayModeName"].ToString());
            request4Body.FormPostParameters.Add("MSOWebPartPage_Shared", this.Context["$HIDDEN3.MSOWebPartPage_Shared"].ToString());
            request4Body.FormPostParameters.Add("MSOLayout_LayoutChanges", this.Context["$HIDDEN3.MSOLayout_LayoutChanges"].ToString());
            request4Body.FormPostParameters.Add("MSOLayout_InDesignMode", this.Context["$HIDDEN3.MSOLayout_InDesignMode"].ToString());
            request4Body.FormPostParameters.Add("MSOSPWebPartManager_OldDisplayModeName", this.Context["$HIDDEN3.MSOSPWebPartManager_OldDisplayModeName"].ToString());
            request4Body.FormPostParameters.Add("MSOSPWebPartManager_StartWebPartEditingName", this.Context["$HIDDEN3.MSOSPWebPartManager_StartWebPartEditingName"].ToString());
            request4Body.FormPostParameters.Add("BDC_ActionsMenuProxyPageWebUrl", this.Context["$HIDDEN3.BDC_ActionsMenuProxyPageWebUrl"].ToString());
            request4Body.FormPostParameters.Add("__VIEWSTATE", this.Context["$HIDDEN3.__VIEWSTATE"].ToString());
            request4Body.FormPostParameters.Add("__spDummyText1", "");
            request4Body.FormPostParameters.Add("__spDummyText2", "");
            request4Body.FormPostParameters.Add("__CALLBACKID", "ctl00$m$g_" + ProductListWebPartGuid.Replace("-", "_").ToString());
            request4Body.FormPostParameters.Add("__CALLBACKPARAM", "GetLongRunningUI");
            request4Body.FormPostParameters.Add("__EVENTVALIDATION", this.Context["$HIDDEN3.__EVENTVALIDATION"].ToString());
            request4.Body = request4Body;

            //check for There are no items to show.
            ValidationRuleFindText validationRule41 = new ValidationRuleFindText();

            validationRule41.FindText             = "There are no items to show.";
            validationRule41.IgnoreCase           = true;
            validationRule41.UseRegularExpression = false;
            validationRule41.PassIfTextFound      = true;
            request4.ValidateResponse            += new EventHandler <ValidationEventArgs>(validationRule41.Validate);

            yield return(request4);

            request4 = null;
        }
コード例 #2
0
ファイル: OrderCreationTestCoded.cs プロジェクト: evkap/DVS
        public override IEnumerator<WebTestRequest> GetRequestEnumerator() {
            // Initialize validation rules that apply to all requests in the WebTest
            if ((this.Context.ValidationLevel >= Microsoft.VisualStudio.TestTools.WebTesting.ValidationLevel.Low)) {
                ValidationRuleResponseTimeGoal validationRule1 = new ValidationRuleResponseTimeGoal();
                validationRule1.Tolerance = 0D;
                this.ValidateResponseOnPageComplete += new EventHandler<ValidationEventArgs>(validationRule1.Validate);
            }
            this.PreRequestDataBinding += new EventHandler<PreRequestDataBindingEventArgs>(this.testPlugin0.PreRequestDataBinding);
            this.PreRequest += new EventHandler<PreRequestEventArgs>(this.testPlugin0.PreRequest);
            this.PostRequest += new EventHandler<PostRequestEventArgs>(this.testPlugin0.PostRequest);

            WebTestRequest request1 = new WebTestRequest((this.Context["WebServer"].ToString() + "/"));
            WebTestRequest request1Dependent1 = new WebTestRequest((this.Context["WebServer"].ToString() + "/Content/Bootstrap/less/bootstrap.less"));
            request1.DependentRequests.Add(request1Dependent1);
            WebTestRequest request1Dependent2 = new WebTestRequest((this.Context["WebServer"].ToString() + "/Content/Themes/Default/Fonts/Open-Sans.woff"));
            request1.DependentRequests.Add(request1Dependent2);
            WebTestRequest request1Dependent3 = new WebTestRequest((this.Context["WebServer"].ToString() + "/Content/Themes/Default/Fonts/Open-Sans-Italic.woff"));
            request1.DependentRequests.Add(request1Dependent3);
            WebTestRequest request1Dependent4 = new WebTestRequest((this.Context["WebServer"].ToString() + "/Content/Themes/Default/Fonts/Open-Sans-Bold.woff"));
            request1Dependent4.ThinkTime = 1;
            request1.DependentRequests.Add(request1Dependent4);
            WebTestRequest request1Dependent5 = new WebTestRequest((this.Context["WebServer"].ToString() + "/Content/Themes/Default/Fonts/Maven-Pro.woff"));
            request1.DependentRequests.Add(request1Dependent5);
            ExtractHiddenFields extractionRule1 = new ExtractHiddenFields();
            extractionRule1.Required = true;
            extractionRule1.HtmlDecode = true;
            extractionRule1.ContextParameterName = "1";
            request1.ExtractValues += new EventHandler<ExtractionEventArgs>(extractionRule1.Extract);
            yield return request1;
            request1 = null;

            WebTestRequest request2 = new WebTestRequest((this.Context["WebServer"].ToString() + "/Home/Login"));
            request2.Method = "POST";
            request2.ExpectedResponseUrl = (this.Context["WebServer"].ToString() + "/ClientUserManagement/ClientUserHome");
            FormPostHttpBody request2Body = new FormPostHttpBody();
            request2Body.FormPostParameters.Add("__RequestVerificationToken", this.Context["$HIDDEN1.__RequestVerificationToken"].ToString());
            request2Body.FormPostParameters.Add("Email", "*****@*****.**");
            request2Body.FormPostParameters.Add("Password", "asd123!");
            request2Body.FormPostParameters.Add("RememberUser", this.Context["$HIDDEN1.RememberUser"].ToString());
            request2.Body = request2Body;
            WebTestRequest request2Dependent1 = new WebTestRequest((this.Context["WebServer"].ToString() + "/Content/Themes/Default/Fonts/Open-Sans.woff"));
            request2.DependentRequests.Add(request2Dependent1);
            WebTestRequest request2Dependent2 = new WebTestRequest((this.Context["WebServer"].ToString() + "/Content/Themes/Default/Fonts/Open-Sans-Italic.woff"));
            request2.DependentRequests.Add(request2Dependent2);
            WebTestRequest request2Dependent3 = new WebTestRequest((this.Context["WebServer"].ToString() + "/Content/Themes/Default/Fonts/Open-Sans-Bold.woff"));
            request2.DependentRequests.Add(request2Dependent3);
            WebTestRequest request2Dependent4 = new WebTestRequest((this.Context["WebServer"].ToString() + "/Content/Themes/Default/Fonts/Maven-Pro.woff"));
            request2.DependentRequests.Add(request2Dependent4);
            yield return request2;
            request2 = null;

            WebTestRequest request3 = new WebTestRequest((this.Context["WebServer"].ToString() + "/Dashboard/NewOrders"));
            WebTestRequest request3Dependent1 = new WebTestRequest((this.Context["WebServer"].ToString() + "/Content/Themes/Default/Fonts/Open-Sans.woff"));
            request3.DependentRequests.Add(request3Dependent1);
            WebTestRequest request3Dependent2 = new WebTestRequest((this.Context["WebServer"].ToString() + "/Content/Themes/Default/Fonts/Open-Sans-Italic.woff"));
            request3.DependentRequests.Add(request3Dependent2);
            WebTestRequest request3Dependent3 = new WebTestRequest((this.Context["WebServer"].ToString() + "/Content/Themes/Default/Fonts/Open-Sans-Bold.woff"));
            request3.DependentRequests.Add(request3Dependent3);
            WebTestRequest request3Dependent4 = new WebTestRequest((this.Context["WebServer"].ToString() + "/Content/Themes/Default/Fonts/Maven-Pro.woff"));
            request3.DependentRequests.Add(request3Dependent4);
            ExtractText extractionRule2 = new ExtractText();
            extractionRule2.StartsWith = "s: [\"";
            extractionRule2.EndsWith = "\"],\r\n";
            extractionRule2.Index = 0;
            extractionRule2.IgnoreCase = false;
            extractionRule2.UseRegularExpression = false;
            extractionRule2.HtmlDecode = true;
            extractionRule2.Required = false;
            extractionRule2.ContextParameterName = "FormPostParam71.id";
            request3.ExtractValues += new EventHandler<ExtractionEventArgs>(extractionRule2.Extract);
            yield return request3;
            request3 = null;

            WebTestRequest request4 = new WebTestRequest((this.Context["WebServer"].ToString() + "/OrderManagement/OrderCreationWizard/GeneralInfo"));
            WebTestRequest request4Dependent1 = new WebTestRequest((this.Context["WebServer"].ToString() + "/Content/Bootstrap/less/bootstrap.less"));
            request4.DependentRequests.Add(request4Dependent1);
            WebTestRequest request4Dependent2 = new WebTestRequest((this.Context["WebServer"].ToString() + "/Content/Themes/Default/Fonts/Open-Sans.woff"));
            request4.DependentRequests.Add(request4Dependent2);
            WebTestRequest request4Dependent3 = new WebTestRequest((this.Context["WebServer"].ToString() + "/Content/Themes/Default/Fonts/Open-Sans-Italic.woff"));
            request4.DependentRequests.Add(request4Dependent3);
            WebTestRequest request4Dependent4 = new WebTestRequest((this.Context["WebServer"].ToString() + "/Content/Themes/Default/Fonts/Open-Sans-Bold.woff"));
            request4.DependentRequests.Add(request4Dependent4);
            WebTestRequest request4Dependent5 = new WebTestRequest((this.Context["WebServer"].ToString() + "/Content/Themes/Default/Fonts/Maven-Pro.woff"));
            request4.DependentRequests.Add(request4Dependent5);
            ExtractHiddenFields extractionRule3 = new ExtractHiddenFields();
            extractionRule3.Required = true;
            extractionRule3.HtmlDecode = true;
            extractionRule3.ContextParameterName = "1";
            request4.ExtractValues += new EventHandler<ExtractionEventArgs>(extractionRule3.Extract);
            ExtractText extractionRule4 = new ExtractText();
            extractionRule4.StartsWith = "s: [\"";
            extractionRule4.EndsWith = "\"],\r\n";
            extractionRule4.Index = 0;
            extractionRule4.IgnoreCase = false;
            extractionRule4.UseRegularExpression = false;
            extractionRule4.HtmlDecode = true;
            extractionRule4.Required = false;
            extractionRule4.ContextParameterName = "FormPostParam73.id";
            request4.ExtractValues += new EventHandler<ExtractionEventArgs>(extractionRule4.Extract);
            yield return request4;
            request4 = null;

            WebTestRequest request5 = new WebTestRequest((this.Context["WebServer"].ToString() + "/OrderManagement/OrderCreationWizard/GeneralInfo"));
            request5.ThinkTime = 5;
            request5.Method = "POST";
            request5.ExpectedResponseUrl = (this.Context["WebServer"].ToString() 
                        + ("/OrderManagement/OrderCreationWizard/AppraisalInfo/" + this.Context["$HIDDEN1.OrderId"].ToString()));
            FormPostHttpBody request5Body = new FormPostHttpBody();
            request5Body.FormPostParameters.Add("__RequestVerificationToken", this.Context["$HIDDEN1.__RequestVerificationToken"].ToString());
            request5Body.FormPostParameters.Add("OrderId", this.Context["$HIDDEN1.OrderId"].ToString());
            request5Body.FormPostParameters.Add("LoanNumber", this.Context["LoanNumber"].ToString());
            request5Body.FormPostParameters.Add("BorrowerFirstName", this.Context["FirstNames.AppraiserFirstNames#csv.FirstName"].ToString());
            request5Body.FormPostParameters.Add("BorrowerLastName", this.Context["LastNames.AppraiserLastNames#csv.LastName"].ToString());
            request5Body.FormPostParameters.Add("Address.Street", this.Context["Addresses.Address.StreetAddress"].ToString());
            request5Body.FormPostParameters.Add("Address.Street2", this.Context["Addresses.Address.StreetAddress2"].ToString());
            request5Body.FormPostParameters.Add("Address.City", this.Context["Addresses.Address.City"].ToString());
            request5Body.FormPostParameters.Add("Address.State", this.Context["Addresses.Address.State"].ToString());
            request5Body.FormPostParameters.Add("Address.ZIP", this.Context["Addresses.Address.Zip"].ToString());
            request5Body.FormPostParameters.Add("Address.County", this.Context["Addresses.Address.County"].ToString());
            request5Body.FormPostParameters.Add("nextStep", "1");
            request5Body.FormPostParameters.Add("area", "OrderManagement");
            request5.Body = request5Body;
            WebTestRequest request5Dependent1 = new WebTestRequest((this.Context["WebServer"].ToString() + "/Content/Bootstrap/less/bootstrap.less"));
            request5.DependentRequests.Add(request5Dependent1);
            WebTestRequest request5Dependent2 = new WebTestRequest((this.Context["WebServer"].ToString() + "/Content/Themes/Default/Fonts/Open-Sans.woff"));
            request5.DependentRequests.Add(request5Dependent2);
            WebTestRequest request5Dependent3 = new WebTestRequest((this.Context["WebServer"].ToString() + "/Content/Themes/Default/Fonts/Open-Sans-Italic.woff"));
            request5.DependentRequests.Add(request5Dependent3);
            WebTestRequest request5Dependent4 = new WebTestRequest((this.Context["WebServer"].ToString() + "/Content/Themes/Default/Fonts/Open-Sans-Bold.woff"));
            request5.DependentRequests.Add(request5Dependent4);
            WebTestRequest request5Dependent5 = new WebTestRequest((this.Context["WebServer"].ToString() + "/Content/Themes/Default/Fonts/Maven-Pro.woff"));
            request5.DependentRequests.Add(request5Dependent5);
            ExtractAttributeValue extractionRule5 = new ExtractAttributeValue();
            extractionRule5.TagName = "input";
            extractionRule5.AttributeName = "value";
            extractionRule5.MatchAttributeName = "id";
            extractionRule5.MatchAttributeValue = "OrderId";
            extractionRule5.HtmlDecode = true;
            extractionRule5.Required = true;
            extractionRule5.Index = 0;
            extractionRule5.ContextParameterName = "OrderId";
            request5.ExtractValues += new EventHandler<ExtractionEventArgs>(extractionRule5.Extract);
            ExtractHiddenFields extractionRule6 = new ExtractHiddenFields();
            extractionRule6.Required = true;
            extractionRule6.HtmlDecode = true;
            extractionRule6.ContextParameterName = "1";
            request5.ExtractValues += new EventHandler<ExtractionEventArgs>(extractionRule6.Extract);
            yield return request5;
            request5 = null;

            WebTestRequest request6 = new WebTestRequest((this.Context["WebServer"].ToString() 
                            + ("/OrderManagement/OrderCreationWizard/AppraisalInfo/" + this.Context["OrderId"].ToString())));
            request6.ThinkTime = 5;
            request6.Method = "POST";
            request6.ExpectedResponseUrl = (this.Context["WebServer"].ToString() 
                        + ("/OrderManagement/OrderCreationWizard/LoanAndContactInfo/" + this.Context["OrderId"].ToString()));
            FormPostHttpBody request6Body = new FormPostHttpBody();
            request6Body.FormPostParameters.Add("__RequestVerificationToken", this.Context["$HIDDEN1.__RequestVerificationToken"].ToString());
            request6Body.FormPostParameters.Add("OrderId", this.Context["$HIDDEN1.OrderId"].ToString());
            request6Body.FormPostParameters.Add("OrderId", this.Context["$HIDDEN1.OrderId"].ToString());
            request6Body.FormPostParameters.Add("LoanType", "Conventional");
            request6Body.FormPostParameters.Add("PropertyType", "1");
            request6Body.FormPostParameters.Add("Occupancy", "1");
            request6Body.FormPostParameters.Add("FHACaseNumber", "");
            request6Body.FormPostParameters.Add("NumberUnits", "");
            request6Body.FormPostParameters.Add("AppraisalType", "Appraisal");
            request6Body.FormPostParameters.Add("IsRush", "true");
            request6Body.FormPostParameters.Add("IsRush", this.Context["$HIDDEN1.IsRush"].ToString());
            request6Body.FormPostParameters.Add("IsSecondAppraisalOrDuplicateAppraisal", "true");
            request6Body.FormPostParameters.Add("IsSecondAppraisalOrDuplicateAppraisal", this.Context["$HIDDEN1.IsSecondAppraisalOrDuplicateAppraisal"].ToString());
            request6Body.FormPostParameters.Add("IsSupplementalREOAddendum", this.Context["$HIDDEN1.IsSupplementalREOAddendum"].ToString());
            request6Body.FormPostParameters.Add("AppraisalForm", this.Context["AppraiserForms.AppraiserForms#csv.1"].ToString());
            request6Body.FormPostParameters.Add("ReviewForm", "");
            request6Body.FormPostParameters.Add("FileId", this.Context["$HIDDEN1.FileId"].ToString());
            request6Body.FormPostParameters.Add("files[]", "");
            request6Body.FormPostParameters.Add("nextStep", "2");
            request6Body.FormPostParameters.Add("area", "OrderManagement");
            request6.Body = request6Body;
            WebTestRequest request6Dependent1 = new WebTestRequest((this.Context["WebServer"].ToString() + "/Content/Bootstrap/less/bootstrap.less"));
            request6.DependentRequests.Add(request6Dependent1);
            WebTestRequest request6Dependent2 = new WebTestRequest((this.Context["WebServer"].ToString() + "/Content/Themes/Default/Fonts/Open-Sans.woff"));
            request6.DependentRequests.Add(request6Dependent2);
            WebTestRequest request6Dependent3 = new WebTestRequest((this.Context["WebServer"].ToString() + "/Content/Themes/Default/Fonts/Open-Sans-Italic.woff"));
            request6.DependentRequests.Add(request6Dependent3);
            WebTestRequest request6Dependent4 = new WebTestRequest((this.Context["WebServer"].ToString() + "/Content/Themes/Default/Fonts/Open-Sans-Bold.woff"));
            request6.DependentRequests.Add(request6Dependent4);
            WebTestRequest request6Dependent5 = new WebTestRequest((this.Context["WebServer"].ToString() + "/Content/Themes/Default/Fonts/Maven-Pro.woff"));
            request6.DependentRequests.Add(request6Dependent5);
            ExtractHiddenFields extractionRule7 = new ExtractHiddenFields();
            extractionRule7.Required = true;
            extractionRule7.HtmlDecode = true;
            extractionRule7.ContextParameterName = "1";
            request6.ExtractValues += new EventHandler<ExtractionEventArgs>(extractionRule7.Extract);
            yield return request6;
            request6 = null;

            WebTestRequest request7 = new WebTestRequest((this.Context["WebServer"].ToString() + "/OrderManagement/OrderCreationWizard/ContactAdd"));
            request7.ThinkTime = 5;
            request7.Method = "POST";
            FormPostHttpBody request7Body = new FormPostHttpBody();
            request7Body.FormPostParameters.Add("__RequestVerificationToken", this.Context["$HIDDEN1.__RequestVerificationToken"].ToString());
            request7Body.FormPostParameters.Add("LoanPurpose", "2");
            request7Body.FormPostParameters.Add("PurchasePrice", "");
            request7Body.FormPostParameters.Add("ContactFileId", this.Context["$HIDDEN1.ContactFileId"].ToString());
            request7Body.FormPostParameters.Add("GFEDate", "12/28/2012");
            request7Body.FormPostParameters.Add("GFEAmount", "587.00");
            request7Body.FormPostParameters.Add("Instructions", "1");
            request7Body.FormPostParameters.Add("Instructions", "2");
            request7Body.FormPostParameters.Add("OrderId", this.Context["$HIDDEN1.OrderId"].ToString());
            request7.Body = request7Body;
            ExtractText extractionRule8 = new ExtractText();
            extractionRule8.StartsWith = "lue=\"";
            extractionRule8.EndsWith = "\" />\r";
            extractionRule8.Index = 1;
            extractionRule8.IgnoreCase = false;
            extractionRule8.UseRegularExpression = false;
            extractionRule8.HtmlDecode = true;
            extractionRule8.Required = false;
            extractionRule8.ContextParameterName = "FormPostParam97.ListOfContact[0].Id";
            request7.ExtractValues += new EventHandler<ExtractionEventArgs>(extractionRule8.Extract);
            yield return request7;
            request7 = null;

            WebTestRequest request8 = new WebTestRequest((this.Context["WebServer"].ToString() 
                            + ("/OrderManagement/OrderCreationWizard/LoanAndContactInfo/" + this.Context["OrderId"].ToString())));
            request8.ThinkTime = 5;
            request8.Method = "POST";
            request8.ExpectedResponseUrl = (this.Context["WebServer"].ToString() 
                        + ("/OrderManagement/OrderCreationWizard/OrderConfirmation/" + this.Context["OrderId"].ToString()));
            FormPostHttpBody request8Body = new FormPostHttpBody();
            request8Body.FormPostParameters.Add("__RequestVerificationToken", this.Context["$HIDDEN1.__RequestVerificationToken"].ToString());
            request8Body.FormPostParameters.Add("LoanPurpose", "2");
            request8Body.FormPostParameters.Add("PurchasePrice", "");
            request8Body.FormPostParameters.Add("ContactFileId", this.Context["$HIDDEN1.ContactFileId"].ToString());
            request8Body.FormPostParameters.Add("files[]", "");
            request8Body.FormPostParameters.Add("GFEDate", "12/28/2012");
            request8Body.FormPostParameters.Add("GFEAmount", "587.00");
            request8Body.FormPostParameters.Add("Instructions", "1");
            request8Body.FormPostParameters.Add("Instructions", "2");
            request8Body.FormPostParameters.Add("OrderId", this.Context["$HIDDEN1.OrderId"].ToString());
            request8Body.FormPostParameters.Add("ListOfContact[0].Id", this.Context["FormPostParam97.ListOfContact[0].Id"].ToString());
            request8Body.FormPostParameters.Add("ListOfContact[0].ContactRole", "2");
            request8Body.FormPostParameters.Add("ListOfContact[0].Name", "agent");
            request8Body.FormPostParameters.Add("ListOfContact[0].Phone", "123-222-2222");
            request8Body.FormPostParameters.Add("ListOfContact[0].Email", "");
            request8Body.FormPostParameters.Add("ListOfContact[0].IsEditable", "True");
            request8Body.FormPostParameters.Add("nextStep", "3");
            request8Body.FormPostParameters.Add("area", "OrderManagement");
            request8.Body = request8Body;
            WebTestRequest request8Dependent1 = new WebTestRequest((this.Context["WebServer"].ToString() + "/Content/Bootstrap/less/bootstrap.less"));
            request8.DependentRequests.Add(request8Dependent1);
            WebTestRequest request8Dependent2 = new WebTestRequest((this.Context["WebServer"].ToString() + "/Content/Themes/Default/Fonts/Open-Sans.woff"));
            request8.DependentRequests.Add(request8Dependent2);
            WebTestRequest request8Dependent3 = new WebTestRequest((this.Context["WebServer"].ToString() + "/Content/Themes/Default/Fonts/Open-Sans-Italic.woff"));
            request8.DependentRequests.Add(request8Dependent3);
            WebTestRequest request8Dependent4 = new WebTestRequest((this.Context["WebServer"].ToString() + "/Content/Themes/Default/Fonts/Open-Sans-Bold.woff"));
            request8.DependentRequests.Add(request8Dependent4);
            WebTestRequest request8Dependent5 = new WebTestRequest((this.Context["WebServer"].ToString() + "/Content/Themes/Default/Fonts/Maven-Pro.woff"));
            request8.DependentRequests.Add(request8Dependent5);
            ExtractHiddenFields extractionRule9 = new ExtractHiddenFields();
            extractionRule9.Required = true;
            extractionRule9.HtmlDecode = true;
            extractionRule9.ContextParameterName = "1";
            request8.ExtractValues += new EventHandler<ExtractionEventArgs>(extractionRule9.Extract);
            yield return request8;
            request8 = null;

            WebTestRequest request9 = new WebTestRequest((this.Context["WebServer"].ToString() 
                            + ("/OrderManagement/OrderCreationWizard/OrderConfirmation/" + this.Context["OrderId"].ToString())));
            request9.ThinkTime = 5;
            request9.Method = "POST";
            request9.ExpectedResponseUrl = (this.Context["WebServer"].ToString() 
                        + ("/OrderManagement/OrderCreationWizard/FeeConfirmation/" + this.Context["OrderId"].ToString()));
            FormPostHttpBody request9Body = new FormPostHttpBody();
            request9Body.FormPostParameters.Add("__RequestVerificationToken", this.Context["$HIDDEN1.__RequestVerificationToken"].ToString());
            request9Body.FormPostParameters.Add("OrderId", this.Context["$HIDDEN1.OrderId"].ToString());
            request9Body.FormPostParameters.Add("AppraisalInfo.IsRush", this.Context["$HIDDEN1.AppraisalInfo.IsRush"].ToString());
            request9Body.FormPostParameters.Add("AppraisalInfo.IsSecondAppraisalOrDuplicateAppraisal", this.Context["$HIDDEN1.AppraisalInfo.IsSecondAppraisalOrDuplicateAppraisal"].ToString());
            request9Body.FormPostParameters.Add("AppraisalInfo.IsSupplementalREOAddendum", this.Context["$HIDDEN1.AppraisalInfo.IsSupplementalREOAddendum"].ToString());
            request9Body.FormPostParameters.Add("nextStep", "4");
            request9Body.FormPostParameters.Add("area", "OrderManagement");
            request9.Body = request9Body;
            WebTestRequest request9Dependent1 = new WebTestRequest((this.Context["WebServer"].ToString() + "/Content/Bootstrap/less/bootstrap.less"));
            request9.DependentRequests.Add(request9Dependent1);
            WebTestRequest request9Dependent2 = new WebTestRequest((this.Context["WebServer"].ToString() + "/Content/Themes/Default/Fonts/Open-Sans.woff"));
            request9.DependentRequests.Add(request9Dependent2);
            WebTestRequest request9Dependent3 = new WebTestRequest((this.Context["WebServer"].ToString() + "/Content/Themes/Default/Fonts/Open-Sans-Italic.woff"));
            request9.DependentRequests.Add(request9Dependent3);
            WebTestRequest request9Dependent4 = new WebTestRequest((this.Context["WebServer"].ToString() + "/Content/Themes/Default/Fonts/Open-Sans-Bold.woff"));
            request9.DependentRequests.Add(request9Dependent4);
            WebTestRequest request9Dependent5 = new WebTestRequest((this.Context["WebServer"].ToString() + "/Content/Themes/Default/Fonts/Maven-Pro.woff"));
            request9.DependentRequests.Add(request9Dependent5);
            ExtractHiddenFields extractionRule10 = new ExtractHiddenFields();
            extractionRule10.Required = true;
            extractionRule10.HtmlDecode = true;
            extractionRule10.ContextParameterName = "1";
            request9.ExtractValues += new EventHandler<ExtractionEventArgs>(extractionRule10.Extract);
            yield return request9;
            request9 = null;

            WebTestRequest request10 = new WebTestRequest((this.Context["WebServer"].ToString() 
                            + ("/OrderManagement/OrderCreationWizard/FeeConfirmation/" + this.Context["OrderId"].ToString())));
            request10.ThinkTime = 5;
            request10.ParseDependentRequests = false;
            request10.Method = "POST";
            request10.ExpectedResponseUrl = (this.Context["WebServer"].ToString() 
                        + ("/OrderManagement/OrderCreationWizard/ProcessCreditCard/" + this.Context["OrderId"].ToString()));
            FormPostHttpBody request10Body = new FormPostHttpBody();
            request10Body.FormPostParameters.Add("__RequestVerificationToken", this.Context["$HIDDEN1.__RequestVerificationToken"].ToString());
            request10Body.FormPostParameters.Add("OrderId", this.Context["$HIDDEN1.OrderId"].ToString());
            request10Body.FormPostParameters.Add("nextStep", "5");
            request10Body.FormPostParameters.Add("area", "OrderManagement");
            request10.Body = request10Body;
            WebTestRequest request10Dependent1 = new WebTestRequest((this.Context["WebServer"].ToString() + "/Content/Bootstrap/less/bootstrap.less"));
            request10.DependentRequests.Add(request10Dependent1);
            WebTestRequest request10Dependent2 = new WebTestRequest((this.Context["WebServer"].ToString() + "/Content/Themes/Default/Fonts/Open-Sans.woff"));
            request10.DependentRequests.Add(request10Dependent2);
            WebTestRequest request10Dependent3 = new WebTestRequest((this.Context["WebServer"].ToString() + "/Content/Themes/Default/Fonts/Open-Sans-Italic.woff"));
            request10.DependentRequests.Add(request10Dependent3);
            WebTestRequest request10Dependent4 = new WebTestRequest((this.Context["WebServer"].ToString() + "/Content/Themes/Default/Fonts/Open-Sans-Bold.woff"));
            request10.DependentRequests.Add(request10Dependent4);
            WebTestRequest request10Dependent5 = new WebTestRequest((this.Context["WebServer"].ToString() + "/Content/Themes/Default/Fonts/Maven-Pro.woff"));
            request10.DependentRequests.Add(request10Dependent5);
            ExtractHiddenFields extractionRule11 = new ExtractHiddenFields();
            extractionRule11.Required = true;
            extractionRule11.HtmlDecode = true;
            extractionRule11.ContextParameterName = "1";
            request10.ExtractValues += new EventHandler<ExtractionEventArgs>(extractionRule11.Extract);
            yield return request10;
            request10 = null;

            WebTestRequest request11 = new WebTestRequest((this.Context["WebServer"].ToString() + "/OrderManagement/OrderCreationWizard/SubmitPayment"));
            request11.ThinkTime = 15;
            request11.Method = "POST";
            FormPostHttpBody request11Body = new FormPostHttpBody();
            request11Body.FormPostParameters.Add("__RequestVerificationToken", this.Context["$HIDDEN1.__RequestVerificationToken"].ToString());
            request11Body.FormPostParameters.Add("OrderId", this.Context["$HIDDEN1.OrderId"].ToString());
            request11Body.FormPostParameters.Add("FirstName", "1231");
            request11Body.FormPostParameters.Add("LastName", "123123");
            request11Body.FormPostParameters.Add("BillingAddress.Street", this.Context["Addresses.Address.StreetAddress"].ToString());
            request11Body.FormPostParameters.Add("BillingAddress.City", this.Context["Addresses.Address.City"].ToString());
            request11Body.FormPostParameters.Add("BillingAddress.State", this.Context["Addresses.Address.State"].ToString());
            request11Body.FormPostParameters.Add("BillingAddress.ZIP", this.Context["Addresses.Address.Zip"].ToString());
            request11Body.FormPostParameters.Add("Phone", "");
            request11Body.FormPostParameters.Add("CreditCardNumber", "4242424242424242");
            request11Body.FormPostParameters.Add("ExpirationDate", "10/2015");
            request11Body.FormPostParameters.Add("CSCCode", "111");
            request11Body.FormPostParameters.Add("CreditCardType", "1");
            request11.Body = request11Body;
            yield return request11;
            request11 = null;

            WebTestRequest request12 = new WebTestRequest((this.Context["WebServer"].ToString() 
                            + ("/OrderManagement/OrderCreationWizard/RequestConfirmation/" + this.Context["OrderId"].ToString())));
            request12.ThinkTime = 5;
            request12.ParseDependentRequests = false;
            WebTestRequest request12Dependent1 = new WebTestRequest((this.Context["WebServer"].ToString() + "/Content/Bootstrap/less/bootstrap.less"));
            request12.DependentRequests.Add(request12Dependent1);
            WebTestRequest request12Dependent2 = new WebTestRequest((this.Context["WebServer"].ToString() + "/Content/Themes/Default/Fonts/Open-Sans.woff"));
            request12.DependentRequests.Add(request12Dependent2);
            WebTestRequest request12Dependent3 = new WebTestRequest((this.Context["WebServer"].ToString() + "/Content/Themes/Default/Fonts/Open-Sans-Italic.woff"));
            request12.DependentRequests.Add(request12Dependent3);
            WebTestRequest request12Dependent4 = new WebTestRequest((this.Context["WebServer"].ToString() + "/Content/Themes/Default/Fonts/Open-Sans-Bold.woff"));
            request12.DependentRequests.Add(request12Dependent4);
            WebTestRequest request12Dependent5 = new WebTestRequest((this.Context["WebServer"].ToString() + "/Content/Themes/Default/Fonts/Maven-Pro.woff"));
            request12.DependentRequests.Add(request12Dependent5);
            ExtractText extractionRule12 = new ExtractText();
            extractionRule12.StartsWith = "s: [\"";
            extractionRule12.EndsWith = "\",\"79";
            extractionRule12.Index = 0;
            extractionRule12.IgnoreCase = false;
            extractionRule12.UseRegularExpression = false;
            extractionRule12.HtmlDecode = true;
            extractionRule12.Required = false;
            extractionRule12.ContextParameterName = "FormPostParam119.id";
            request12.ExtractValues += new EventHandler<ExtractionEventArgs>(extractionRule12.Extract);
            ExtractText extractionRule13 = new ExtractText();
            extractionRule13.StartsWith = "s: [\"";
            extractionRule13.EndsWith = "\",\"79";
            extractionRule13.Index = 0;
            extractionRule13.IgnoreCase = false;
            extractionRule13.UseRegularExpression = false;
            extractionRule13.HtmlDecode = true;
            extractionRule13.Required = false;
            extractionRule13.ContextParameterName = "FormPostParam120.id";
            request12.ExtractValues += new EventHandler<ExtractionEventArgs>(extractionRule13.Extract);
            yield return request12;
            request12 = null;

            WebTestRequest request13 = new WebTestRequest((this.Context["WebServer"].ToString() + "/Dashboard/NewOrders"));
            WebTestRequest request13Dependent1 = new WebTestRequest((this.Context["WebServer"].ToString() + "/Content/Bootstrap/less/bootstrap.less"));
            request13.DependentRequests.Add(request13Dependent1);
            WebTestRequest request13Dependent2 = new WebTestRequest((this.Context["WebServer"].ToString() + "/Content/Themes/Default/Fonts/Open-Sans.woff"));
            request13.DependentRequests.Add(request13Dependent2);
            WebTestRequest request13Dependent3 = new WebTestRequest((this.Context["WebServer"].ToString() + "/Content/Themes/Default/Fonts/Open-Sans-Italic.woff"));
            request13.DependentRequests.Add(request13Dependent3);
            WebTestRequest request13Dependent4 = new WebTestRequest((this.Context["WebServer"].ToString() + "/Content/Themes/Default/Fonts/Open-Sans-Bold.woff"));
            request13.DependentRequests.Add(request13Dependent4);
            WebTestRequest request13Dependent5 = new WebTestRequest((this.Context["WebServer"].ToString() + "/Content/Themes/Default/Fonts/Maven-Pro.woff"));
            request13.DependentRequests.Add(request13Dependent5);
            ExtractText extractionRule14 = new ExtractText();
            extractionRule14.StartsWith = "s: [\"";
            extractionRule14.EndsWith = "\"],\r\n";
            extractionRule14.Index = 0;
            extractionRule14.IgnoreCase = false;
            extractionRule14.UseRegularExpression = false;
            extractionRule14.HtmlDecode = true;
            extractionRule14.Required = false;
            extractionRule14.ContextParameterName = "FormPostParam127.id";
            request13.ExtractValues += new EventHandler<ExtractionEventArgs>(extractionRule14.Extract);
            yield return request13;
            request13 = null;

            WebTestRequest request14 = new WebTestRequest((this.Context["WebServer"].ToString() + "/Home/Logout"));
            request14.ExpectedResponseUrl = (this.Context["WebServer"].ToString() + "/");
            WebTestRequest request14Dependent1 = new WebTestRequest((this.Context["WebServer"].ToString() + "/Content/Bootstrap/less/bootstrap.less"));
            request14.DependentRequests.Add(request14Dependent1);
            WebTestRequest request14Dependent2 = new WebTestRequest((this.Context["WebServer"].ToString() + "/Content/Themes/Default/Fonts/Open-Sans.woff"));
            request14.DependentRequests.Add(request14Dependent2);
            WebTestRequest request14Dependent3 = new WebTestRequest((this.Context["WebServer"].ToString() + "/Content/Themes/Default/Fonts/Open-Sans-Italic.woff"));
            request14.DependentRequests.Add(request14Dependent3);
            WebTestRequest request14Dependent4 = new WebTestRequest((this.Context["WebServer"].ToString() + "/Content/Themes/Default/Fonts/Open-Sans-Bold.woff"));
            request14.DependentRequests.Add(request14Dependent4);
            WebTestRequest request14Dependent5 = new WebTestRequest((this.Context["WebServer"].ToString() + "/Content/Themes/Default/Fonts/Maven-Pro.woff"));
            request14.DependentRequests.Add(request14Dependent5);
            yield return request14;
            request14 = null;
        }
コード例 #3
0
        public override IEnumerator <WebTestRequest> GetRequestEnumerator()
        {
            // Initialize validation rules that apply to all requests in the WebTest
            if ((this.Context.ValidationLevel >= Microsoft.VisualStudio.TestTools.WebTesting.ValidationLevel.Low))
            {
                ValidateResponseUrl validationRule1 = new ValidateResponseUrl();
                this.ValidateResponse += new EventHandler <ValidationEventArgs>(validationRule1.Validate);
            }

            WebTestRequest request1 = new WebTestRequest("http://localhost:13164/Photo/PhotoAlbumManager.aspx");

            request1.ThinkTime           = 5;
            request1.ExpectedResponseUrl = "http://localhost:13164/Login.aspx?ReturnUrl=%2fPhoto%2fPhotoAlbumManager.aspx";
            ExtractHiddenFields extractionRule1 = new ExtractHiddenFields();

            extractionRule1.Required             = true;
            extractionRule1.HtmlDecode           = true;
            extractionRule1.ContextParameterName = "1";
            request1.ExtractValues += new EventHandler <ExtractionEventArgs>(extractionRule1.Extract);
            yield return(request1);

            request1 = null;

            WebTestRequest request2 = new WebTestRequest("http://localhost:13164/Login.aspx");

            request2.ThinkTime           = 2;
            request2.Method              = "POST";
            request2.ExpectedResponseUrl = "http://localhost:13164/Photo/PhotoAlbumManager.aspx";
            request2.QueryStringParameters.Add("ReturnUrl", "%2fPhoto%2fPhotoAlbumManager.aspx", false, false);
            FormPostHttpBody request2Body = new FormPostHttpBody();

            request2Body.FormPostParameters.Add("__EVENTTARGET", this.Context["$HIDDEN1.__EVENTTARGET"].ToString());
            request2Body.FormPostParameters.Add("__EVENTARGUMENT", this.Context["$HIDDEN1.__EVENTARGUMENT"].ToString());
            request2Body.FormPostParameters.Add("__VIEWSTATE", this.Context["$HIDDEN1.__VIEWSTATE"].ToString());
            request2Body.FormPostParameters.Add("__EVENTVALIDATION", this.Context["$HIDDEN1.__EVENTVALIDATION"].ToString());
            request2Body.FormPostParameters.Add("Login1$UserName", "alkampfer");
            request2Body.FormPostParameters.Add("Login1$Password", "12345");
            request2Body.FormPostParameters.Add("Login1$LoginButton", "Log In");
            request2.Body = request2Body;
            ExtractHiddenFields extractionRule2 = new ExtractHiddenFields();

            extractionRule2.Required             = true;
            extractionRule2.HtmlDecode           = true;
            extractionRule2.ContextParameterName = "1";
            request2.ExtractValues += new EventHandler <ExtractionEventArgs>(extractionRule2.Extract);
            ExtractAttributeValue extractionRule3 = new ExtractAttributeValue();

            extractionRule3.TagName             = "a";
            extractionRule3.AttributeName       = "href";
            extractionRule3.MatchAttributeName  = "";
            extractionRule3.MatchAttributeValue = "";
            extractionRule3.HtmlDecode          = true;
            extractionRule3.Required            = true;
            extractionRule3.Index = 0;
            extractionRule3.ContextParameterName = "";
            extractionRule3.ContextParameterName = "Ext";
            request2.ExtractValues += new EventHandler <ExtractionEventArgs>(extractionRule3.Extract);
            yield return(request2);

            //now we have finished request2 so we can access the context
            Assert.IsNotNull(this.Context["Ext"]);
            request2 = null;

            WebTestRequest request3 = new WebTestRequest("http://localhost:13164/Photo/PhotoAlbumManager.aspx");

            request3.Method = "POST";
            FormPostHttpBody request3Body = new FormPostHttpBody();

            request3Body.FormPostParameters.Add("__EVENTTARGET", this.Context["$HIDDEN1.__EVENTTARGET"].ToString());
            request3Body.FormPostParameters.Add("__EVENTARGUMENT", this.Context["$HIDDEN1.__EVENTARGUMENT"].ToString());
            request3Body.FormPostParameters.Add("__VIEWSTATE", this.Context["$HIDDEN1.__VIEWSTATE"].ToString());
            request3Body.FormPostParameters.Add("__VIEWSTATEENCRYPTED", this.Context["$HIDDEN1.__VIEWSTATEENCRYPTED"].ToString());
            request3Body.FormPostParameters.Add("__EVENTVALIDATION", this.Context["$HIDDEN1.__EVENTVALIDATION"].ToString());
            request3Body.FormPostParameters.Add("ctl00$ContentPlaceHolder1$PhotoAlbumManager1$grdPhotoAlbum$ctl04$Button1", "Select");
            request3Body.FormPostParameters.Add("ctl00$ContentPlaceHolder1$PhotoAlbumManager1$txtNameForNewElement", "");
            request3Body.FormPostParameters.Add("ctl00$ContentPlaceHolder1$PhotoAlbumManager1$txtdescriptionForNewElement", "");
            request3.Body = request3Body;
            if ((this.Context.ValidationLevel >= Microsoft.VisualStudio.TestTools.WebTesting.ValidationLevel.High))
            {
                ValidationRuleFindText validationRule2 = new ValidationRuleFindText();
                validationRule2.FindText             = "Gli occhietti si chiudono..!!!";
                validationRule2.IgnoreCase           = true;
                validationRule2.UseRegularExpression = false;
                validationRule2.PassIfTextFound      = true;
                request3.ValidateResponse           += new EventHandler <ValidationEventArgs>(validationRule2.Validate);
            }
            yield return(request3);

            request3 = null;
        }
コード例 #4
0
        public override IEnumerator <WebTestRequest> GetRequestEnumerator()
        {
            // Initialize validation rules that apply to all requests in the WebTest
            if ((this.Context.ValidationLevel >= Microsoft.VisualStudio.TestTools.WebTesting.ValidationLevel.Low))
            {
                ValidateResponseUrl validationRule1 = new ValidateResponseUrl();
                this.ValidateResponse += new EventHandler <ValidationEventArgs>(validationRule1.Validate);
            }

            WebTestRequest request1 = new WebTestRequest(fbaURL + "/_layouts/login.aspx");

            request1.ThinkTime           = 24;
            request1.ExpectedResponseUrl = fbaURL + "/_layouts/login.aspx?ReturnUrl=%2f";
            ExtractHiddenFields extractionRule1 = new ExtractHiddenFields();

            extractionRule1.Required             = true;
            extractionRule1.HtmlDecode           = true;
            extractionRule1.ContextParameterName = "1";
            request1.ExtractValues += new EventHandler <ExtractionEventArgs>(extractionRule1.Extract);
            yield return(request1);

            request1 = null;

            WebTestRequest request2 = new WebTestRequest(fbaURL + "/_layouts/login.aspx");

            request2.ThinkTime           = 11;
            request2.Method              = "POST";
            request2.ExpectedResponseUrl = fbaURL + "/sites/partner1/Pages/default.aspx";
            request2.QueryStringParameters.Add("ReturnUrl", "%2f", false, false);
            FormPostHttpBody request2Body = new FormPostHttpBody();

            request2Body.FormPostParameters.Add("__LASTFOCUS", this.Context["$HIDDEN1.__LASTFOCUS"].ToString());
            request2Body.FormPostParameters.Add("__VIEWSTATE", this.Context["$HIDDEN1.__VIEWSTATE"].ToString());
            request2Body.FormPostParameters.Add("__EVENTTARGET", this.Context["$HIDDEN1.__EVENTTARGET"].ToString());
            request2Body.FormPostParameters.Add("__EVENTARGUMENT", this.Context["$HIDDEN1.__EVENTARGUMENT"].ToString());
            request2Body.FormPostParameters.Add("__EVENTVALIDATION", this.Context["$HIDDEN1.__EVENTVALIDATION"].ToString());
            request2Body.FormPostParameters.Add("ctl00$PlaceHolderMain$login$UserName", "ContosoPartner1User1");
            request2Body.FormPostParameters.Add("ctl00$PlaceHolderMain$login$password", "P2ssw0rd$");
            request2Body.FormPostParameters.Add("ctl00$PlaceHolderMain$login$login", "Sign In");
            request2Body.FormPostParameters.Add("__spDummyText1", "");
            request2Body.FormPostParameters.Add("__spDummyText2", "");
            request2.Body = request2Body;
            yield return(request2);

            request2 = null;

            WebTestRequest request3 = new WebTestRequest(fbaURL + "/sites/productcatalog/category.aspx");

            request3.ThinkTime = 1;
            request3.QueryStringParameters.Add("categoryid", "0", false, false);

            //Check for Category Details Webpart title
            if ((this.Context.ValidationLevel >= Microsoft.VisualStudio.TestTools.WebTesting.ValidationLevel.High))
            {
                ValidationRuleFindText validationRule2 = new ValidationRuleFindText();
                validationRule2.FindText             = "Category Details";
                validationRule2.IgnoreCase           = true;
                validationRule2.UseRegularExpression = false;
                validationRule2.PassIfTextFound      = true;
                request3.ValidateResponse           += new EventHandler <ValidationEventArgs>(validationRule2.Validate);
            }

            //Check for Category List Webpart title
            if ((this.Context.ValidationLevel >= Microsoft.VisualStudio.TestTools.WebTesting.ValidationLevel.High))
            {
                ValidationRuleFindText validationRule3 = new ValidationRuleFindText();
                validationRule3.FindText             = "Category List";
                validationRule3.IgnoreCase           = true;
                validationRule3.UseRegularExpression = false;
                validationRule3.PassIfTextFound      = true;
                request3.ValidateResponse           += new EventHandler <ValidationEventArgs>(validationRule3.Validate);
            }

            //Check for Product List Webpart title
            if ((this.Context.ValidationLevel >= Microsoft.VisualStudio.TestTools.WebTesting.ValidationLevel.High))
            {
                ValidationRuleFindText validationRule4 = new ValidationRuleFindText();
                validationRule4.FindText             = "Product List";
                validationRule4.IgnoreCase           = true;
                validationRule4.UseRegularExpression = false;
                validationRule4.PassIfTextFound      = true;
                request3.ValidateResponse           += new EventHandler <ValidationEventArgs>(validationRule4.Validate);
            }
            ExtractHiddenFields extractionRule2 = new ExtractHiddenFields();

            extractionRule2.Required             = true;
            extractionRule2.HtmlDecode           = true;
            extractionRule2.ContextParameterName = "1";
            request3.ExtractValues += new EventHandler <ExtractionEventArgs>(extractionRule2.Extract);
            ExtractHiddenFields extractionRule3 = new ExtractHiddenFields();

            extractionRule3.Required             = true;
            extractionRule3.HtmlDecode           = true;
            extractionRule3.ContextParameterName = "2";
            request3.ExtractValues += new EventHandler <ExtractionEventArgs>(extractionRule3.Extract);
            ExtractHiddenFields extractionRule4 = new ExtractHiddenFields();

            extractionRule4.Required             = true;
            extractionRule4.HtmlDecode           = true;
            extractionRule4.ContextParameterName = "3";
            request3.ExtractValues += new EventHandler <ExtractionEventArgs>(extractionRule4.Extract);

            //Extract CategoryDetail WebPart guid
            ExtractAttributeValue extractionRule5 = new ExtractAttributeValue();

            extractionRule5.TagName             = "div";
            extractionRule5.AttributeName       = "WebPartID";
            extractionRule5.MatchAttributeName  = "id";
            extractionRule5.MatchAttributeValue = "WebPartWPQ3";
            extractionRule5.HtmlDecode          = true;
            extractionRule5.Required            = true;
            extractionRule5.Index = 0;
            extractionRule5.ContextParameterName = "";
            extractionRule5.ContextParameterName = "CategoryDetailWebPartGuid";
            request3.ExtractValues += new EventHandler <ExtractionEventArgs>(extractionRule5.Extract);

            //Extract CategoryList WebPart guid
            ExtractAttributeValue extractionRule6 = new ExtractAttributeValue();

            extractionRule6.TagName             = "div";
            extractionRule6.AttributeName       = "WebPartID";
            extractionRule6.MatchAttributeName  = "id";
            extractionRule6.MatchAttributeValue = "WebPartWPQ4";
            extractionRule6.HtmlDecode          = true;
            extractionRule6.Required            = true;
            extractionRule6.Index = 0;
            extractionRule6.ContextParameterName = "";
            extractionRule6.ContextParameterName = "CategoryListWebPartGuid";
            request3.ExtractValues += new EventHandler <ExtractionEventArgs>(extractionRule6.Extract);

            //Extract ProductList WebPart guid
            ExtractAttributeValue extractionRule7 = new ExtractAttributeValue();

            extractionRule7.TagName             = "div";
            extractionRule7.AttributeName       = "WebPartID";
            extractionRule7.MatchAttributeName  = "id";
            extractionRule7.MatchAttributeValue = "WebPartWPQ5";
            extractionRule7.HtmlDecode          = true;
            extractionRule7.Required            = true;
            extractionRule7.Index = 0;
            extractionRule7.ContextParameterName = "";
            extractionRule7.ContextParameterName = "ProductListWebPartGuid";
            request3.ExtractValues += new EventHandler <ExtractionEventArgs>(extractionRule7.Extract);
            yield return(request3);


            string CategoryDetailWebPartGuid = Context["CategoryDetailWebPartGuid"].ToString();
            string CategoryListWebPartGuid   = Context["CategoryListWebPartGuid"].ToString();
            string ProductListWebPartGuid    = Context["ProductListWebPartGuid"].ToString();

            request3 = null;

            WebTestRequest request4 = new WebTestRequest(fbaURL + "/sites/productcatalog/category.aspx");

            request4.Method = "POST";
            request4.QueryStringParameters.Add("categoryid", "0", false, false);
            FormPostHttpBody request4Body = new FormPostHttpBody();

            request4Body.FormPostParameters.Add("MSO_PageHashCode", this.Context["$HIDDEN1.MSO_PageHashCode"].ToString());
            request4Body.FormPostParameters.Add("MSOWebPartPage_PostbackSource", this.Context["$HIDDEN1.MSOWebPartPage_PostbackSource"].ToString());
            request4Body.FormPostParameters.Add("MSOTlPn_SelectedWpId", this.Context["$HIDDEN1.MSOTlPn_SelectedWpId"].ToString());
            request4Body.FormPostParameters.Add("MSOTlPn_View", this.Context["$HIDDEN1.MSOTlPn_View"].ToString());
            request4Body.FormPostParameters.Add("MSOTlPn_ShowSettings", this.Context["$HIDDEN1.MSOTlPn_ShowSettings"].ToString());
            request4Body.FormPostParameters.Add("MSOGallery_SelectedLibrary", this.Context["$HIDDEN1.MSOGallery_SelectedLibrary"].ToString());
            request4Body.FormPostParameters.Add("MSOGallery_FilterString", this.Context["$HIDDEN1.MSOGallery_FilterString"].ToString());
            request4Body.FormPostParameters.Add("MSOTlPn_Button", this.Context["$HIDDEN1.MSOTlPn_Button"].ToString());
            request4Body.FormPostParameters.Add("__EVENTTARGET", this.Context["$HIDDEN1.__EVENTTARGET"].ToString());
            request4Body.FormPostParameters.Add("__EVENTARGUMENT", this.Context["$HIDDEN1.__EVENTARGUMENT"].ToString());
            request4Body.FormPostParameters.Add("__REQUESTDIGEST", this.Context["$HIDDEN1.__REQUESTDIGEST"].ToString());
            request4Body.FormPostParameters.Add("MSOSPWebPartManager_DisplayModeName", this.Context["$HIDDEN1.MSOSPWebPartManager_DisplayModeName"].ToString());
            request4Body.FormPostParameters.Add("MSOWebPartPage_Shared", this.Context["$HIDDEN1.MSOWebPartPage_Shared"].ToString());
            request4Body.FormPostParameters.Add("MSOLayout_LayoutChanges", this.Context["$HIDDEN1.MSOLayout_LayoutChanges"].ToString());
            request4Body.FormPostParameters.Add("MSOLayout_InDesignMode", this.Context["$HIDDEN1.MSOLayout_InDesignMode"].ToString());
            request4Body.FormPostParameters.Add("MSOSPWebPartManager_OldDisplayModeName", this.Context["$HIDDEN1.MSOSPWebPartManager_OldDisplayModeName"].ToString());
            request4Body.FormPostParameters.Add("MSOSPWebPartManager_StartWebPartEditingName", this.Context["$HIDDEN1.MSOSPWebPartManager_StartWebPartEditingName"].ToString());
            request4Body.FormPostParameters.Add("BDC_ActionsMenuProxyPageWebUrl", this.Context["$HIDDEN1.BDC_ActionsMenuProxyPageWebUrl"].ToString());
            request4Body.FormPostParameters.Add("__VIEWSTATE", this.Context["$HIDDEN1.__VIEWSTATE"].ToString());
            request4Body.FormPostParameters.Add("ctl00$PlaceHolderSearchArea$ctl00$ctl00", this.Context["$HIDDEN1.ctl00$PlaceHolderSearchArea$ctl00$ctl00"].ToString());
            request4Body.FormPostParameters.Add("ctl00$PlaceHolderSearchArea$ctl00$SBScopesDDL", "This Site");
            request4Body.FormPostParameters.Add("ctl00$PlaceHolderSearchArea$ctl00$S3031AEBA_InputKeywords", "");
            request4Body.FormPostParameters.Add("showhelp", "Show Help");
            request4Body.FormPostParameters.Add("__spDummyText1", "");
            request4Body.FormPostParameters.Add("__spDummyText2", "");
            request4Body.FormPostParameters.Add("__CALLBACKID", "ctl00$m$g_" + ProductListWebPartGuid.Replace("-", "_").ToString());
            request4Body.FormPostParameters.Add("__CALLBACKPARAM", "GetLongRunningUI");
            request4Body.FormPostParameters.Add("__EVENTVALIDATION", this.Context["$HIDDEN1.__EVENTVALIDATION"].ToString());
            request4.Body = request4Body;
            yield return(request4);

            request4 = null;

            WebTestRequest request5 = new WebTestRequest(fbaURL + "/sites/productcatalog/category.aspx");

            request5.Method = "POST";
            request5.QueryStringParameters.Add("categoryid", "0", false, false);
            FormPostHttpBody request5Body = new FormPostHttpBody();

            request5Body.FormPostParameters.Add("MSO_PageHashCode", this.Context["$HIDDEN2.MSO_PageHashCode"].ToString());
            request5Body.FormPostParameters.Add("MSOWebPartPage_PostbackSource", this.Context["$HIDDEN2.MSOWebPartPage_PostbackSource"].ToString());
            request5Body.FormPostParameters.Add("MSOTlPn_SelectedWpId", this.Context["$HIDDEN2.MSOTlPn_SelectedWpId"].ToString());
            request5Body.FormPostParameters.Add("MSOTlPn_View", this.Context["$HIDDEN2.MSOTlPn_View"].ToString());
            request5Body.FormPostParameters.Add("MSOTlPn_ShowSettings", this.Context["$HIDDEN2.MSOTlPn_ShowSettings"].ToString());
            request5Body.FormPostParameters.Add("MSOGallery_SelectedLibrary", this.Context["$HIDDEN2.MSOGallery_SelectedLibrary"].ToString());
            request5Body.FormPostParameters.Add("MSOGallery_FilterString", this.Context["$HIDDEN2.MSOGallery_FilterString"].ToString());
            request5Body.FormPostParameters.Add("MSOTlPn_Button", this.Context["$HIDDEN2.MSOTlPn_Button"].ToString());
            request5Body.FormPostParameters.Add("__EVENTTARGET", this.Context["$HIDDEN2.__EVENTTARGET"].ToString());
            request5Body.FormPostParameters.Add("__EVENTARGUMENT", this.Context["$HIDDEN2.__EVENTARGUMENT"].ToString());
            request5Body.FormPostParameters.Add("__REQUESTDIGEST", this.Context["$HIDDEN2.__REQUESTDIGEST"].ToString());
            request5Body.FormPostParameters.Add("MSOSPWebPartManager_DisplayModeName", this.Context["$HIDDEN2.MSOSPWebPartManager_DisplayModeName"].ToString());
            request5Body.FormPostParameters.Add("MSOWebPartPage_Shared", this.Context["$HIDDEN2.MSOWebPartPage_Shared"].ToString());
            request5Body.FormPostParameters.Add("MSOLayout_LayoutChanges", this.Context["$HIDDEN2.MSOLayout_LayoutChanges"].ToString());
            request5Body.FormPostParameters.Add("MSOLayout_InDesignMode", this.Context["$HIDDEN2.MSOLayout_InDesignMode"].ToString());
            request5Body.FormPostParameters.Add("MSOSPWebPartManager_OldDisplayModeName", this.Context["$HIDDEN2.MSOSPWebPartManager_OldDisplayModeName"].ToString());
            request5Body.FormPostParameters.Add("MSOSPWebPartManager_StartWebPartEditingName", this.Context["$HIDDEN2.MSOSPWebPartManager_StartWebPartEditingName"].ToString());
            request5Body.FormPostParameters.Add("BDC_ActionsMenuProxyPageWebUrl", this.Context["$HIDDEN2.BDC_ActionsMenuProxyPageWebUrl"].ToString());
            request5Body.FormPostParameters.Add("__VIEWSTATE", this.Context["$HIDDEN2.__VIEWSTATE"].ToString());
            request5Body.FormPostParameters.Add("ctl00$PlaceHolderSearchArea$ctl00$ctl00", this.Context["$HIDDEN2.ctl00$PlaceHolderSearchArea$ctl00$ctl00"].ToString());
            request5Body.FormPostParameters.Add("ctl00$PlaceHolderSearchArea$ctl00$SBScopesDDL", "This Site");
            request5Body.FormPostParameters.Add("ctl00$PlaceHolderSearchArea$ctl00$S3031AEBA_InputKeywords", "");
            request5Body.FormPostParameters.Add("showhelp", "Show Help");
            request5Body.FormPostParameters.Add("__spDummyText1", "");
            request5Body.FormPostParameters.Add("__spDummyText2", "");
            request5Body.FormPostParameters.Add("__CALLBACKID", "ctl00$m$g_" + CategoryListWebPartGuid.Replace("-", "_").ToString());
            request5Body.FormPostParameters.Add("__CALLBACKPARAM", "GetLongRunningUI");
            request5Body.FormPostParameters.Add("__EVENTVALIDATION", this.Context["$HIDDEN2.__EVENTVALIDATION"].ToString());
            request5.Body = request5Body;
            yield return(request5);

            request5 = null;

            WebTestRequest request6 = new WebTestRequest(fbaURL + "/sites/productcatalog/category.aspx");

            request6.ThinkTime = 4;
            request6.Method    = "POST";
            request6.QueryStringParameters.Add("categoryid", "0", false, false);
            FormPostHttpBody request6Body = new FormPostHttpBody();

            request6Body.FormPostParameters.Add("MSO_PageHashCode", this.Context["$HIDDEN3.MSO_PageHashCode"].ToString());
            request6Body.FormPostParameters.Add("MSOWebPartPage_PostbackSource", this.Context["$HIDDEN3.MSOWebPartPage_PostbackSource"].ToString());
            request6Body.FormPostParameters.Add("MSOTlPn_SelectedWpId", this.Context["$HIDDEN3.MSOTlPn_SelectedWpId"].ToString());
            request6Body.FormPostParameters.Add("MSOTlPn_View", this.Context["$HIDDEN3.MSOTlPn_View"].ToString());
            request6Body.FormPostParameters.Add("MSOTlPn_ShowSettings", this.Context["$HIDDEN3.MSOTlPn_ShowSettings"].ToString());
            request6Body.FormPostParameters.Add("MSOGallery_SelectedLibrary", this.Context["$HIDDEN3.MSOGallery_SelectedLibrary"].ToString());
            request6Body.FormPostParameters.Add("MSOGallery_FilterString", this.Context["$HIDDEN3.MSOGallery_FilterString"].ToString());
            request6Body.FormPostParameters.Add("MSOTlPn_Button", this.Context["$HIDDEN3.MSOTlPn_Button"].ToString());
            request6Body.FormPostParameters.Add("__EVENTTARGET", this.Context["$HIDDEN3.__EVENTTARGET"].ToString());
            request6Body.FormPostParameters.Add("__EVENTARGUMENT", this.Context["$HIDDEN3.__EVENTARGUMENT"].ToString());
            request6Body.FormPostParameters.Add("__REQUESTDIGEST", this.Context["$HIDDEN3.__REQUESTDIGEST"].ToString());
            request6Body.FormPostParameters.Add("MSOSPWebPartManager_DisplayModeName", this.Context["$HIDDEN3.MSOSPWebPartManager_DisplayModeName"].ToString());
            request6Body.FormPostParameters.Add("MSOWebPartPage_Shared", this.Context["$HIDDEN3.MSOWebPartPage_Shared"].ToString());
            request6Body.FormPostParameters.Add("MSOLayout_LayoutChanges", this.Context["$HIDDEN3.MSOLayout_LayoutChanges"].ToString());
            request6Body.FormPostParameters.Add("MSOLayout_InDesignMode", this.Context["$HIDDEN3.MSOLayout_InDesignMode"].ToString());
            request6Body.FormPostParameters.Add("MSOSPWebPartManager_OldDisplayModeName", this.Context["$HIDDEN3.MSOSPWebPartManager_OldDisplayModeName"].ToString());
            request6Body.FormPostParameters.Add("MSOSPWebPartManager_StartWebPartEditingName", this.Context["$HIDDEN3.MSOSPWebPartManager_StartWebPartEditingName"].ToString());
            request6Body.FormPostParameters.Add("BDC_ActionsMenuProxyPageWebUrl", this.Context["$HIDDEN3.BDC_ActionsMenuProxyPageWebUrl"].ToString());
            request6Body.FormPostParameters.Add("__VIEWSTATE", this.Context["$HIDDEN3.__VIEWSTATE"].ToString());
            request6Body.FormPostParameters.Add("ctl00$PlaceHolderSearchArea$ctl00$ctl00", this.Context["$HIDDEN3.ctl00$PlaceHolderSearchArea$ctl00$ctl00"].ToString());
            request6Body.FormPostParameters.Add("ctl00$PlaceHolderSearchArea$ctl00$SBScopesDDL", "This Site");
            request6Body.FormPostParameters.Add("ctl00$PlaceHolderSearchArea$ctl00$S3031AEBA_InputKeywords", "");
            request6Body.FormPostParameters.Add("showhelp", "Show Help");
            request6Body.FormPostParameters.Add("__spDummyText1", "");
            request6Body.FormPostParameters.Add("__spDummyText2", "");
            request6Body.FormPostParameters.Add("__CALLBACKID", "ctl00$m$g_" + CategoryDetailWebPartGuid.Replace("-", "_").ToString());
            request6Body.FormPostParameters.Add("__CALLBACKPARAM", "GetLongRunningUI");
            request6Body.FormPostParameters.Add("__EVENTVALIDATION", this.Context["$HIDDEN3.__EVENTVALIDATION"].ToString());
            request6.Body = request6Body;
            yield return(request6);

            request6 = null;

            WebTestRequest request7 = new WebTestRequest(fbaURL + "/sites/productcatalog/_layouts/ProfileRedirect.aspx");

            request7.ExpectedResponseUrl = fbaURL + "/sites/productcatalog/Category.aspx?CategoryId=2";
            request7.QueryStringParameters.Add("Application", "ContosoProductCatalogService", false, false);
            request7.QueryStringParameters.Add("Entity", "Category", false, false);
            request7.QueryStringParameters.Add("ItemId", "__bk40002300", false, false);
            if ((this.Context.ValidationLevel >= Microsoft.VisualStudio.TestTools.WebTesting.ValidationLevel.High))
            {
                ValidationRuleFindText validationRule5 = new ValidationRuleFindText();
                validationRule5.FindText             = @"<span><a class=""ms-sitemapdirectional"" href=""/sites/productcatalog/Category.aspx?CategoryId=0"">Root Category</a></span><span> &gt; </span><span class=""ms-sitemapdirectional"">Hospital Equipment</span><a id=""ctl00_PlaceHolderMain_SiteMapPath1_SkipLink""></a></span>";
                validationRule5.IgnoreCase           = true;
                validationRule5.UseRegularExpression = false;
                validationRule5.PassIfTextFound      = true;
                request7.ValidateResponse           += new EventHandler <ValidationEventArgs>(validationRule5.Validate);
            }
            ExtractHiddenFields extractionRule8 = new ExtractHiddenFields();

            extractionRule8.Required             = true;
            extractionRule8.HtmlDecode           = true;
            extractionRule8.ContextParameterName = "1";
            request7.ExtractValues += new EventHandler <ExtractionEventArgs>(extractionRule8.Extract);
            ExtractHiddenFields extractionRule9 = new ExtractHiddenFields();

            extractionRule9.Required             = true;
            extractionRule9.HtmlDecode           = true;
            extractionRule9.ContextParameterName = "0";
            request7.ExtractValues += new EventHandler <ExtractionEventArgs>(extractionRule9.Extract);
            ExtractHiddenFields extractionRule10 = new ExtractHiddenFields();

            extractionRule10.Required             = true;
            extractionRule10.HtmlDecode           = true;
            extractionRule10.ContextParameterName = "2";
            request7.ExtractValues += new EventHandler <ExtractionEventArgs>(extractionRule10.Extract);
            yield return(request7);

            request7 = null;

            WebTestRequest request8 = new WebTestRequest(fbaURL + "/sites/productcatalog/Category.aspx");

            request8.Method = "POST";
            request8.QueryStringParameters.Add("CategoryId", "2", false, false);
            FormPostHttpBody request8Body = new FormPostHttpBody();

            request8Body.FormPostParameters.Add("MSO_PageHashCode", this.Context["$HIDDEN1.MSO_PageHashCode"].ToString());
            request8Body.FormPostParameters.Add("MSOWebPartPage_PostbackSource", this.Context["$HIDDEN1.MSOWebPartPage_PostbackSource"].ToString());
            request8Body.FormPostParameters.Add("MSOTlPn_SelectedWpId", this.Context["$HIDDEN1.MSOTlPn_SelectedWpId"].ToString());
            request8Body.FormPostParameters.Add("MSOTlPn_View", this.Context["$HIDDEN1.MSOTlPn_View"].ToString());
            request8Body.FormPostParameters.Add("MSOTlPn_ShowSettings", this.Context["$HIDDEN1.MSOTlPn_ShowSettings"].ToString());
            request8Body.FormPostParameters.Add("MSOGallery_SelectedLibrary", this.Context["$HIDDEN1.MSOGallery_SelectedLibrary"].ToString());
            request8Body.FormPostParameters.Add("MSOGallery_FilterString", this.Context["$HIDDEN1.MSOGallery_FilterString"].ToString());
            request8Body.FormPostParameters.Add("MSOTlPn_Button", this.Context["$HIDDEN1.MSOTlPn_Button"].ToString());
            request8Body.FormPostParameters.Add("__EVENTTARGET", this.Context["$HIDDEN1.__EVENTTARGET"].ToString());
            request8Body.FormPostParameters.Add("__EVENTARGUMENT", this.Context["$HIDDEN1.__EVENTARGUMENT"].ToString());
            request8Body.FormPostParameters.Add("__REQUESTDIGEST", this.Context["$HIDDEN1.__REQUESTDIGEST"].ToString());
            request8Body.FormPostParameters.Add("MSOSPWebPartManager_DisplayModeName", this.Context["$HIDDEN1.MSOSPWebPartManager_DisplayModeName"].ToString());
            request8Body.FormPostParameters.Add("MSOWebPartPage_Shared", this.Context["$HIDDEN1.MSOWebPartPage_Shared"].ToString());
            request8Body.FormPostParameters.Add("MSOLayout_LayoutChanges", this.Context["$HIDDEN1.MSOLayout_LayoutChanges"].ToString());
            request8Body.FormPostParameters.Add("MSOLayout_InDesignMode", this.Context["$HIDDEN1.MSOLayout_InDesignMode"].ToString());
            request8Body.FormPostParameters.Add("MSOSPWebPartManager_OldDisplayModeName", this.Context["$HIDDEN1.MSOSPWebPartManager_OldDisplayModeName"].ToString());
            request8Body.FormPostParameters.Add("MSOSPWebPartManager_StartWebPartEditingName", this.Context["$HIDDEN1.MSOSPWebPartManager_StartWebPartEditingName"].ToString());
            request8Body.FormPostParameters.Add("BDC_ActionsMenuProxyPageWebUrl", this.Context["$HIDDEN1.BDC_ActionsMenuProxyPageWebUrl"].ToString());
            request8Body.FormPostParameters.Add("__VIEWSTATE", this.Context["$HIDDEN1.__VIEWSTATE"].ToString());
            request8Body.FormPostParameters.Add("ctl00$PlaceHolderSearchArea$ctl00$ctl00", this.Context["$HIDDEN1.ctl00$PlaceHolderSearchArea$ctl00$ctl00"].ToString());
            request8Body.FormPostParameters.Add("ctl00$PlaceHolderSearchArea$ctl00$SBScopesDDL", "This Site");
            request8Body.FormPostParameters.Add("ctl00$PlaceHolderSearchArea$ctl00$S3031AEBA_InputKeywords", "");
            request8Body.FormPostParameters.Add("showhelp", "Show Help");
            request8Body.FormPostParameters.Add("__spDummyText1", "");
            request8Body.FormPostParameters.Add("__spDummyText2", "");
            request8Body.FormPostParameters.Add("__CALLBACKID", "ctl00$m$g_" + ProductListWebPartGuid.Replace("-", "_").ToString());
            request8Body.FormPostParameters.Add("__CALLBACKPARAM", "GetLongRunningUI");
            request8Body.FormPostParameters.Add("__EVENTVALIDATION", this.Context["$HIDDEN1.__EVENTVALIDATION"].ToString());
            request8.Body = request8Body;
            if ((this.Context.ValidationLevel >= Microsoft.VisualStudio.TestTools.WebTesting.ValidationLevel.High))
            {
                ValidationRuleFindText validationRule6 = new ValidationRuleFindText();
                validationRule6.FindText             = "There are no items to show.";
                validationRule6.IgnoreCase           = true;
                validationRule6.UseRegularExpression = false;
                validationRule6.PassIfTextFound      = true;
                request8.ValidateResponse           += new EventHandler <ValidationEventArgs>(validationRule6.Validate);
            }
            yield return(request8);

            request8 = null;

            WebTestRequest request9 = new WebTestRequest(fbaURL + "/sites/productcatalog/Category.aspx");

            request9.Method = "POST";
            request9.QueryStringParameters.Add("CategoryId", "2", false, false);
            FormPostHttpBody request9Body = new FormPostHttpBody();

            request9Body.FormPostParameters.Add("MSO_PageHashCode", this.Context["$HIDDEN0.MSO_PageHashCode"].ToString());
            request9Body.FormPostParameters.Add("MSOWebPartPage_PostbackSource", this.Context["$HIDDEN0.MSOWebPartPage_PostbackSource"].ToString());
            request9Body.FormPostParameters.Add("MSOTlPn_SelectedWpId", this.Context["$HIDDEN0.MSOTlPn_SelectedWpId"].ToString());
            request9Body.FormPostParameters.Add("MSOTlPn_View", this.Context["$HIDDEN0.MSOTlPn_View"].ToString());
            request9Body.FormPostParameters.Add("MSOTlPn_ShowSettings", this.Context["$HIDDEN0.MSOTlPn_ShowSettings"].ToString());
            request9Body.FormPostParameters.Add("MSOGallery_SelectedLibrary", this.Context["$HIDDEN0.MSOGallery_SelectedLibrary"].ToString());
            request9Body.FormPostParameters.Add("MSOGallery_FilterString", this.Context["$HIDDEN0.MSOGallery_FilterString"].ToString());
            request9Body.FormPostParameters.Add("MSOTlPn_Button", this.Context["$HIDDEN0.MSOTlPn_Button"].ToString());
            request9Body.FormPostParameters.Add("__EVENTTARGET", this.Context["$HIDDEN0.__EVENTTARGET"].ToString());
            request9Body.FormPostParameters.Add("__EVENTARGUMENT", this.Context["$HIDDEN0.__EVENTARGUMENT"].ToString());
            request9Body.FormPostParameters.Add("__REQUESTDIGEST", this.Context["$HIDDEN0.__REQUESTDIGEST"].ToString());
            request9Body.FormPostParameters.Add("MSOSPWebPartManager_DisplayModeName", this.Context["$HIDDEN0.MSOSPWebPartManager_DisplayModeName"].ToString());
            request9Body.FormPostParameters.Add("MSOWebPartPage_Shared", this.Context["$HIDDEN0.MSOWebPartPage_Shared"].ToString());
            request9Body.FormPostParameters.Add("MSOLayout_LayoutChanges", this.Context["$HIDDEN0.MSOLayout_LayoutChanges"].ToString());
            request9Body.FormPostParameters.Add("MSOLayout_InDesignMode", this.Context["$HIDDEN0.MSOLayout_InDesignMode"].ToString());
            request9Body.FormPostParameters.Add("MSOSPWebPartManager_OldDisplayModeName", this.Context["$HIDDEN0.MSOSPWebPartManager_OldDisplayModeName"].ToString());
            request9Body.FormPostParameters.Add("MSOSPWebPartManager_StartWebPartEditingName", this.Context["$HIDDEN0.MSOSPWebPartManager_StartWebPartEditingName"].ToString());
            request9Body.FormPostParameters.Add("BDC_ActionsMenuProxyPageWebUrl", this.Context["$HIDDEN0.BDC_ActionsMenuProxyPageWebUrl"].ToString());
            request9Body.FormPostParameters.Add("__VIEWSTATE", this.Context["$HIDDEN0.__VIEWSTATE"].ToString());
            request9Body.FormPostParameters.Add("ctl00$PlaceHolderSearchArea$ctl00$ctl00", this.Context["$HIDDEN0.ctl00$PlaceHolderSearchArea$ctl00$ctl00"].ToString());
            request9Body.FormPostParameters.Add("ctl00$PlaceHolderSearchArea$ctl00$SBScopesDDL", "This Site");
            request9Body.FormPostParameters.Add("ctl00$PlaceHolderSearchArea$ctl00$S3031AEBA_InputKeywords", "");
            request9Body.FormPostParameters.Add("showhelp", "Show Help");
            request9Body.FormPostParameters.Add("__spDummyText1", "");
            request9Body.FormPostParameters.Add("__spDummyText2", "");
            request9Body.FormPostParameters.Add("__CALLBACKID", "ctl00$m$g_" + CategoryListWebPartGuid.Replace("-", "_").ToString());
            request9Body.FormPostParameters.Add("__CALLBACKPARAM", "GetLongRunningUI");
            request9Body.FormPostParameters.Add("__EVENTVALIDATION", this.Context["$HIDDEN0.__EVENTVALIDATION"].ToString());
            request9.Body = request9Body;
            yield return(request9);

            request9 = null;

            WebTestRequest request10 = new WebTestRequest(fbaURL + "/sites/productcatalog/Category.aspx");

            request10.Method = "POST";
            request10.QueryStringParameters.Add("CategoryId", "2", false, false);
            FormPostHttpBody request10Body = new FormPostHttpBody();

            request10Body.FormPostParameters.Add("MSO_PageHashCode", this.Context["$HIDDEN2.MSO_PageHashCode"].ToString());
            request10Body.FormPostParameters.Add("MSOWebPartPage_PostbackSource", this.Context["$HIDDEN2.MSOWebPartPage_PostbackSource"].ToString());
            request10Body.FormPostParameters.Add("MSOTlPn_SelectedWpId", this.Context["$HIDDEN2.MSOTlPn_SelectedWpId"].ToString());
            request10Body.FormPostParameters.Add("MSOTlPn_View", this.Context["$HIDDEN2.MSOTlPn_View"].ToString());
            request10Body.FormPostParameters.Add("MSOTlPn_ShowSettings", this.Context["$HIDDEN2.MSOTlPn_ShowSettings"].ToString());
            request10Body.FormPostParameters.Add("MSOGallery_SelectedLibrary", this.Context["$HIDDEN2.MSOGallery_SelectedLibrary"].ToString());
            request10Body.FormPostParameters.Add("MSOGallery_FilterString", this.Context["$HIDDEN2.MSOGallery_FilterString"].ToString());
            request10Body.FormPostParameters.Add("MSOTlPn_Button", this.Context["$HIDDEN2.MSOTlPn_Button"].ToString());
            request10Body.FormPostParameters.Add("__EVENTTARGET", this.Context["$HIDDEN2.__EVENTTARGET"].ToString());
            request10Body.FormPostParameters.Add("__EVENTARGUMENT", this.Context["$HIDDEN2.__EVENTARGUMENT"].ToString());
            request10Body.FormPostParameters.Add("__REQUESTDIGEST", this.Context["$HIDDEN2.__REQUESTDIGEST"].ToString());
            request10Body.FormPostParameters.Add("MSOSPWebPartManager_DisplayModeName", this.Context["$HIDDEN2.MSOSPWebPartManager_DisplayModeName"].ToString());
            request10Body.FormPostParameters.Add("MSOWebPartPage_Shared", this.Context["$HIDDEN2.MSOWebPartPage_Shared"].ToString());
            request10Body.FormPostParameters.Add("MSOLayout_LayoutChanges", this.Context["$HIDDEN2.MSOLayout_LayoutChanges"].ToString());
            request10Body.FormPostParameters.Add("MSOLayout_InDesignMode", this.Context["$HIDDEN2.MSOLayout_InDesignMode"].ToString());
            request10Body.FormPostParameters.Add("MSOSPWebPartManager_OldDisplayModeName", this.Context["$HIDDEN2.MSOSPWebPartManager_OldDisplayModeName"].ToString());
            request10Body.FormPostParameters.Add("MSOSPWebPartManager_StartWebPartEditingName", this.Context["$HIDDEN2.MSOSPWebPartManager_StartWebPartEditingName"].ToString());
            request10Body.FormPostParameters.Add("BDC_ActionsMenuProxyPageWebUrl", this.Context["$HIDDEN2.BDC_ActionsMenuProxyPageWebUrl"].ToString());
            request10Body.FormPostParameters.Add("__VIEWSTATE", this.Context["$HIDDEN2.__VIEWSTATE"].ToString());
            request10Body.FormPostParameters.Add("ctl00$PlaceHolderSearchArea$ctl00$ctl00", this.Context["$HIDDEN2.ctl00$PlaceHolderSearchArea$ctl00$ctl00"].ToString());
            request10Body.FormPostParameters.Add("ctl00$PlaceHolderSearchArea$ctl00$SBScopesDDL", "This Site");
            request10Body.FormPostParameters.Add("ctl00$PlaceHolderSearchArea$ctl00$S3031AEBA_InputKeywords", "");
            request10Body.FormPostParameters.Add("showhelp", "Show Help");
            request10Body.FormPostParameters.Add("__spDummyText1", "");
            request10Body.FormPostParameters.Add("__spDummyText2", "");
            request10Body.FormPostParameters.Add("__CALLBACKID", "ctl00$m$g_" + CategoryDetailWebPartGuid.Replace("-", "_").ToString());
            request10Body.FormPostParameters.Add("__CALLBACKPARAM", "GetLongRunningUI");
            request10Body.FormPostParameters.Add("__EVENTVALIDATION", this.Context["$HIDDEN2.__EVENTVALIDATION"].ToString());
            request10.Body = request10Body;
            if ((this.Context.ValidationLevel >= Microsoft.VisualStudio.TestTools.WebTesting.ValidationLevel.High))
            {
                ValidationRuleFindText validationRule7 = new ValidationRuleFindText();
                validationRule7.FindText             = @"<nobr>CategoryId:</nobr></td><td class=""ms-descriptiontext ms-alignleft"" width=""100%"">2</td>";
                validationRule7.IgnoreCase           = true;
                validationRule7.UseRegularExpression = false;
                validationRule7.PassIfTextFound      = true;
                request10.ValidateResponse          += new EventHandler <ValidationEventArgs>(validationRule7.Validate);
            }
            if ((this.Context.ValidationLevel >= Microsoft.VisualStudio.TestTools.WebTesting.ValidationLevel.High))
            {
                ValidationRuleFindText validationRule8 = new ValidationRuleFindText();
                validationRule8.FindText             = @"<nobr>Name:</nobr></td><td class=""ms-descriptiontext ms-alignleft"" width=""100%"">Hospital Equipment</td>";
                validationRule8.IgnoreCase           = true;
                validationRule8.UseRegularExpression = false;
                validationRule8.PassIfTextFound      = true;
                request10.ValidateResponse          += new EventHandler <ValidationEventArgs>(validationRule8.Validate);
            }
            if ((this.Context.ValidationLevel >= Microsoft.VisualStudio.TestTools.WebTesting.ValidationLevel.High))
            {
                ValidationRuleFindText validationRule9 = new ValidationRuleFindText();
                validationRule9.FindText             = @"<nobr>ParentId:</nobr></td><td class=""ms-descriptiontext ms-alignleft"" width=""100%"">0</td>";
                validationRule9.IgnoreCase           = true;
                validationRule9.UseRegularExpression = false;
                validationRule9.PassIfTextFound      = true;
                request10.ValidateResponse          += new EventHandler <ValidationEventArgs>(validationRule9.Validate);
            }
            yield return(request10);

            request10 = null;
        }
コード例 #5
0
        public override IEnumerator <WebTestRequest> GetRequestEnumerator()
        {
            // Initialize validation rules that apply to all requests in the WebTest
            if ((this.Context.ValidationLevel >= Microsoft.VisualStudio.TestTools.WebTesting.ValidationLevel.Low))
            {
                ValidateResponseUrl validationRule1 = new ValidateResponseUrl();
                this.ValidateResponse += new EventHandler <ValidationEventArgs>(validationRule1.Validate);
            }

            WebTestRequest request1 = new WebTestRequest(hostURL + "/sites/productcatalog/category.aspx");

            request1.QueryStringParameters.Add("categoryid", categoryid, false, false);
            ExtractHiddenFields extractionRule1 = new ExtractHiddenFields();

            extractionRule1.Required             = true;
            extractionRule1.HtmlDecode           = true;
            extractionRule1.ContextParameterName = "1";
            request1.ExtractValues += new EventHandler <ExtractionEventArgs>(extractionRule1.Extract);
            ExtractHiddenFields extractionRule2 = new ExtractHiddenFields();

            extractionRule2.Required             = true;
            extractionRule2.HtmlDecode           = true;
            extractionRule2.ContextParameterName = "2";
            request1.ExtractValues += new EventHandler <ExtractionEventArgs>(extractionRule2.Extract);
            ExtractHiddenFields extractionRule3 = new ExtractHiddenFields();

            extractionRule3.Required             = true;
            extractionRule3.HtmlDecode           = true;
            extractionRule3.ContextParameterName = "3";
            request1.ExtractValues += new EventHandler <ExtractionEventArgs>(extractionRule3.Extract);

            //Extract CategoryDetail WebPart guid
            ExtractAttributeValue extractionRule23 = new ExtractAttributeValue();

            extractionRule23.TagName             = "div";
            extractionRule23.AttributeName       = "WebPartID";
            extractionRule23.MatchAttributeName  = "id";
            extractionRule23.MatchAttributeValue = "WebPartWPQ3";
            extractionRule23.HtmlDecode          = true;
            extractionRule23.Required            = true;
            extractionRule23.Index = 0;
            extractionRule23.ContextParameterName = "CategoryDetailWebPartGuid";
            request1.ExtractValues += new EventHandler <ExtractionEventArgs>(extractionRule23.Extract);

            //Extract CategoryList WebPart guid
            ExtractAttributeValue extractionRule33 = new ExtractAttributeValue();

            extractionRule33.TagName             = "div";
            extractionRule33.AttributeName       = "WebPartID";
            extractionRule33.MatchAttributeName  = "id";
            extractionRule33.MatchAttributeValue = "WebPartWPQ4";
            extractionRule33.HtmlDecode          = true;
            extractionRule33.Required            = true;
            extractionRule33.Index = 0;
            extractionRule33.ContextParameterName = "CategoryListWebPartGuid";
            request1.ExtractValues += new EventHandler <ExtractionEventArgs>(extractionRule33.Extract);

            //Extract CategoryList WebPart guid
            ExtractAttributeValue extractionRule43 = new ExtractAttributeValue();

            extractionRule43.TagName             = "div";
            extractionRule43.AttributeName       = "WebPartID";
            extractionRule43.MatchAttributeName  = "id";
            extractionRule43.MatchAttributeValue = "WebPartWPQ5";
            extractionRule43.HtmlDecode          = true;
            extractionRule43.Required            = true;
            extractionRule43.Index = 0;
            extractionRule43.ContextParameterName = "ProductListWebPartGuid";
            request1.ExtractValues += new EventHandler <ExtractionEventArgs>(extractionRule43.Extract);
            //Check for Root Category
            ValidationRuleFindText validationRule11 = new ValidationRuleFindText();

            validationRule11.FindText = @"<span><a class=""ms-sitemapdirectional"" href=""/sites/productcatalog/Category.aspx?CategoryId=0"">Root Category</a></span><span> &gt; </span><span class=""ms-sitemapdirectional"">Physician Equipment</span><a id=""ctl00_PlaceHolderMain_SiteMapPath1_SkipLink""></a></span>";
            //validationRule11.FindText = @"<span><a class=""ms-sitemapdirectional"" href=""/sites/productcatalog/Category.aspx?CategoryId=0"">Root Category</a></span><span> &gt; </span><span><a class=""ms-sitemapdirectional"" href=""/sites/productcatalog/Category.aspx?CategoryId=1"">Category 1</a></span><span> &gt; </span><span class=""ms-sitemapdirectional"">Category 3</span><a id=""ctl00_PlaceHolderMain_SiteMapPath1_SkipLink""></a></span>";
            validationRule11.IgnoreCase           = true;
            validationRule11.UseRegularExpression = false;
            validationRule11.PassIfTextFound      = true;
            request1.ValidateResponse            += new EventHandler <ValidationEventArgs>(validationRule11.Validate);

            //Check for Category Details Webpart title
            ValidationRuleFindText validationRule12 = new ValidationRuleFindText();

            validationRule12.FindText             = "Category Details";
            validationRule12.IgnoreCase           = true;
            validationRule12.UseRegularExpression = false;
            validationRule12.PassIfTextFound      = true;
            request1.ValidateResponse            += new EventHandler <ValidationEventArgs>(validationRule12.Validate);

            //Check for Category List Webpart title
            ValidationRuleFindText validationRule13 = new ValidationRuleFindText();

            validationRule13.FindText             = "Category List";
            validationRule13.IgnoreCase           = true;
            validationRule13.UseRegularExpression = false;
            validationRule13.PassIfTextFound      = true;
            request1.ValidateResponse            += new EventHandler <ValidationEventArgs>(validationRule13.Validate);

            //Check for Product List Webpart title
            ValidationRuleFindText validationRule14 = new ValidationRuleFindText();

            validationRule14.FindText             = "Product List";
            validationRule14.IgnoreCase           = true;
            validationRule14.UseRegularExpression = false;
            validationRule14.PassIfTextFound      = true;
            request1.ValidateResponse            += new EventHandler <ValidationEventArgs>(validationRule14.Validate);

            yield return(request1);

            string CategoryDetailWebPartGuid = Context["CategoryDetailWebPartGuid"].ToString();
            string CategoryListWebPartGuid   = Context["CategoryListWebPartGuid"].ToString();
            string ProductListWebPartGuid    = Context["ProductListWebPartGuid"].ToString();


            request1 = null;

            WebTestRequest request2 = new WebTestRequest(hostURL + "/sites/productcatalog/category.aspx");

            request2.Method = "POST";
            request2.QueryStringParameters.Add("categoryid", categoryid, false, false);
            FormPostHttpBody request2Body = new FormPostHttpBody();

            request2Body.FormPostParameters.Add("MSO_PageHashCode", this.Context["$HIDDEN1.MSO_PageHashCode"].ToString());
            request2Body.FormPostParameters.Add("MSOTlPn_SelectedWpId", this.Context["$HIDDEN1.MSOTlPn_SelectedWpId"].ToString());
            request2Body.FormPostParameters.Add("MSOTlPn_View", this.Context["$HIDDEN1.MSOTlPn_View"].ToString());
            request2Body.FormPostParameters.Add("MSOTlPn_ShowSettings", this.Context["$HIDDEN1.MSOTlPn_ShowSettings"].ToString());
            request2Body.FormPostParameters.Add("MSOGallery_SelectedLibrary", this.Context["$HIDDEN1.MSOGallery_SelectedLibrary"].ToString());
            request2Body.FormPostParameters.Add("MSOGallery_FilterString", this.Context["$HIDDEN1.MSOGallery_FilterString"].ToString());
            request2Body.FormPostParameters.Add("MSOTlPn_Button", this.Context["$HIDDEN1.MSOTlPn_Button"].ToString());
            request2Body.FormPostParameters.Add("__EVENTTARGET", this.Context["$HIDDEN1.__EVENTTARGET"].ToString());
            request2Body.FormPostParameters.Add("__EVENTARGUMENT", this.Context["$HIDDEN1.__EVENTARGUMENT"].ToString());
            request2Body.FormPostParameters.Add("__REQUESTDIGEST", this.Context["$HIDDEN1.__REQUESTDIGEST"].ToString());
            request2Body.FormPostParameters.Add("MSOSPWebPartManager_DisplayModeName", this.Context["$HIDDEN1.MSOSPWebPartManager_DisplayModeName"].ToString());
            request2Body.FormPostParameters.Add("MSOWebPartPage_Shared", this.Context["$HIDDEN1.MSOWebPartPage_Shared"].ToString());
            request2Body.FormPostParameters.Add("MSOLayout_LayoutChanges", this.Context["$HIDDEN1.MSOLayout_LayoutChanges"].ToString());
            request2Body.FormPostParameters.Add("MSOLayout_InDesignMode", this.Context["$HIDDEN1.MSOLayout_InDesignMode"].ToString());
            request2Body.FormPostParameters.Add("MSOSPWebPartManager_OldDisplayModeName", this.Context["$HIDDEN1.MSOSPWebPartManager_OldDisplayModeName"].ToString());
            request2Body.FormPostParameters.Add("MSOSPWebPartManager_StartWebPartEditingName", this.Context["$HIDDEN1.MSOSPWebPartManager_StartWebPartEditingName"].ToString());
            request2Body.FormPostParameters.Add("BDC_ActionsMenuProxyPageWebUrl", this.Context["$HIDDEN1.BDC_ActionsMenuProxyPageWebUrl"].ToString());
            request2Body.FormPostParameters.Add("__VIEWSTATE", this.Context["$HIDDEN1.__VIEWSTATE"].ToString());
            request2Body.FormPostParameters.Add("__spDummyText1", "");
            request2Body.FormPostParameters.Add("__spDummyText2", "");
            request2Body.FormPostParameters.Add("__CALLBACKID", "ctl00$m$g_" + CategoryDetailWebPartGuid.Replace("-", "_").ToString());
            request2Body.FormPostParameters.Add("__CALLBACKPARAM", "GetLongRunningUI");
            request2Body.FormPostParameters.Add("__EVENTVALIDATION", this.Context["$HIDDEN1.__EVENTVALIDATION"].ToString());
            request2.Body = request2Body;

            //Check for CategoryId
            ValidationRuleFindText validationRule21 = new ValidationRuleFindText();

            validationRule21.FindText             = @"<nobr>CategoryId:</nobr></td><td class=""ms-descriptiontext ms-alignleft"" width=""100%"">3</td>";
            validationRule21.IgnoreCase           = true;
            validationRule21.UseRegularExpression = false;
            validationRule21.PassIfTextFound      = true;
            request2.ValidateResponse            += new EventHandler <ValidationEventArgs>(validationRule21.Validate);

            //Check for CategoryName
            ValidationRuleFindText validationRule22 = new ValidationRuleFindText();

            validationRule22.FindText             = @"<nobr>Name:</nobr></td><td class=""ms-descriptiontext ms-alignleft"" width=""100%"">Physician Equipment</td>";
            validationRule22.IgnoreCase           = true;
            validationRule22.UseRegularExpression = false;
            validationRule22.PassIfTextFound      = true;
            request2.ValidateResponse            += new EventHandler <ValidationEventArgs>(validationRule22.Validate);
            //Check for ParentId
            ValidationRuleFindText validationRule23 = new ValidationRuleFindText();

            validationRule23.FindText             = @"<nobr>ParentId:</nobr></td><td class=""ms-descriptiontext ms-alignleft"" width=""100%"">0</td>";
            validationRule23.IgnoreCase           = true;
            validationRule23.UseRegularExpression = false;
            validationRule23.PassIfTextFound      = true;
            request2.ValidateResponse            += new EventHandler <ValidationEventArgs>(validationRule23.Validate);

            yield return(request2);

            request2 = null;

            WebTestRequest request3 = new WebTestRequest(hostURL + "/sites/productcatalog/category.aspx");

            request3.Method = "POST";
            request3.QueryStringParameters.Add("categoryid", categoryid, false, false);
            FormPostHttpBody request3Body = new FormPostHttpBody();

            request3Body.FormPostParameters.Add("MSO_PageHashCode", this.Context["$HIDDEN2.MSO_PageHashCode"].ToString());
            request3Body.FormPostParameters.Add("MSOTlPn_SelectedWpId", this.Context["$HIDDEN2.MSOTlPn_SelectedWpId"].ToString());
            request3Body.FormPostParameters.Add("MSOTlPn_View", this.Context["$HIDDEN2.MSOTlPn_View"].ToString());
            request3Body.FormPostParameters.Add("MSOTlPn_ShowSettings", this.Context["$HIDDEN2.MSOTlPn_ShowSettings"].ToString());
            request3Body.FormPostParameters.Add("MSOGallery_SelectedLibrary", this.Context["$HIDDEN2.MSOGallery_SelectedLibrary"].ToString());
            request3Body.FormPostParameters.Add("MSOGallery_FilterString", this.Context["$HIDDEN2.MSOGallery_FilterString"].ToString());
            request3Body.FormPostParameters.Add("MSOTlPn_Button", this.Context["$HIDDEN2.MSOTlPn_Button"].ToString());
            request3Body.FormPostParameters.Add("__EVENTTARGET", this.Context["$HIDDEN2.__EVENTTARGET"].ToString());
            request3Body.FormPostParameters.Add("__EVENTARGUMENT", this.Context["$HIDDEN2.__EVENTARGUMENT"].ToString());
            request3Body.FormPostParameters.Add("__REQUESTDIGEST", this.Context["$HIDDEN2.__REQUESTDIGEST"].ToString());
            request3Body.FormPostParameters.Add("MSOSPWebPartManager_DisplayModeName", this.Context["$HIDDEN2.MSOSPWebPartManager_DisplayModeName"].ToString());
            request3Body.FormPostParameters.Add("MSOWebPartPage_Shared", this.Context["$HIDDEN2.MSOWebPartPage_Shared"].ToString());
            request3Body.FormPostParameters.Add("MSOLayout_LayoutChanges", this.Context["$HIDDEN2.MSOLayout_LayoutChanges"].ToString());
            request3Body.FormPostParameters.Add("MSOLayout_InDesignMode", this.Context["$HIDDEN2.MSOLayout_InDesignMode"].ToString());
            request3Body.FormPostParameters.Add("MSOSPWebPartManager_OldDisplayModeName", this.Context["$HIDDEN2.MSOSPWebPartManager_OldDisplayModeName"].ToString());
            request3Body.FormPostParameters.Add("MSOSPWebPartManager_StartWebPartEditingName", this.Context["$HIDDEN2.MSOSPWebPartManager_StartWebPartEditingName"].ToString());
            request3Body.FormPostParameters.Add("BDC_ActionsMenuProxyPageWebUrl", this.Context["$HIDDEN2.BDC_ActionsMenuProxyPageWebUrl"].ToString());
            request3Body.FormPostParameters.Add("__VIEWSTATE", this.Context["$HIDDEN2.__VIEWSTATE"].ToString());
            request3Body.FormPostParameters.Add("__spDummyText1", "");
            request3Body.FormPostParameters.Add("__spDummyText2", "");
            request3Body.FormPostParameters.Add("__CALLBACKID", "ctl00$m$g_" + CategoryListWebPartGuid.Replace("-", "_").ToString());
            request3Body.FormPostParameters.Add("__CALLBACKPARAM", "GetLongRunningUI");
            request3Body.FormPostParameters.Add("__EVENTVALIDATION", this.Context["$HIDDEN2.__EVENTVALIDATION"].ToString());

            request3.Body = request3Body;
            // Validate Pediatric is on this page
            ValidationRuleFindText validationRule31 = new ValidationRuleFindText();

            validationRule31.FindText             = "Pediatric";
            validationRule31.IgnoreCase           = true;
            validationRule31.UseRegularExpression = false;
            validationRule31.PassIfTextFound      = true;
            request3.ValidateResponse            += new EventHandler <ValidationEventArgs>(validationRule31.Validate);


            // Validate Exercise Therapy is on this page
            ValidationRuleFindText validationRule32 = new ValidationRuleFindText();

            validationRule32.FindText             = "Exercise Therapy";
            validationRule32.IgnoreCase           = true;
            validationRule32.UseRegularExpression = false;
            validationRule32.PassIfTextFound      = true;
            request3.ValidateResponse            += new EventHandler <ValidationEventArgs>(validationRule32.Validate);


            yield return(request3);

            request3 = null;

            WebTestRequest request4 = new WebTestRequest(hostURL + "/sites/productcatalog/category.aspx");

            request4.Method = "POST";
            categoryid      = "12";
            request4.QueryStringParameters.Add("categoryid", categoryid, false, false);
            FormPostHttpBody request4Body = new FormPostHttpBody();

            request4Body.FormPostParameters.Add("MSO_PageHashCode", this.Context["$HIDDEN3.MSO_PageHashCode"].ToString());
            request4Body.FormPostParameters.Add("MSOTlPn_SelectedWpId", this.Context["$HIDDEN3.MSOTlPn_SelectedWpId"].ToString());
            request4Body.FormPostParameters.Add("MSOTlPn_View", this.Context["$HIDDEN3.MSOTlPn_View"].ToString());
            request4Body.FormPostParameters.Add("MSOTlPn_ShowSettings", this.Context["$HIDDEN3.MSOTlPn_ShowSettings"].ToString());
            request4Body.FormPostParameters.Add("MSOGallery_SelectedLibrary", this.Context["$HIDDEN3.MSOGallery_SelectedLibrary"].ToString());
            request4Body.FormPostParameters.Add("MSOGallery_FilterString", this.Context["$HIDDEN3.MSOGallery_FilterString"].ToString());
            request4Body.FormPostParameters.Add("MSOTlPn_Button", this.Context["$HIDDEN3.MSOTlPn_Button"].ToString());
            request4Body.FormPostParameters.Add("__EVENTTARGET", this.Context["$HIDDEN3.__EVENTTARGET"].ToString());
            request4Body.FormPostParameters.Add("__EVENTARGUMENT", this.Context["$HIDDEN3.__EVENTARGUMENT"].ToString());
            request4Body.FormPostParameters.Add("__REQUESTDIGEST", this.Context["$HIDDEN3.__REQUESTDIGEST"].ToString());
            request4Body.FormPostParameters.Add("MSOSPWebPartManager_DisplayModeName", this.Context["$HIDDEN3.MSOSPWebPartManager_DisplayModeName"].ToString());
            request4Body.FormPostParameters.Add("MSOWebPartPage_Shared", this.Context["$HIDDEN3.MSOWebPartPage_Shared"].ToString());
            request4Body.FormPostParameters.Add("MSOLayout_LayoutChanges", this.Context["$HIDDEN3.MSOLayout_LayoutChanges"].ToString());
            request4Body.FormPostParameters.Add("MSOLayout_InDesignMode", this.Context["$HIDDEN3.MSOLayout_InDesignMode"].ToString());
            request4Body.FormPostParameters.Add("MSOSPWebPartManager_OldDisplayModeName", this.Context["$HIDDEN3.MSOSPWebPartManager_OldDisplayModeName"].ToString());
            request4Body.FormPostParameters.Add("MSOSPWebPartManager_StartWebPartEditingName", this.Context["$HIDDEN3.MSOSPWebPartManager_StartWebPartEditingName"].ToString());
            request4Body.FormPostParameters.Add("BDC_ActionsMenuProxyPageWebUrl", this.Context["$HIDDEN3.BDC_ActionsMenuProxyPageWebUrl"].ToString());
            request4Body.FormPostParameters.Add("__VIEWSTATE", this.Context["$HIDDEN3.__VIEWSTATE"].ToString());
            request4Body.FormPostParameters.Add("__spDummyText1", "");
            request4Body.FormPostParameters.Add("__spDummyText2", "");
            request4Body.FormPostParameters.Add("__CALLBACKID", "ctl00$m$g_" + ProductListWebPartGuid.Replace("-", "_").ToString());
            request4Body.FormPostParameters.Add("__CALLBACKPARAM", "GetLongRunningUI");
            request4Body.FormPostParameters.Add("__EVENTVALIDATION", this.Context["$HIDDEN3.__EVENTVALIDATION"].ToString());
            request4.Body = request4Body;

            //check for that their is a Image to show
            ValidationRuleFindText validationRule41 = new ValidationRuleFindText();

            validationRule41.FindText             = @"<img src=""" + CustConfig.GetLOBServicesURL + "/images/walker.jpg\">";
            validationRule41.IgnoreCase           = true;
            validationRule41.UseRegularExpression = false;
            validationRule41.PassIfTextFound      = true;
            request4.ValidateResponse            += new EventHandler <ValidationEventArgs>(validationRule41.Validate);

            yield return(request4);

            request4 = null;
        }