示例#1
0
        public void EditAction()
        {
            //click the create button

            Administrator.Click();

            //click the employee button
            Employee.Click();

            Thread.Sleep(3000);
            //click the lastPage button
            lastPage.Click();

            //click the edit button
            EditButtton.Click();

            //change the new contact information
            ContactPath.SendKeys("123456");

            //click the Save button
            Save.Click();

            //click the Back to list button
            BackToList.Click();
        }
示例#2
0
        public void edit()
        {
            //click the create button

            Administrator.Click();

            //click the employee button
            Employee.Click();

            Thread.Sleep(3000);
            //click the lastPage button
            lastPage.Click();

            //click the edit button
            EditButtton.Click();

            userName.Click();
            userName.Clear();
            userName.SendKeys("Testers");
            //click the Save button
            Save.Click();

            //click the Back to list button
            BackToList.Click();
        }
示例#3
0
        public void Addemployee()
        {
            //Administrator
            Administrator.Click();
            //Administrator.WaitForElement(TimeSpan.FromSeconds(10));

            //Go to Employee
            Employee.WaitForElement(TimeSpan.FromSeconds(3));

            Employee.Click();


            //Crate new Employee

            Create.Click();

            Name.SendKeys("Industry");

            userName.SendKeys("Connect23");

            Contact.SendKeys("0123456789");

            Password.SendKeys("Abcd@1234)");

            RetypePassword.SendKeys("Abcd@1234)");

            Save.Click();

            BackToList.Click();

            //lastPage.Click();

            //Validation
            if (CommonDriver.driver.FindElement(By.XPath("//*[@id='container']/p/a")).Text == "Create")
            {
                Console.WriteLine("Employee Created Successfully");
            }
            else
            {
                Console.WriteLine("Fail to create Employee");
            }
        }
示例#4
0
        public void DeleteAction()
        {
            //click the create button

            Administrator.Click();

            //click the employee button
            Employee.Click();

            Thread.Sleep(3000);
            //click the lastPage button
            lastPage.Click();

            //click the delete button
            DeleteButton.Click();

            Thread.Sleep(3000);

            //click the POPup information
            CommonDrive.driver.SwitchTo().Alert().Dismiss();
        }
示例#5
0
        // codes of the delete actions

        public void AddEmployee()
        {
            //click the create button

            Administrator.Click();

            //click the employee button
            Employee.Click();

            //click the Create button
            Create.Click();

            //create the Name
            String NameT = "testers";

            Thread.Sleep(2000);

            Name.SendKeys("testers");

            //create the username
            userName.SendKeys("testerss");

            //create the contact

            Contact.SendKeys("1234");

            //create the password

            Password.SendKeys("Sa1234567");

            //retypepassword
            RetypePassword.SendKeys("Sa1234567");

            //click the Save button

            Save.Click();

            //back to the previous page

            BackToList.Click();

            Thread.Sleep(2000);


            //validation
            //if (CommonDrive.driver.FindElement(By.XPath("//*[@id='usersGrid']/div[3]/table/tbody/tr[1]/td[1]")).Text == NameT)
            //{
            //    Console.WriteLine("the new user is located in the first page");
            //}
            //else
            //{
            //    Thread.Sleep(2000);
            //    lastPage.Click();

            //    if (CommonDrive.driver.FindElement(By.XPath("//*[@id='usersGrid']/div[3]/table/tbody/tr[2]/td[1]")).Text == NameT)
            //    {
            //        Console.WriteLine("the new user is created succefully");
            //    }
            //    else
            //    {
            //        Console.WriteLine("the new user is not existing, the test faild");
            //    }


            //}
            //var testpage = CommonDrive.driver.FindElement(By.XPath("//*[@id='usersGrid']/div[3]/table/tbody/tr[1]/td[1]")).Text;
            //Assert.AreEqual(NameT, testpage);
        }