示例#1
0
        public MainPage Add(String product, String unitptice, String quantityperunit,
                            String unitsinsrock, String unitsonorder, String reorderlevel)
        {
            loginField.SendKeys("user");
            passwordField.SendKeys("user");
            passwordField.Submit();

            All_Products.Click();
            Create_new.Click();
            Product_Name.SendKeys(product);
            Product_Name.Click();

            Category_Id.Click();
            Category_Id.FindElement(By.XPath("//option[. = 'Beverages']")).Click();
            Supplier_Id.Click();
            Supplier_Id.FindElement(By.XPath("//option[. = 'Tokyo Traders']")).Click();

            Unit_Price.SendKeys(unitptice);
            Unit_Price.Click();
            QuantityPer_Unit.SendKeys(quantityperunit);
            QuantityPer_Unit.Click();
            UnitsIn_Stock.SendKeys(unitsinsrock);
            Unit_Price.Click();
            UnitsOn_Order.SendKeys(unitsonorder);
            UnitsOn_Order.Click();
            Reorder_Level.SendKeys(reorderlevel);
            Reorder_Level.Click();
            Button_OK.Click();

            return(new MainPage(driver));
        }