当前位置: 首页>>代码示例>>C#>>正文


C# Browser.CheckBox方法代码示例

本文整理汇总了C#中Browser.CheckBox方法的典型用法代码示例。如果您正苦于以下问题:C# Browser.CheckBox方法的具体用法?C# Browser.CheckBox怎么用?C# Browser.CheckBox使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Browser的用法示例。


在下文中一共展示了Browser.CheckBox方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RegisterUserOrderPaymentInfo

        public void RegisterUserOrderPaymentInfo(Browser browser)
        {
            browser.WaitUntilContainsText("Step 4: Enter Payment Information");

            browser.TextField(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_txt_user_firstname")).TypeText("christie");

            browser.TextField(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_txt_user_lastname")).TypeText("Test");

            browser.TextField(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_txt_user_addr")).TypeText("zhongshanbeiroad");

            browser.TextField(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_txt_user_city")).TypeText("shanghai");

            browser.SelectList(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_dl_user_state")).Option(Find.ByValue("AL")).Select();
            browser.TextField(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_txt_user_zip")).TypeText("11111");

            browser.TextField(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_ux_phone")).TypeText("1111111111");
            //browser.TextField(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_ux_phone")).DoubleClick();
            browser.TextField(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_ux_phone")).Focus();

            browser.TextField(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_txt_user_email")).TypeText("[email protected]");

            browser.TextField(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_txt_order_description")).TypeText("ordertest"+Date);
            browser.CheckBox(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_chbAgreement")).Checked = true;
            browser.CheckBox(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_chb_contactinfo")).Checked = true;
            browser.SelectList(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_dl_pay_year")).Option("2011").Select();

            browser.TextField(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_txt_pay_account")).TypeText("4111111111111111");

            browser.TextField(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_txt_pay_cid")).TypeText("111");
            browser.Link(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_BottomBtNext")).Click();

            browser.WaitUntilContainsText("Your Order Is Complete");
            Assert.IsTrue(browser.ContainsText("Your Order Is Complete"));
        }
开发者ID:nirvana-info,项目名称:old_bak,代码行数:34,代码来源:OrderPaymentInfo.cs

示例2: TestUserOrderSelectDemo3

        public void TestUserOrderSelectDemo3(Browser browser)
        {
            browser.WaitUntilContainsText("Define Target Audience");
            Assert.IsTrue(browser.ContainsText("Define Target Audience"));

            //browser.SelectList(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_ltbDemCat")).Option(Find.ByText("Estimated Income")).Select();

            browser.CheckBox(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_chbAllHousehold")).Checked = true;
            browser.Div(Find.ById("divWaiting")).WaitUntilRemoved();
            browser.RadioButton(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_rb_phoneNothing")).Checked = true;
            browser.Span(Find.ByText("Next")).Click();
        }
开发者ID:nirvana-info,项目名称:old_bak,代码行数:12,代码来源:OrderSelectDemo_NewHomeowner.cs

示例3: TestUserchangesourcetype

        public void TestUserchangesourcetype(Browser browser, string pricetype)
        {
            browser.Link(Find.ByText("资源数据维护")).Click();
            browser.WaitUntilContainsText("本页可进行已挂资源价格修改");
            Assert.IsTrue(browser.ContainsText("本页可进行已挂资源价格修改"));

            browser.CheckBox(Find.ByName("ckbLotMaster")).Checked = true;
            //browser.SelectList(Find.ById("ctl00_ContentPlaceHolder1_gvLotMaster_ctl02_ddlPricetype")).Option(Find.ByText(pricetype)).Select();
            browser.Button(Find.ById("ctl00_ContentPlaceHolder1_btnEditType")).Click();

            browser.Frame(Find.ById("wheatmsg_ifrm")).SelectList(Find.ById("ddlPriceType")).Option(Find.ByValue(pricetype)).Select();
            browser.Frame(Find.ById("wheatmsg_ifrm")).Button(Find.ById("btnYes")).Click();
            /*WatiN.Core.DialogHandlers.ConfirmDialogHandler dh = new WatiN.Core.DialogHandlers.ConfirmDialogHandler();

            browser.AddDialogHandler(dh);

            browser.Button(Find.ById("ctl00_ContentPlaceHolder1_btnEditType")).ClickNoWait();
            dh.WaitUntilExists(15);//
            dh.OKButton.Click();//
            browser.RemoveDialogHandler(dh);*/
        }
开发者ID:nirvana-info,项目名称:old_bak,代码行数:21,代码来源:changesourcetype.cs

示例4: NCOAOrders

        public void NCOAOrders(Browser browser,String FileType, string HostPath)
        {
            if (HostPath == "u")
            {
                OpenTargetUrl(targetHost + "sl360",browser);
            }
            else
            {
                OpenTargetUrl(targetHost+"salesleads360",browser);

                //userlogin
                Login login = new Login();
                login.userlogin(CountEmail, CountPW, browser);

            }

            browser.Link("aMainMenu1").WaitUntilExists(60);
            browser.Link("aMainMenu1").ClickNoWait();
            browser.Span(Find.ByText("NCOA")).WaitUntilExists(60);
            browser.Image("ctl00_ctl00_uxContent_ContentPlaceHolder1_ibStartNow").ClickNoWait();
            browser.FileUpload("ctl00_ctl00_uxContent_ContentPlaceHolder1_fuFile").WaitUntilExists(60);

            browser.FileUpload("ctl00_ctl00_uxContent_ContentPlaceHolder1_fuFile").Set(UploadLeadsPath);
            if (FileType == "c")
            {
                browser.RadioButton("ctl00_ctl00_uxContent_ContentPlaceHolder1_rblListType_0").Checked = true;
            }
            else
            {
                browser.RadioButton("ctl00_ctl00_uxContent_ContentPlaceHolder1_rblListType_1").Checked = true;
            }

            browser.Link("ctl00_ctl00_uxContent_ContentPlaceHolder1_BottomBtNext").Click();
            browser.Link("ctl00_ctl00_uxContent_ContentPlaceHolder1_BottomBtNext").Click();

            browser.CheckBox("ctl00_ctl00_uxContent_ContentPlaceHolder1_sOptions_cbOption1").Checked = true;
        }
开发者ID:nirvana-info,项目名称:old_bak,代码行数:37,代码来源:NCOAOrder.cs

示例5: NewContact

        /// <summary>
        ///  Method Creates a New User on the Admin -> New User page. 
        /// Will Save if save == true else will flash the Save button.
        /// Contact Info is stored in Contacts XML. Method requires GMSAddContact.xml be created. 
        /// </summary>
        /// <param name="browser">WatiN Browser Object</param>
        /// <param name="configpath">Path to Config File GMSAddContact.xml</param>
        /// <param name="save">Save Value true will save false will cancel</param>
        public void NewContact(Browser browser, string configpath, bool save)
        {
            //TODO:  Possibly streamline this method

            #region XMLDoc
            XmlDocument admindoc = new XmlDocument();
            admindoc.Load(configpath);

            XmlNodeList xl = admindoc.SelectNodes("//GMSAddContact/contact");

            #endregion

            foreach (XmlNode xn in xl)
            {

                string companynumber = xn["conum"].InnerText;
                string scac = xn["scac"].InnerText;
                string name = xn["name"].InnerText;
                string efrom = xn["effectivefrom"].InnerText;
                string eto = xn["effectiveto"].InnerText;
                string addy1 = xn["addy1"].InnerText;
                string addy2 = xn["addy2"].InnerText;
                string addy3 = xn["addy3"].InnerText;
                string addy4 = xn["addy4"].InnerText;
                string city = xn["city"].InnerText;
                string state = xn["state"].InnerText;
                string zip = xn["zip"].InnerText;
                string fname = xn["fname"].InnerText;
                string lname = xn["lname"].InnerText;
                string title = xn["title"].InnerText;
                string phone = xn["phone"].InnerText;
                string fax = xn["fax"].InnerText;
                string email = xn["email"].InnerText;
                string invoiceformat = xn["invoiceformat"].InnerText;
                string invoicedelivery = xn["invoicedelivery"].InnerText;
                string railinc = xn["railinc"].InnerText;
                string includebr = xn["includebr"].InnerText;
                string gbentity = xn["gbentity"].InnerText;
                string additionalscac = xn["additionalscac"].InnerText;

                browser.Button(Find.ById(new Regex("ctl00_MainContent_NewButton"))).Click();
                browser.WaitUntilContainsText("Effective From");

                // Company Info

                browser.TextField(Find.ById(new Regex("ctl00_MainContent_ASPxRoundPanel1_CompanyCodeCtl"))).SetAttributeValue("value", companynumber);
                browser.TextField(Find.ById(new Regex("ctl00_MainContent_ASPxRoundPanel1_ScacCtl"))).SetAttributeValue("value", scac);
                browser.TextField(Find.ById(new Regex("ctl00_MainContent_ASPxRoundPanel1_NameCtl"))).SetAttributeValue("value", name);
                browser.TextField(Find.ById(new Regex("ctl00_MainContent_ASPxRoundPanel1_EffectiveFromCtl"))).TypeText(efrom);
                browser.TextField(Find.ById(new Regex("ctl00_MainContent_ASPxRoundPanel1_EffectiveThruCtl"))).TypeText(eto);

                // Address Info
                browser.TextField(Find.ById(new Regex("ctl00_MainContent_ASPxRoundPanel1_Address1Ctl"))).SetAttributeValue("value", addy1);
                browser.TextField(Find.ById(new Regex("ctl00_MainContent_ASPxRoundPanel1_Address2Ctl"))).SetAttributeValue("value", addy2);
                browser.TextField(Find.ById(new Regex("ctl00_MainContent_ASPxRoundPanel1_Address3Ctl"))).SetAttributeValue("value", addy3);
                browser.TextField(Find.ById(new Regex("ctl00_MainContent_ASPxRoundPanel1_Address4Ctl"))).SetAttributeValue("value", addy4);
                browser.TextField(Find.ById(new Regex("ctl00_MainContent_ASPxRoundPanel1_CityCtl"))).SetAttributeValue("value", city);
                browser.TextField(Find.ById(new Regex("ctl00_MainContent_ASPxRoundPanel1_StateCtl"))).SetAttributeValue("value", state);
                browser.TextField(Find.ById(new Regex("ctl00_MainContent_ASPxRoundPanel1_ZipCtl"))).SetAttributeValue("value", zip);

                // Detail Info

                browser.TextField(Find.ById(new Regex("ctl00_MainContent_ASPxRoundPanel1_FirstNameCtl"))).SetAttributeValue("value", fname);
                browser.TextField(Find.ById(new Regex("ctl00_MainContent_ASPxRoundPanel1_LastNameCtl"))).SetAttributeValue("value", lname);
                browser.TextField(Find.ById(new Regex("ctl00_MainContent_ASPxRoundPanel1_TitleCtl"))).SetAttributeValue("value", title);
                browser.TextField(Find.ById(new Regex("ctl00_MainContent_ASPxRoundPanel1_PhoneCtl"))).SetAttributeValue("value", phone);
                browser.TextField(Find.ById(new Regex("ctl00_MainContent_ASPxRoundPanel1_FaxCtl"))).SetAttributeValue("value", fax);
                browser.TextField(Find.ById(new Regex("ctl00_MainContent_ASPxRoundPanel1_EmailCtl"))).SetAttributeValue("value", email);

                // Artifacts

                browser.SelectList(Find.ById(new Regex("ctl00_MainContent_ASPxRoundPanel1_InvoiceFormatCtl"))).Select(invoiceformat);
                browser.SelectList(Find.ById(new Regex("ctl00_MainContent_ASPxRoundPanel1_InvoiceDeliveryCtl"))).Select(invoicedelivery);

                if (railinc.Equals("Y"))
                {

                    browser.CheckBox(Find.ById(new Regex("ctl00_MainContent_ASPxRoundPanel1_RailincCtl"))).Checked = true;

                }

                if (includebr.Equals("Y"))
                {

                    browser.CheckBox(Find.ById(new Regex("ctl00_MainContent_ASPxRoundPanel1_IncludeBrcCtl"))).Checked = true;

                }

                if (gbentity.Equals("Y"))
                {

                    browser.CheckBox(Find.ById(new Regex("ctl00_MainContent_ASPxRoundPanel1_GBEntityCtl"))).Checked = true;
//.........这里部分代码省略.........
开发者ID:johnbcook,项目名称:automation-samples,代码行数:101,代码来源:AdminCommon.cs

示例6: ShowAll

 /// <summary>
 /// Method sets the ShowAll checkbox.  
 /// true = checked
 /// </summary>
 /// <param name="browser">WatiN Browser Object</param>
 /// <param name="all"></param>
 public void ShowAll(Browser browser, bool all)
 {
     browser.CheckBox(Find.ByLabelText("ShowAll")).Checked = all;
 }
开发者ID:johnbcook,项目名称:automation-samples,代码行数:10,代码来源:AdminCommon.cs

示例7: SearchWorkSpec

        /// <summary>
        /// Method to Search for a Work Specification
        /// </summary>
        /// <param name="browser">WatiN Browser Object</param>
        /// <param name="code">Code Value</param>
        /// <param name="description">Description Value</param>
        /// <param name="shop">Shop Value</param>
        /// <param name="company">Company Value</param>
        /// <param name="includeinactive">Include Inactive Value</param>
        public void SearchWorkSpec(Browser browser, string code, string description, string shop, string company,  bool includeinactive)
        {
            try
            {
                browser.TextField(Find.ById(new Regex("ctl00_MainContent_SearchPanel_SpecCodeTextBox"))).SetAttributeValue("value", code);
                browser.TextField(Find.ById(new Regex("ctl00_MainContent_SearchPanel_SpecNameTextBox"))).SetAttributeValue("value", description);

                if (!shop.Equals(""))
                {
                    SelectWSShop(browser, shop);

                }

                if (!company.Equals(""))
                {
                    SelectWSCompany(browser, company);
                }

                browser.CheckBox(Find.ById(new Regex("ctl00_MainContent_SearchPanel_InactiveCheckBox"))).Checked = includeinactive;
                browser.Button(Find.ById(new Regex("ctl00_MainContent_SearchPanel_SearchButton"))).Click();

            }
            catch
            {

                browser.Close();

            }
        }
开发者ID:johnbcook,项目名称:automation-samples,代码行数:38,代码来源:AdminCommon.cs

示例8: SearchWarrantyVendors

        /// <summary>
        /// Performs a Search for Admin Warranty Vendors
        /// </summary>
        /// <param name="browser">WatiN Browser Object</param>
        /// <param name="code"></param>
        /// <param name="name"></param>
        /// <param name="includeinactive"></param>
        public void SearchWarrantyVendors(Browser browser, string code, string name, bool includeinactive)
        {
            try
            {
                browser.TextField(Find.ById(new Regex("ctl00_MainContent_SearchRoundPanel_CompanyCodeTextBox"))).SetAttributeValue("value", code);
                browser.TextField(Find.ById(new Regex("ctl00_MainContent_SearchRoundPanel_CompanyNameTextBox"))).SetAttributeValue("value", name);
                browser.CheckBox(Find.ByLabelText("Include Inactive")).Checked = includeinactive;

                browser.Button(Find.ById(new Regex("ctl00_MainContent_SearchRoundPanel_SearchButton"))).Click();

            }
            catch
            {

                browser.Close();

            }
        }
开发者ID:johnbcook,项目名称:automation-samples,代码行数:25,代码来源:AdminCommon.cs

示例9: SearchUser

        /// <summary>
        /// Method performs a Search for a User on the Admin -> Search User page. 
        /// </summary>
        /// <param name="browser">WatiN Browser Object</param>
        /// <param name="firstname">First Name Value</param>
        /// <param name="lastname">Last Name Value</param>
        /// <param name="username">User Name Value</param>
        /// <param name="includeinactive">Will set Include Inactive Checked value</param>
        public void SearchUser(Browser browser, string firstname, string lastname, string username, bool includeinactive)
        {
            try
            {
                browser.TextField(Find.ById(new Regex("ctl00_MainContent_ASPxRoundPanel2_FirstNameTextBox"))).SetAttributeValue("value", firstname);
                browser.TextField(Find.ById(new Regex("ctl00_MainContent_ASPxRoundPanel2_LastNameTextBox"))).SetAttributeValue("value", lastname);
                browser.TextField(Find.ById(new Regex("ctl00_MainContent_ASPxRoundPanel2_UserCodeTextBox"))).TypeText(username);
                browser.CheckBox(Find.ById(new Regex("ctl00_MainContent_ASPxRoundPanel2_IncludeInactiveCheckBox"))).Checked = includeinactive;
                browser.Button(Find.ById(new Regex("ctl00_MainContent_ASPxRoundPanel2_Button1"))).Click();

                browser.Refresh();
            }
            catch
            {

                browser.Close();

            }
        }
开发者ID:johnbcook,项目名称:automation-samples,代码行数:27,代码来源:AdminCommon.cs

示例10: SearchJobCode

        /// <summary>
        /// Method to search Admin Labor Standards by a specific job code
        /// </summary>
        /// <param name="browser">WatiN Browser Object</param>
        /// <param name="code">Code Value</param>
        /// <param name="includeinactive">Include Inactive Value</param>
        /// 
        public void SearchJobCode(Browser browser, string code, bool includeinactive)
        {
            try
            {
                browser.TextField(Find.ById(new Regex("ctl00_MainContent_RoundSearchPanel_JCEdit"))).SetAttributeValue("value", code);
                browser.CheckBox(Find.ById(new Regex("ctl00_MainContent_RoundSearchPanel_IncludeExpired"))).Checked = includeinactive;

                browser.Button(Find.ById(new Regex("ctl00_MainContent_RoundSearchPanel_SubmitSearch"))).Click();

            }
            catch
            {

                browser.Close();

            }
        }
开发者ID:johnbcook,项目名称:automation-samples,代码行数:24,代码来源:AdminCommon.cs

示例11: SearchExceptionReasons

 /// <summary>
 /// Method to search Admin Search Exception Reasons
 /// </summary>
 /// <param name="browser">WatiN Browser Object</param>
 /// <param name="code">Code Value</param>
 /// <param name="description">Description Value</param>
 /// <param name="category">Category Value</param>
 /// <param name="includeinactive">Include Inactive Value</param>
 /// 
 public void SearchExceptionReasons(Browser browser, string code, string description, string category, bool includeinactive)
 {
     browser.TextField(Find.ById(new Regex("ctl00_MainContent_SearchRoundPanel_ReasonCodeTextBox"))).SetAttributeValue("value", code);
         browser.TextField(Find.ById(new Regex("ctl00_MainContent_SearchRoundPanel_DescriptionTextBox"))).SetAttributeValue("value", description);
         browser.SelectList(Find.ById(new Regex("ctl00_MainContent_SearchRoundPanel_CategoryDropDownList"))).Select(category.Trim());
         browser.CheckBox(Find.ById(new Regex("ctl00_MainContent_SearchRoundPanel_InactiveCheckBox"))).Checked = includeinactive;
         browser.Button(Find.ById(new Regex("ctl00_MainContent_SearchRoundPanel_SearchButton"))).Click();
 }
开发者ID:johnbcook,项目名称:automation-samples,代码行数:17,代码来源:AdminCommon.cs

示例12: SearchContacts

 /// <summary>
 /// Method to Search Admin Contacts
 /// </summary>
 /// <param name="browser">WatiN Browser Object</param>
 /// <param name="companyname"></param>
 /// <param name="scac"></param>
 /// <param name="companynumber"></param>
 /// <param name="includeinactive"></param>
 public void SearchContacts(Browser browser, string companyname, string scac, string companynumber, bool includeinactive)
 {
     browser.TextField(Find.ById(new Regex("ctl00_MainContent_RoundSearchPanel_CompanyDropDownTextBox"))).SetAttributeValue("value", companyname);
     browser.TextField(Find.ById(new Regex("ctl00_MainContent_RoundSearchPanel_ScacEdit"))).SetAttributeValue("value", scac);
     browser.TextField(Find.ById(new Regex("ctl00_MainContent_RoundSearchPanel_CompanyNumberDropDownTextBox"))).SetAttributeValue("value", companynumber);
     browser.CheckBox(Find.ById(new Regex("ctl00_MainContent_RoundSearchPanel_IncludeExpired"))).Checked = includeinactive;
     browser.Button(Find.ById(new Regex("ctl00_MainContent_RoundSearchPanel_SubmitSearch"))).Click();
 }
开发者ID:johnbcook,项目名称:automation-samples,代码行数:16,代码来源:AdminCommon.cs

示例13: NewUserSave

        /// <summary>
        /// Method Creates a New User on the Admin -> New User page. 
        /// Will Save if save == true else will flash the Save button.
        /// </summary>
        /// <param name="browser">WatiN Browser Object</param>
        /// <param name="firstname">First Name Value</param>
        /// <param name="mi">Middle Initial Value</param>
        /// <param name="lastname">Last Name Value</param>
        /// <param name="username">User Name Value</param>
        /// <param name="language">Language Value</param>
        /// <param name="approvallimit">Approval Limit Value</param>
        /// <param name="efrom">Effective From Value</param>
        /// <param name="eto">Effective To Value</param>
        /// <param name="isinternal">Sets Is Internal Checkbox to value</param>
        /// <param name="role">Role Value</param>
        /// <param name="password">Password Value</param>
        /// <param name="save">Save flag  true will save false will flash</param>
        public void NewUserSave(Browser browser, string firstname, string mi, string lastname,
                            string username, string language, string approvallimit,
                            string efrom, string eto, bool isinternal, string role, string password, bool save)
        {
            // TODO:  Make these separate methods.
            browser.Button(Find.ById(new Regex("ctl00_MainContent_NewUserButton"))).Click();
            browser.WaitUntilContainsText("Add New User");

            // Enter Names
            browser.TextField(Find.ById(new Regex("ctl00_MainContent_ASPxRoundPanel2_ASPxRoundPanel1_FirstNameTextBox_I"))).SetAttributeValue("value", firstname);
            browser.TextField(Find.ById(new Regex("ctl00_MainContent_ASPxRoundPanel2_ASPxRoundPanel1_MiddleInitialTextBox_I"))).SetAttributeValue("value", mi);
            browser.TextField(Find.ById(new Regex("ctl00_MainContent_ASPxRoundPanel2_ASPxRoundPanel1_LastNameTextBox_I"))).SetAttributeValue("value", lastname);
            browser.TextField(Find.ById(new Regex("ctl00_MainContent_ASPxRoundPanel2_ASPxRoundPanel1_UserCodeTextBox_I"))).SetAttributeValue("value", username);

            if (!language.Equals(""))
            {

                SelectLanguage(browser, language);

            }

            browser.TextField(Find.ById(new Regex("ctl00_MainContent_ASPxRoundPanel2_ASPxRoundPanel1_ApprovalLimitTextBox_I"))).SetAttributeValue("value", approvallimit);
            browser.TextField(Find.ById(new Regex("ctl00_MainContent_ASPxRoundPanel2_ASPxRoundPanel1_EffectiveFromDateEdit_I"))).FireEventNoWait("onkeydown");
            browser.TextField(Find.ById(new Regex("ctl00_MainContent_ASPxRoundPanel2_ASPxRoundPanel1_EffectiveFromDateEdit_I"))).TypeText(efrom);
            browser.TextField(Find.ById(new Regex("ctl00_MainContent_ASPxRoundPanel2_ASPxRoundPanel1_EffectiveFromDateEdit_I"))).FireEventNoWait("onkeydown");
            browser.TextField(Find.ById(new Regex("ctl00_MainContent_ASPxRoundPanel2_ASPxRoundPanel1_EffectiveThruDateEdit_I"))).TypeText(eto);
            browser.CheckBox(Find.ById(new Regex("ctl00_MainContent_ASPxRoundPanel2_ASPxRoundPanel1_InternalCheckBox_I"))).Checked = isinternal;

            browser.WaitForComplete();

            if (isinternal == false)
            {

                browser.TextField(Find.ById(new Regex("ctl00_MainContent_ASPxRoundPanel2_ASPxRoundPanel1_UserPasswordTextBox_I"))).SetAttributeValue("value", password);

            }

            browser.CheckBox(Find.ByLabelText(role)).Checked = true;

            // TODO  Add Save Button

            if (save == true)
            {

                browser.Button(Find.ById(new Regex("ctl00_MainContent_ASPxRoundPanel2_SaveButton"))).Click();
            }
            else
            {

                browser.Button(Find.ById(new Regex("ctl00_MainContent_ASPxRoundPanel2_SaveButton"))).Flash();

            }
        }
开发者ID:johnbcook,项目名称:automation-samples,代码行数:70,代码来源:AdminCommon.cs

示例14: TestUsersales

        public void TestUsersales(Browser browser,string bigsource,string littlesource,string size,string material,string made,string weight,string price,string date1,string date,string storehouse)
        {
            //#*****************************************************************************
            //# Purpose: define User sales function.
            //# Author:  bobby
            //# Last Modify: apr 13, 2009
            //#*****************************************************************************

            browser.Link(Find.ById("ctl00_linkTrade")).Click();
            browser.WaitUntilContainsText("请在左边的菜单选择您要进行的操作。 如有疑问,请点击下面相关链接查看操作流程图或查看交易指南");
            Assert.IsTrue(browser.ContainsText("请在左边的菜单选择您要进行的操作。 如有疑问,请点击下面相关链接查看操作流程图或查看交易指南"));

            browser.Link(Find.ByText("我要销售")).Click();
            browser.WaitUntilContainsText("请在左边的菜单选择您要进行的操作。 如有疑问,请点击下面相关链接查看操作流程图或查看交易指南");
            Assert.IsTrue(browser.ContainsText("请在左边的菜单选择您要进行的操作。 如有疑问,请点击下面相关链接查看操作流程图或查看交易指南"));

            browser.Link(Find.ByText("资源挂牌")).Click();
            browser.WaitUntilContainsText("可选择以下两种上传方式");
            Assert.IsTrue(browser.ContainsText("可选择以下两种上传方式"));
            //清空失误
            if (browser.Link(Find.ById("ctl00_ContentPlaceHolder1_GridView1_ctl02_edititem")).Exists)
            {
                WatiN.Core.DialogHandlers.ConfirmDialogHandler dh1 = new WatiN.Core.DialogHandlers.ConfirmDialogHandler();

                browser.AddDialogHandler(dh1);

                browser.Button(Find.ByValue("全部删除")).ClickNoWait();
                dh1.WaitUntilExists(15);//

                dh1.OKButton.Click();//
                dh1.WaitUntilExists(15);

                dh1.OKButton.Click();
                browser.RemoveDialogHandler(dh1);

            }

                browser.Image(Find.ByAlt("在线上传")).Click();
                browser.WaitUntilContainsText("提示:此处显示所选品种的规格填写规则,单位 为毫米");
                Assert.IsTrue(browser.ContainsText("提示:此处显示所选品种的规格填写规则,单位 为毫米"));
                //大品种
                browser.SelectList(Find.ById("ctl00_ContentPlaceHolder1_cmbCategory")).Option(bigsource).Select();
                browser.WaitUntilContainsText(bigsource);
                Assert.IsTrue(browser.ContainsText(bigsource));
                //小品种
                browser.SelectList(Find.ById("ctl00_ContentPlaceHolder1_cmbProductName")).Option(littlesource).Select();
                browser.WaitUntilContainsText(littlesource);
                Assert.IsTrue(browser.ContainsText(littlesource));
                //规格
                browser.TextField(Find.ById("ctl00_ContentPlaceHolder1_gg_h")).TypeText(size);
                browser.TextField(Find.ById("ctl00_ContentPlaceHolder1_gg_k")).TypeText(size);
                browser.TextField(Find.ById("ctl00_ContentPlaceHolder1_gg_c")).TypeText(size);
                //材质
                browser.TextField(Find.ById("ctl00_ContentPlaceHolder1_cz")).TypeText(material + date1);
                //厂家
                browser.TextField(Find.ById("ctl00_ContentPlaceHolder1_sccj")).TypeText(made + date1);
                //重量
                browser.TextField(Find.ById("ctl00_ContentPlaceHolder1_weight")).TypeText(weight);
                //价格
                browser.TextField(Find.ById("ctl00_ContentPlaceHolder1_price")).TypeText(price);
                //日期
                browser.TextField(Find.ById("ctl00_ContentPlaceHolder1_manufacturedate")).TypeText(date);
                //仓库
                browser.SelectList(Find.ById("ctl00_ContentPlaceHolder1_cmblistck")).Option(storehouse).Select();
                browser.WaitUntilContainsText(storehouse);
                Assert.IsTrue(browser.ContainsText(storehouse));
                //确定资源录入
                browser.Button(Find.ById("ctl00_ContentPlaceHolder1_Button2")).Click();
                //挂牌
                browser.CheckBox(Find.ById("ctl00_ContentPlaceHolder1_GridView1_ctl02_gv_Chk")).Checked = true;
                browser.WaitUntilContainsText("可选择以下两种上传方式");
                Assert.IsTrue(browser.ContainsText("可选择以下两种上传方式"));
                //第一次
                WatiN.Core.DialogHandlers.ConfirmDialogHandler dh = new WatiN.Core.DialogHandlers.ConfirmDialogHandler();

                browser.AddDialogHandler(dh);

                browser.Button(Find.ByValue("全部挂")).ClickNoWait();
                dh.WaitUntilExists(15);//

                dh.OKButton.Click();//
                dh.WaitUntilExists(15);

                dh.OKButton.Click();
                browser.RemoveDialogHandler(dh);
        }
开发者ID:nirvana-info,项目名称:old_bak,代码行数:86,代码来源:salesource.cs


注:本文中的Browser.CheckBox方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。