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


C# Browser.Table方法代码示例

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


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

示例1: TestUserladbilldeliversearch

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

            browser.Link(Find.ByText("可发资源查询")).Click();
            browser.WaitUntilContainsText("可提资源查询");
            Assert.IsTrue(browser.ContainsText("可提资源查询"));
            //先清空

            browser.Button(Find.ById("ctl00_ContentPlaceHolder1_btnCleanDelivery")).ClickNoWait();
            /*
             //测试用
            string ss = "0904000070";
            int s1 = int.Parse(ss);
            int s2 = s1 + 1;
            string ss1 = s2.ToString();
            */
            //
            Thread.Sleep(1500);
            browser.TextField(Find.ById("ctl00_ContentPlaceHolder1_txtOrderCode")).TypeText(orderid);

            browser.Button(Find.ById("ctl00_ContentPlaceHolder1_Button1")).Click();

            //截取ID
            string l1 = browser.Span(Find.ByText("焊接用钢盘条")).Id;
            string l3 = l1.Trim().Substring(13, 4);

            browser.Link(Find.ById("a_order_" + l3)).Click();

            browser.Button(Find.ById("ctl00_ContentPlaceHolder1_NextStepBtn")).Click();

            browser.WaitUntilContainsText("在此页面中您可选择对此提单的处理方式,如无疑义,可点击创建提单完成");
            Assert.IsTrue(browser.ContainsText("在此页面中您可选择对此提单的处理方式,如无疑义,可点击创建提单完成"));
            browser.Table(Find.ById("ctl00_ContentPlaceHolder1_GridView1")).TableRow(Find.ByClass("RowBg")).WaitUntilExists(10);
            //Assert.AreEqual("xx",browser.Table(Find.ById("ctl00_ContentPlaceHolder1_GridView1")).TableRow(Find.ByClass("RowBg")).TableCells[1].Text);
            string ladorderid = browser.Table(Find.ById("ctl00_ContentPlaceHolder1_GridView1")).TableRow(Find.ByClass("RowBg")).TableCells[1].Text;

            browser.Button(Find.ById("ctl00_ContentPlaceHolder1_Button3")).Click();

            //发货单确认
            browser.Link(Find.ByText("发货单确认")).Click();
            browser.WaitUntilContainsText("提单管理");
            Assert.IsTrue(browser.ContainsText("提单管理"));

            WatiN.Core.DialogHandlers.ConfirmDialogHandler dh2 = new WatiN.Core.DialogHandlers.ConfirmDialogHandler();

            browser.AddDialogHandler(dh2);

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

示例2: TestUserladingbillsearch

        //public static string ladorderid;
        public void TestUserladingbillsearch(Browser browser, string url, string orderid)
        {
            browser.Link(Find.ByText("可提资源查询")).Click();
            browser.WaitUntilContainsText("可提资源查询");
            Assert.IsTrue(browser.ContainsText("可提资源查询"));
            //先清空

            browser.Button(Find.ById("ctl00_ContentPlaceHolder1_btnCleanDelivery")).ClickNoWait();
            /*
             //测试用
            string ss = "0904000070";
            int s1 = int.Parse(ss);
            int s2 = s1 + 1;
            string ss1 = s2.ToString();
            */
            //
            Thread.Sleep(1500);
            browser.TextField(Find.ById("ctl00_ContentPlaceHolder1_txtOrderCode")).TypeText(orderid);

            browser.Button(Find.ById("ctl00_ContentPlaceHolder1_Button1")).Click();

            //截取ID
            string l1 = browser.Span(Find.ByText("焊接用钢盘条")).Id;
            string l3 = l1.Trim().Substring(13, 4);

            browser.Link(Find.ById("a_order_"+l3)).Click();

            browser.Button(Find.ById("ctl00_ContentPlaceHolder1_NextStepBtn")).Click();

            browser.WaitUntilContainsText("在此页面中您可选择对此提单的处理方式,如无疑义,可点击创建提单完成");
            Assert.IsTrue(browser.ContainsText("在此页面中您可选择对此提单的处理方式,如无疑义,可点击创建提单完成"));
            browser.Table(Find.ById("ctl00_ContentPlaceHolder1_GridView1")).TableRow(Find.ByClass("RowBg")).WaitUntilExists(10);
            //Assert.AreEqual("xx",browser.Table(Find.ById("ctl00_ContentPlaceHolder1_GridView1")).TableRow(Find.ByClass("RowBg")).TableCells[1].Text);
            string ladorderid = browser.Table(Find.ById("ctl00_ContentPlaceHolder1_GridView1")).TableRow(Find.ByClass("RowBg")).TableCells[1].Text;

            browser.Button(Find.ById("ctl00_ContentPlaceHolder1_Button3")).Click();
        }
