示例#1
0
        public static void TestMethodLogin()
        {
            Expectedresult = "Dashboard";
            PropertiesCollection.ngdriver = new ChromeDriver();
            string url = ConfigurationManager.AppSettings.Get("url");

            PropertiesCollection.ngdriver.Manage().Window.Maximize();
            PropertiesCollection.ngdriver.Navigate().GoToUrl(url);
            for (int i = 0; i < 2; i++)
            {
                try
                {
                    if (PropertiesCollection.ngdriver.Title == "Expentor-GSF")
                    {
                        break;
                    }
                    else
                    {
                        PropertiesCollection.ngdriver.Navigate().GoToUrl(url);
                    }
                }catch (Exception e)
                {
                    Console.WriteLine(e.Message);
                }
            }

            Console.WriteLine("landed on the login page");
            CustomControls.Entertext("#inputEmail", ConfigurationManager.AppSettings.Get("username"), propertytype.CssSelector);
            CustomControls.Entertext("#inputPassword", ConfigurationManager.AppSettings.Get("password"), propertytype.CssSelector);
            CustomControls.click("button[type='submit']", propertytype.CssSelector);
            delayfor.delay();
            Actualresult = CustomControlsGets.GettextfromLabel("h2[class='breadcumChangeTitle']", propertytype.CssSelector);
            Console.WriteLine("The landed page lands on " + Actualresult);
            Assertions.assertionequals(Actualresult, Expectedresult);
        }
