internal void Savebutton1()
 {
     Id.SendKeys("Test");
     Descid.SendKeys("Test Descrition");
     driver.FindElement(By.XPath(".//*[@id='TimeMaterialEditForm']/div/div[4]/div/span[1]/span/input[1]")).SendKeys("7.90");
     driver.FindElement(By.XPath("//input[@id='SaveButton']")).Click();
     WebElementExtensions.ElementExists(driver, By.Name(""), TimeSpan.FromDays(1));
 }
        internal void Editbutoon()
        {
            //Thread.Sleep(2000);
            //WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(10));
            //wait.Until(ExpectedConditions.ElementExists((By.XPath("//a[contains(.,'Edit')]"))));

            WebElementExtensions.ElementExists(driver, By.XPath("//a[contains(.,'Edit')]"), TimeSpan.FromSeconds(10));
            Editbutton.Click();
        }
Пример #3
0
 internal void SaveButton()
 {
     Name.SendKeys("Charlie");
     Username.SendKeys("CPathan");
     Contact.SendKeys("02225673");
     Passwrod.SendKeys("Test@1234");
     ReTypePasswrod.SendKeys("Test@1234");
     driver.FindElement(By.XPath("//input[@class='k-input text-box single-line']")).SendKeys("Nissan");
     driver.FindElement(By.XPath("//input[@class='k-input k-readonly']")).SendKeys("Car");
     WebElementExtensions.ElementExists(driver, By.Name(""), TimeSpan.FromDays(1));
 }
Пример #4
0
        internal void deleteTimenMaterial()
        {
            // WebElementExtensions.ElementExists(driver, By.XPath("//tr[1]/td[5]/a[@class='k-button k-button-icontext k-grid-Delete' and 2]"), TimeSpan.FromSeconds(10));
            WebElementExtensions.ElementExists(driver, By.XPath("//a[contains(.,'Edit')]"), TimeSpan.FromSeconds(10));
            try
            {
                while (true)
                {
                    for (var i = 1; i <= 10; i++)
                    {
                        IWebElement code      = driver.FindElement(By.XPath("//tr[" + i + "]/td[1]"));
                        IWebElement desc      = driver.FindElement(By.XPath("//tr[" + i + "]/td[3]"));
                        IWebElement TypeCode  = driver.FindElement(By.XPath("//tr[" + i + "]/td[2]"));
                        IWebElement Price     = driver.FindElement(By.XPath("//tr[" + i + "]/td[4]"));
                        IWebElement btndelete = driver.FindElement(By.XPath("//tr[" + i + "]/td[5]/a[@class='k-button k-button-icontext k-grid-Delete' and 2]"));

                        Console.WriteLine(code.Text);
                        Console.WriteLine(desc.Text);
                        Console.WriteLine(TypeCode.Text);
                        Console.WriteLine(Price.Text);

                        if (code.Text == ExcelLibHelpers.ReadData(2, "Code") && desc.Text == ExcelLibHelpers.ReadData(2, "Description"))
                        //if (code.Text == "SSRR112" && desc.Text == "SSRR112")// && TypeCode.Text == "M" && Price.Text == "7.90")
                        {
                            Console.WriteLine("Test Passed");
                            btndelete.Click();
                            Thread.Sleep(2000);
                            driver.SwitchTo().Alert().Accept();
                            Thread.Sleep(2000);

                            //Deletbtn.Click();

                            //Editbtn.Click();
                            //Id.Clear();
                            //Id.SendKeys("Testnew");
                            //Descid.SendKeys("Test Descritionnew");
                            //driver.FindElement(By.XPath(".//*[@id='TimeMaterialEditForm']/div/div[4]/div/span[1]/span/input[1]")).SendKeys("7.90");
                            //driver.FindElement(By.XPath("//input[@id='SaveButton']")).Click();


                            //WebElementExtensions.ElementExists(driver, By.XPath("//a[contains(.,'Edit')]"), TimeSpan.FromSeconds(10));

                            return;
                        }
                    }

                    nextbtn.Click();
                }
            }
            catch (Exception)
            {
                Console.WriteLine("Test Failed");
            }
        }