开发者ID:nirvana-info,项目名称:old_bak,代码行数:38,代码来源:ladingbillsearch.cs

示例3: ISERemoveClearFilter

        /// <summary>
        /// Method to Remove or Clear Integrated System Errors from Filter
        /// </summary>
        /// <param name="browser">WatiN Browser Object</param>
        /// <param name="indexorname"></param>
        /// <param name="index"></param>
        /// <param name="name"></param>
        /// <param name="removeorclear"></param>
        public void ISERemoveClearFilter(Browser browser, string indexorname, int index, string name, string removeorclear)
        {
            TableRowCollection trc = browser.Table(Find.ById("ctl00_MainContent_rpIntegrationSystemErrors_gvIntegrationSystemErrors_DXFilterBar")).TableRows;

            switch(indexorname)

            {

                case "Index":

                TableCellCollection tc = trc[index].TableCells;
                if (removeorclear.Equals("Remove"))
                {
                    WatiN.Core.CheckBox cb = tc[0].CheckBox(Find.First());
                    cb.Checked = false;
                }
                if (removeorclear.Equals("Clear"))
                {

                    tc[4].Link(Find.ByText("Clear")).Click();

                }
                break;

                case "Name":

                if(removeorclear.Equals("Remove"))
                {
                foreach (TableRow x in trc)
                {
                    TableCellCollection tcollect = x.TableCells.Filter(Find.ByText(new Regex(name)));
                    if (tcollect.Count != 0)
                    {
                        TableCellCollection cr = x.TableCells;
                        WatiN.Core.CheckBox crcb = cr[0].CheckBox(Find.First());
                        crcb.Checked = false;
                        break;
                    }
                }
                }
                if(removeorclear.Equals("Clear"))
                {

                    foreach (TableRow x in trc)
                    {
                        TableCellCollection tcollect = x.TableCells.Filter(Find.ByText(new Regex(name)));
                        if (tcollect.Count != 0)
                        {
                            TableCellCollection cr = x.TableCells;
                            cr[4].Link(Find.ByText("Clear")).Click();
                            break;
                        }
                    }

                }
                break;

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

示例4: GetWorkSpecificationSearchResults

        /// <summary>
        /// Method returns a collection of rows that represent the Admin Work Specification Search Results table
        ///  Returns all rows with Class = dxgvDataRow
        /// Row class = dxgvDataRow
        /// </summary>
        /// <param name="browser">WatiN Browser Object</param>
        /// <returns>WatiN TableRowCollection Object</returns>               
        public TableRowCollection GetWorkSpecificationSearchResults(Browser browser)
        {
            TableRowCollection results = browser.Table(Find.ById(new Regex("ctl00_MainContent_ASPxRoundPanel1_SpecsGridView_DXMainTable"))).TableRows.Filter(Find.ByClass("dxgvDataRow"));

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

示例5: GetWarrantyVendorSearchResults

        /// <summary>
        /// Method returns a collection of rows that represent the Warranty Search Results table
        ///  Returns all rows with Class = dxgvDataRow
        /// Row class = dxgvDataRow
        /// </summary>
        /// <param name="browser">WatiN Browser Object</param>
        /// <returns>WatiN TableRowCollection</returns>
        // TODO - Get actual table name - need valid search criteria
        public TableRowCollection GetWarrantyVendorSearchResults(Browser browser)
        {
            TableRowCollection results = browser.Table(Find.ById(new Regex("ctl00_MainContent_ResultsRoundPanel_WarrantyVendorsGridView_DXMainTable"))).TableRows.Filter(Find.ByClass("dxgvDataRow"));

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

示例6: GetJobCodeSearchResults

 /// <summary>
 /// Method returns a collection of rows that represent the Admin Job Code Search Results table
 ///  Returns all rows with Class = dxgvDataRow
 /// Row class = dxgvDataRow
 /// </summary>
 /// <param name="browser">WatiN Browser Object</param>
 /// <returns>WatiN TableRowCollection Object</returns>       
 public TableRowCollection GetJobCodeSearchResults(Browser browser)
 {
     TableRowCollection results = browser.Table(Find.ById(new Regex("ctl00_MainContent_ResultPanel_ASPxGridView1_DXMainTable"))).TableRows.Filter(Find.ByClass("dxgvDataRow"));
     return results;
 }
开发者ID:johnbcook,项目名称:automation-samples,代码行数:12,代码来源:AdminCommon.cs

示例7: GetExceptionReasonCategoriesSearchResults

        /// <summary>
        /// Method returns a collection of rows that represent the Admin Exception Reason Categories Search Results table
        ///  Returns all rows with Class = dxgvDataRow
        /// Row class = dxgvDataRow
        /// </summary>
        /// <param name="browser">WatiN Browser Object</param>
        /// <returns>WatiN TableRowCollection Object</returns>
        public TableRowCollection GetExceptionReasonCategoriesSearchResults(Browser browser)
        {
            TableRowCollection results = browser.Table(Find.ById(new Regex("ctl00_MainContent_ResultsRoundPanel_ExceptionReasonCatGridView_DXMainTable"))).TableRows.Filter(Find.ByClass("dxgvDataRow"));

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

示例8: SelectWSShop

        /// <summary>
        /// Method selects the Shop on the Admin Work Specification -> Search Work Specification screen
        /// </summary>
        /// <param name="browser">WatiN Browser Object</param>
        /// <param name="shop">Shop Value</param>
        public void SelectWSShop(Browser browser, string shop)
        {
            Element edit = browser.Element(Find.ById(new Regex("ctl00_MainContent_SearchPanel_ShopComboBox_I")));
            IEElement editele = (IEElement)edit.NativeElement;
            System.Drawing.Point editclickPoint = gc.GetScreenPoint(editele);
            gc.Move(editclickPoint);
            gc.LeftClick(editclickPoint);

            browser.TextField(Find.ById(new Regex("ctl00_MainContent_SearchPanel_ShopComboBox_I"))).AppendText(shop.Substring(0, 4));

            TableRowCollection rows = browser.Table(Find.ById(new Regex("ctl00_MainContent_SearchPanel_ShopComboBox_DDD_L_LBT"))).TableRows;

            foreach (TableRow x in rows)
            {

                TableCellCollection test = x.TableCells;

                foreach (TableCell y in test)
                {

                    if (y.Text.Equals(shop))
                    {

                        IEElement innerele = (IEElement)y.NativeElement;
                        System.Drawing.Point innerclickPoint = gc.GetScreenPoint(innerele);
                        gc.Move(innerclickPoint);
                        gc.LeftClick(innerclickPoint);
                        y.Click();
                        return;
                    }
                }

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

示例9: SelectNewWSCompany

        /// <summary>
        /// Method selects the Company on the Admin Work Specification -> Search Work Specification, New Work Specification screen
        /// </summary>
        /// <param name="browser">WatiN Browser Object</param>
        /// <param name="company">Company Value</param>
        public void SelectNewWSCompany(Browser browser, string company)
        {
            Element edit = browser.Element(Find.ById(new Regex("ctl00_MainContent_ASPxRoundPanel1_SpecsGridView_DXEditor4_I")));
            IEElement editele = (IEElement)edit.NativeElement;
            System.Drawing.Point editclickPoint = gc.GetScreenPoint(editele);
            gc.Move(editclickPoint);
            gc.LeftClick(editclickPoint);

            browser.TextField(Find.ById(new Regex("ctl00_MainContent_ASPxRoundPanel1_SpecsGridView_DXEditor4_I"))).AppendText(company.Substring(0, 4));

            TableRowCollection rows = browser.Table(Find.ById(new Regex("ctl00_MainContent_ASPxRoundPanel1_SpecsGridView_DXEditor4_DDD_L_LBT"))).TableRows;

            Console.Write(rows.Count);
            foreach (TableRow x in rows)
            {

                TableCellCollection test = x.TableCells;

                foreach (TableCell y in test)
                {

                    if(y.Text.Equals(company))
                    {

                        IEElement innerele = (IEElement)y.NativeElement;
                        System.Drawing.Point innerclickPoint = gc.GetScreenPoint(innerele);
                        gc.Move(innerclickPoint);
                        gc.LeftClick(innerclickPoint);
                        y.Click();
                        return;
                    }
                }

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

示例10: SelectGBEntity

        /// <summary>
        /// Method selects the Company on the Admin Labor Standard -> New Labor Standard screent
        /// </summary>
        /// <param name="browser">WatiN Browser Object</param>
        /// <param name="gbentity"></param>
        public void SelectGBEntity(Browser browser, string gbentity)
        {
            TextField me = browser.TextField(Find.ById(new Regex("ctl00_MainContent_WarrantyVendorPanel_ResultsRoundPanel_WarrantyVendorAccountsGridView_DXEditor1_I")));
            IEElement newele = (IEElement)me.NativeElement;
            System.Drawing.Point clickPoint = gc.GetScreenPoint(newele);
            gc.Move(clickPoint);
            gc.LeftClick(clickPoint);

            TableRowCollection rows = browser.Table(Find.ById(new Regex("ctl00_MainContent_WarrantyVendorPanel_ResultsRoundPanel_WarrantyVendorAccountsGridView_DXEditor1_DDD_L_LBT"))).TableRows;

            foreach (TableRow x in rows)
            {

                TableCellCollection test = x.TableCells;

                foreach (TableCell y in test)
                {
                    //Console.Write(y.Text);
                   // Console.Write(Environment.NewLine);
                    if (y.Text.Equals(gbentity))
                    {

                        IEElement innerele = (IEElement)y.NativeElement;
                        System.Drawing.Point innerclickPoint = gc.GetScreenPoint(innerele);
                        gc.Move(innerclickPoint);
                        gc.LeftClick(innerclickPoint);
                        y.Click();
                        return;
                    }
                }

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

示例11: SelectERType

        /// <summary>
        /// Method selects the Type on the Admin Exception Reasons -> New Exception Reason screen
        /// </summary>
        /// <param name="browser">WatiN Browser Object</param>
        /// <param name="type">Type Value</param>
        public void SelectERType(Browser browser, string type)
        {
            Element edit = browser.Element(Find.ById(new Regex("ctl00_MainContent_ResultsRoundPanel_ExceptionReasonsGridView_DXEditor6_I")));
            IEElement editele = (IEElement)edit.NativeElement;
            System.Drawing.Point editclickPoint = gc.GetScreenPoint(editele);
            gc.Move(editclickPoint);
            gc.LeftClick(editclickPoint);

            TableRowCollection rows = browser.Table(Find.ById(new Regex("ctl00_MainContent_ResultsRoundPanel_ExceptionReasonsGridView_DXEditor6_DDD_L_LBT"))).TableRows;

            foreach (TableRow x in rows)
            {

                TableCellCollection test = x.TableCells;

                foreach (TableCell y in test)
                {

                    if (y.Text.Equals(type))
                    {

                        IEElement innerele = (IEElement)y.NativeElement;
                        System.Drawing.Point innerclickPoint = gc.GetScreenPoint(innerele);
                        gc.Move(innerclickPoint);
                        gc.LeftClick(innerclickPoint);
                        y.Click();
                        return;
                    }
                }

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

示例12: TestUserplaceordertradebycredit

        public void TestUserplaceordertradebycredit(Browser browser, string url, string material, string date1, string number, string ordertype, string button)
        {
            //#*****************************************************************************
            //# Purpose: define User placeorder 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.ByUrl(url + "SearchProduct.aspx")).Click();
            browser.WaitUntilContainsText("清空购物车");
            Assert.IsTrue(browser.ContainsText("清空购物车"));
            //查询资源
            browser.TextField(Find.ById("ctl00_ContentPlaceHolder1_txtSteel_Num")).TypeText(material + date1);
            browser.Button(Find.ById("ctl00_ContentPlaceHolder1_btnSearch1")).Click();
            //清空购物车
            WatiN.Core.DialogHandlers.ConfirmDialogHandler dh2 = new WatiN.Core.DialogHandlers.ConfirmDialogHandler();

            browser.AddDialogHandler(dh2);

            browser.Link(Find.ById("ctl00_ContentPlaceHolder1_linkClearCart")).ClickNoWait();
            dh2.WaitUntilExists(15);//
            dh2.OKButton.Click();//
            browser.RemoveDialogHandler(dh2);
            Thread.Sleep(1500);
            //点击该资源并购买

            browser.Image(Find.ByAlt("buy product")).Click();
            browser.TextField(Find.ByClass("cinput")).TypeText(number);
            browser.WaitUntilContainsText(number);
            Assert.IsTrue(browser.ContainsText(number));
            browser.Button(Find.ByClass("addBuyCartBtn")).Click();
            Thread.Sleep(1500);
            //点击pop出来的确认对话框
            WatiN.Core.DialogHandlers.ConfirmDialogHandler dh = new WatiN.Core.DialogHandlers.ConfirmDialogHandler();

            browser.AddDialogHandler(dh);

            browser.Link(Find.ById("ctl00_ContentPlaceHolder1_linkBuildOrders")).ClickNoWait();
            dh.WaitUntilExists(15);//
            dh.OKButton.Click();//
            browser.RemoveDialogHandler(dh);

            //自动分单
            browser.WaitUntilContainsText("系统自动分单");
            Assert.IsTrue(browser.ContainsText("系统自动分单"));

            browser.SelectList(Find.ById("ctl00_ContentPlaceHolder1_dlPreviewList_ctl00_cmbPurcharseordertype")).Option(Find.ByText(ordertype)).Select();

            //点击pop出来的确认对话框
            WatiN.Core.DialogHandlers.ConfirmDialogHandler dh1 = new WatiN.Core.DialogHandlers.ConfirmDialogHandler();

            browser.AddDialogHandler(dh1);

            browser.Button(Find.ById("ctl00_ContentPlaceHolder1_btnBuld")).ClickNoWait();
            dh1.WaitUntilExists(3);//
            dh1.OKButton.Click();//
            browser.RemoveDialogHandler(dh1);

            //意向订单
            browser.WaitUntilContainsText("选择需要的订单,生成意向订单");
            Assert.IsTrue(browser.ContainsText("选择需要的订单,生成意向订单"));
            browser.RadioButton(Find.ByName("radionSelect")).Checked = true;
            orderid1 = browser.Table(Find.ById("ctl00_ContentPlaceHolder1_GridView1")).TableRow(Find.ByClass("RowBg")).TableCells[1].Text;

            //意向订单-->订单生效
            //这个要参数化
            browser.Button(Find.ById(button)).Click();

            //确定

            //提货功能暂时只能自提,选择功能先关闭
            //ie.Frame(Find.ById("wheatmsg_ifrm")).SelectList(Find.ById("selTransport")).Option(Find.ByValue("2")).Select();

            browser.Frame(Find.ById("wheatmsg_ifrm")).Button(Find.ById("btnYes")).ClickNoWait();

            Thread.Sleep(2000);
        }
开发者ID:nirvana-info,项目名称:old_bak,代码行数:85,代码来源:placeordertradebycredit.cs


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