示例#2
0
        public static void StudentEditContact()
        {
            delayfor.delay();

            CustomControls.click("//a[@data-action='Students']", propertytype.XPath);
            delayfor.delay();
            CustomControls.click("//a[normalize-space()='Students List']", propertytype.XPath);
            delayfor.delay();


            //Search
            CustomControls.Entertext("//input[@placeholder='Name or Class or Roll No.']", "Waltar", propertytype.XPath);
            delayfor.delay();

            CustomControls.click("//button[contains(@class,'btn btn-primary btn-outline')]", propertytype.XPath);
            delayfor.delay();

            CustomControls.click("//i[@class='fa fa-eye']", propertytype.XPath);
            delayfor.delay();



            //Screen Switch


            PropertiesCollection.ngdriver.SwitchTo().Window(PropertiesCollection.ngdriver.WindowHandles.Last());
            delayfor.delay();


            CustomControls.click("//tbody/tr[3]/td[3]/button[1]/i[1]", propertytype.XPath);
            delayfor.delay();

            CustomControls.Selectdropdown("//select[@id='contact-type']", "Phone", propertytype.XPath);
            delayfor.delay();

            CustomControls.ClearText("//input[@id='contact-type-value']", propertytype.XPath);
            delayfor.delay();

            CustomControls.Entertext("//input[@id='contact-type-value']", "563487129876", propertytype.XPath);
            delayfor.delay();

            Expectedresult = "Request Transfer Certificate";



            CustomControls.click("//button[normalize-space()='Save & Close']", propertytype.XPath);
            delayfor.delay();

            CustomControls.click(" //button[normalize-space()='Ok']", propertytype.XPath);
            delayfor.delay();

            Actualresult = CustomControlsGets.GettextfromLabel("//button[normalize-space()='Request Transfer Certificate']", propertytype.XPath);
            Console.WriteLine("The landed page lands on " + Actualresult);
            Assertions.assertionequals(Actualresult, Expectedresult);

            if (Expectedresult == Actualresult)
            {
                Console.WriteLine("Test Paases");
            }
        }
        public static void Locationinfosdatavalidations()
        {
            string locationname = CustomControlsGets.Geettextfromtextbox("/html[1]/body[1]/div[5]/div[1]/form[1]/div[11]/div[19]/div[5]/table[1]/tbody[1]/tr[1]/td[1]/div[2]/div[1]/div[1]/div[2]/div[2]/div[1]/div[1]/span[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[2]/div[1]/span[2]/div[1]/span[1]/input[1]", propertytype.XPath);

            Assert.AreEqual(locationname, Globalelements.locationinfo, "The location name in submission form and subsidary form do not match");

            string address1 = CustomControlsGets.Geettextfromtextbox("/html[1]/body[1]/div[5]/div[1]/form[1]/div[11]/div[19]/div[5]/table[1]/tbody[1]/tr[1]/td[1]/div[2]/div[1]/div[1]/div[2]/div[2]/div[1]/div[1]/span[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[3]/div[1]/span[2]/div[1]/span[1]/input[1]", propertytype.XPath);

            Assert.AreEqual(locationname, Globalelements.locationinfo, "  Address1 in submission form and subsidary form do not match");
        }
        public static void StudentDeleteContact()
        {
            delayfor.delay();

            CustomControls.click("//a[@data-action='Students']", propertytype.XPath);
            delayfor.delay();
            CustomControls.click("//a[normalize-space()='Students List']", propertytype.XPath);
            delayfor.delay();


            //Search
            CustomControls.Entertext("//input[@placeholder='Name or Class or Roll No.']", "Waltar", propertytype.XPath);
            delayfor.delay();

            CustomControls.click("//button[contains(@class,'btn btn-primary btn-outline')]", propertytype.XPath);
            delayfor.delay();

            CustomControls.click("//i[@class='fa fa-eye']", propertytype.XPath);
            delayfor.delay();



            //Screen Switch


            PropertiesCollection.ngdriver.SwitchTo().Window(PropertiesCollection.ngdriver.WindowHandles.Last());
            delayfor.delay();


            CustomControls.click("//a[normalize-space()='Address']", propertytype.XPath);
            delayfor.delay();

            CustomControls.click("//div[contains(@class,'addressGridView')]//div[2]//div[1]//p[1]//span[1]//button[2]", propertytype.XPath);
            delayfor.delay();

            CustomControls.click("//button[normalize-space()='Yes, Delete It']", propertytype.XPath);
            delayfor.delay();

            Expectedresult = "Request Transfer Certificate";

            CustomControls.click(" //button[normalize-space()='Ok']", propertytype.XPath);
            delayfor.delay();

            Actualresult = CustomControlsGets.GettextfromLabel("//button[normalize-space()='Request Transfer Certificate']", propertytype.XPath);
            Console.WriteLine("The landed page lands on " + Actualresult);
            Assertions.assertionequals(Actualresult, Expectedresult);

            if (Expectedresult == Actualresult)
            {
                Console.WriteLine("Test Paases");
            }
        }
