Ejemplo n.º 1
0
        public void editTM()
        {
            if (TMHelpers.isExistsTM(driver) == false)
            {
                TMHelpers.addTM(driver, "testCode", "testDescription", "123");
            }

            //Edit an existing Time and Material record

            //Click on Edit for any one record
            driver.FindElement(By.XPath("//*[@id='tmsGrid']/div[3]/table/tbody/tr[1]/td[5]/a[1]")).Click();

            //Edit/ update a value for the selected record
            driver.FindElement(By.XPath("//*[@id='Code']")).Clear();
            driver.FindElement(By.XPath("//*[@id='Code']")).SendKeys("updatedCode");

            //save the updated record
            driver.FindElement(By.XPath("//*[@id='SaveButton']")).Click();

            Wait.waitUntil(driver, 3, "//*[@id='tmsGrid']/div[3]/table/tbody/tr[1]/td[1]", "XPath");

            Thread.Sleep(1000);

            //verify if the record is updated
            IWebElement actualCode = driver.FindElement(By.XPath("//*[@id='tmsGrid']/div[3]/table/tbody/tr[1]/td[1]"));

            if (actualCode.Text == "updatedCode")
            {
                Console.WriteLine("TM record edited successfully, test passed");
            }
            else
            {
                Console.WriteLine("TM record NOT edited, test failed");
            }
        }
Ejemplo n.º 2
0
 public void createTM()
 {
     TMHelpers.addTM(driver, "testCode", "testDescription", "123");
 }