Пример #5
0
        internal void EditTimenMaterail()
        {
            WebElementExtensions.ElementExists(driver, By.XPath("//a[contains(.,'Edit')]"), TimeSpan.FromSeconds(10));

            try
            {
                while (true)
                {
                    for (var i = 1; i <= 10; i++)
                    {
                        IWebElement code     = driver.FindElement(By.XPath("//tr[" + i + "]/td[1]"));
                        IWebElement desc     = driver.FindElement(By.XPath("//tr[" + i + "]/td[3]"));
                        IWebElement TypeCode = driver.FindElement(By.XPath("//tr[" + i + "]/td[2]"));
                        IWebElement Price    = driver.FindElement(By.XPath("//tr[" + i + "]/td[4]"));
                        IWebElement btnedit  = driver.FindElement(By.XPath("//tr[" + i + "]/td[5]/a[@class='k-button k-button-icontext k-grid-Edit' and 1]"));

                        Console.WriteLine(code.Text);
                        Console.WriteLine(desc.Text);
                        Console.WriteLine(TypeCode.Text);
                        Console.WriteLine(Price.Text);
                        if (code.Text == ExcelLibHelpers.ReadData(2, "Code") && desc.Text == ExcelLibHelpers.ReadData(2, "Description"))// && TypeCode.Text == "M" && Price.Text == "7.90")
                        {
                            Console.WriteLine("Test Passed");

                            btnedit.Click();
                            Id.Clear();
                            Id.SendKeys(ExcelLibHelpers.ReadData(2, "NewCode"));;
                            Descid.Clear();
                            Descid.SendKeys(ExcelLibHelpers.ReadData(2, "NewDescription"));
                            driver.FindElement(By.XPath(".//*[@id='TimeMaterialEditForm']/div/div[4]/div/span[1]/span/input[1]")).SendKeys(ExcelLibHelpers.ReadData(2, "PricePerUnit"));
                            driver.FindElement(By.XPath("//input[@id='SaveButton']")).Click();


                            WebElementExtensions.ElementExists(driver, By.XPath("//a[contains(.,'Edit')]"), TimeSpan.FromSeconds(10));

                            return;
                        }
                    }

                    nextbtn.Click();
                }
            }
            catch (Exception)
            {
                Console.WriteLine("Test Failed");
            }
        }
Пример #6
0
        internal void ValidateTimenMaterial()
        {
            WebElementExtensions.ElementExists(driver, By.XPath("//a[contains(.,'Edit')]"), TimeSpan.FromSeconds(10));

            try
            {
                while (true)
                {
                    for (var i = 1; i <= 10; i++)
                    {
                        IWebElement code     = driver.FindElement(By.XPath("//tr[" + i + "]/td[1]"));
                        IWebElement desc     = driver.FindElement(By.XPath("//tr[" + i + "]/td[3]"));
                        IWebElement TypeCode = driver.FindElement(By.XPath("//tr[" + i + "]/td[2]"));
                        IWebElement Price    = driver.FindElement(By.XPath("//tr[" + i + "]/td[4]"));
                        //IWebElement Editbtn = driver.FindElement(By.XPath("//tr[" + i + "]/td[5]/a[@class='k-button k-button-icontext k-grid-Edit' and 1]"));

                        Console.WriteLine(code.Text);
                        Console.WriteLine(desc.Text);
                        Console.WriteLine(TypeCode.Text);
                        Console.WriteLine(Price.Text);
                        if (code.Text == ExcelLibHelpers.ReadData(2, "Code") && desc.Text == ExcelLibHelpers.ReadData(2, "Description"))// && TypeCode.Text == "M" && Price.Text == "7.90")
                        {
                            Console.WriteLine("Test Passed");

                            //Editbtn.Click();

                            return;
                        }
                    }

                    nextbtn.Click();
                }
            }
            catch (Exception)
            {
                Console.WriteLine("Test Failed");
            }
        }