示例#5
0
        public static void StudentEdit()
        {
            delayfor.delay();

            CustomControls.click("//a[@data-action='Students']", propertytype.XPath);
            delayfor.delay();
            CustomControls.click("//a[normalize-space()='Students List']", propertytype.XPath);
            delayfor.delay();


            //Search
            CustomControls.Entertext("//input[@placeholder='Name or Class or Roll No.']", "Waltor", propertytype.XPath);
            delayfor.delay();

            CustomControls.click("//button[contains(@class,'btn btn-primary btn-outline')]", propertytype.XPath);
            delayfor.delay();

            CustomControls.click("//i[@class='fa fa-eye']", propertytype.XPath);
            delayfor.delay();



            //Screen Switch


            PropertiesCollection.ngdriver.SwitchTo().Window(PropertiesCollection.ngdriver.WindowHandles.Last());
            delayfor.delay();


            CustomControls.click("//button[normalize-space()='Edit Student']", propertytype.XPath);
            delayfor.delay();

            Globalelements.Expectedresult = "Request Transfer Certificate";



            CustomControls.ClearText("//input[@id='first_name']", propertytype.XPath);
            delayfor.delay();

            CustomControls.Entertext("//input[@id='first_name']", "Waltar", propertytype.XPath);
            delayfor.delay();

            CustomControls.ClearText("//input[@id='last_Name']", propertytype.XPath);
            delayfor.delay();

            CustomControls.Entertext("//input[@id='last_Name']", "David", propertytype.XPath);
            delayfor.delay();

            CustomControls.Selectdropdown("//select[@id='student_category']", "Scholarship", propertytype.XPath);
            delayfor.delay();

            CustomControls.click("//button[@name='save']", propertytype.XPath);
            delayfor.delay();

            CustomControls.click(" //button[normalize-space()='Ok']", propertytype.XPath);
            delayfor.delay();

            Globalelements.Actualresult = CustomControlsGets.GettextfromLabel("//button[normalize-space()='Request Transfer Certificate']", propertytype.XPath);
            Console.WriteLine("The landed page lands on " + Globalelements.Actualresult);
            Assertions.assertionequals(Globalelements.Actualresult, Globalelements.Expectedresult);

            if (Globalelements.Expectedresult == Globalelements.Actualresult)
            {
                Console.WriteLine("Test Paases");
            }
        }
        public static void StudentEditContact()
        {
            delayfor.delay();

            CustomControls.click("//a[@data-action='Students']", propertytype.XPath);
            delayfor.delay();
            CustomControls.click("//a[normalize-space()='Students List']", propertytype.XPath);
            delayfor.delay();


            //Search
            CustomControls.Entertext("//input[@placeholder='Name or Class or Roll No.']", "Waltar", propertytype.XPath);
            delayfor.delay();

            CustomControls.click("//button[contains(@class,'btn btn-primary btn-outline')]", propertytype.XPath);
            delayfor.delay();

            CustomControls.click("//i[@class='fa fa-eye']", propertytype.XPath);
            delayfor.delay();



            //Screen Switch


            PropertiesCollection.ngdriver.SwitchTo().Window(PropertiesCollection.ngdriver.WindowHandles.Last());
            delayfor.delay();


            CustomControls.click("//a[normalize-space()='Address']", propertytype.XPath);
            delayfor.delay();

            CustomControls.click("//div[@class='addressGridView']//div[2]//div[1]//p[1]//span[1]//button[1]", propertytype.XPath);
            delayfor.delay();

            CustomControls.Selectdropdown("//select[@id='address-type']", "Physical", propertytype.XPath);
            delayfor.delay();

            CustomControls.ClearText("//input[@id='address-line1']", propertytype.XPath);
            delayfor.delay();

            CustomControls.Entertext("//input[@id='address-line1']", "Arazona South", propertytype.XPath);
            delayfor.delay();

            CustomControls.ClearText("//input[@id='city']", propertytype.XPath);
            delayfor.delay();

            CustomControls.Entertext("//input[@id='city']", "New York", propertytype.XPath);
            delayfor.delay();

            CustomControls.ClearText("//input[@id='state']", propertytype.XPath);
            delayfor.delay();

            CustomControls.Entertext("//input[@id='state']", "New York", propertytype.XPath);
            delayfor.delay();

            CustomControls.ClearText("//input[@id='pin']", propertytype.XPath);
            delayfor.delay();

            CustomControls.Entertext("//input[@id='pin']", "309877", propertytype.XPath);
            delayfor.delay();

            CustomControls.Selectdropdown("//select[@id='country']", "United States of America", propertytype.XPath);
            delayfor.delay();

            Expectedresult = "Request Transfer Certificate";



            CustomControls.click("//button[normalize-space()='Save & Close']", propertytype.XPath);
            delayfor.delay();

            CustomControls.click(" //button[normalize-space()='Ok']", propertytype.XPath);
            delayfor.delay();

            Actualresult = CustomControlsGets.GettextfromLabel("//button[normalize-space()='Request Transfer Certificate']", propertytype.XPath);
            Console.WriteLine("The landed page lands on " + Actualresult);
            Assertions.assertionequals(Actualresult, Expectedresult);

            if (Expectedresult == Actualresult)
            {
                Console.WriteLine("Test Paases");
            }
        }