コード例 #1
0
        public EA_POM Create_Appoinment()
        {
            Web_Driver.ngWebDriver.WaitForAngular();
            Web_Driver.driver.Navigate().Refresh();


            Apponitment_Tab.ElementAt(0).Click();
            //Clicking on Create Appoinment Button
            Web_Driver.ngWebDriver.WaitForAngular();
            Pre_Id = Previous_ID_txt.ElementAt(0).Text;
            int.TryParse(Pre_Id, out Previous_ID);
            Web_Driver.ngWebDriver.WaitForAngular();
            Created_Appoinment_Button.Click();
            //getting Appoinment page Url
            Appoinment_Page_Url = Web_Driver.driver.Url;
            //Clicking on CheckBox
            Check_Boxe.Click();
            //Checking Fields are Enabled after cliking on Checkbox

            for (int i = 0; i < Enable_Input_Boxes.Count; i++)
            {
                if (Enable_Input_Boxes.ElementAt(i).Enabled)
                {
                    Asserts.Enable_Fields(true);
                }
                if (Enable_Input_Boxes.ElementAt(i).Enabled == false)
                {
                    Asserts.Enable_Fields(false);
                }
            }
            //passing data into Fields
            // pass data into representative Form
            Representative_First_Name.SendKeys("Usama");
            Representative_First_Name.GetAttribute("value");

            Representative_Last_Name.SendKeys("Sohail");
            Representative_Last_Name.GetAttribute("value");
            Representative_Relationship.SendKeys("Cousin");
            Representative_Relationship.GetAttribute("value");
            RepresentativePhoneNumber.SendKeys("(234) 678-9874");

            string repres_str = RepresentativePhoneNumber.GetAttribute("value");

            //Passing Agent Info
            AgentFirstName.Clear();
            AgentFirstName.SendKeys("Ahad");
            AgentFirstName.GetAttribute("value");
            AgentLastName.Clear();
            AgentLastName.SendKeys("Ahmed");
            AgentLastName.GetAttribute("value");

            AgentPhone.Clear();

            AgentPhone.SendKeys("2346789874");
            string str_AgentPhone = AgentPhone.GetAttribute("value");

            str_AgentPhone = str_AgentPhone.Substring(str_AgentPhone.IndexOf("("));
            str_AgentPhone = str_AgentPhone.Replace("(", "");
            str_AgentPhone = str_AgentPhone.Replace(")", "");
            str_AgentPhone = str_AgentPhone.Replace("-", "");

            //  Console.WriteLine(str_AgentPhone);


            //passing data into Benificiary
            Beneficiary_First_Name.SendKeys("Mujeed");
            Beneficiary_First_Name.GetAttribute("value");
            LastName.SendKeys("Khan");
            LastName.GetAttribute("value");
            EmailAddress.SendKeys("*****@*****.**");
            HomePhone.SendKeys("2346789874");
            HomePhone.GetAttribute("value");
            PermanentAddress.SendKeys("72 house 342");
            //Checking radio buttons
            for (int i = 0; i < Radio_Btn_list.Count; i++)
            {
                Radio_Btn_list.ElementAt(i).Click();
                Console.WriteLine(Radio_Btn_list.ElementAt(i).Selected);
            }
            //Passing Data into other
            InitialOtherContactMethod.SendKeys("Other");
            InitialOtherContactMethod.SendKeys("value");
            //passing data into plan
            PlansRepresented.SendKeys("Plan A");
            PlansRepresented.GetAttribute("value");
            //passing dates
            AppointmentOn.SendKeys("12/10/2020");
            AppointmentOn.GetAttribute("value");
            AppointmentCompletedOn.SendKeys("13/10/2020");
            AppointmentCompletedOn.GetAttribute("value");
            //passing data into Appointment Id
            AgnetNPNIDNumber.SendKeys("Md-4554");
            AgnetNPNIDNumber.GetAttribute("value");

            //passing data into plan
            meetingDetails.SendKeys("Plan D");
            meetingDetails.GetAttribute("value");
            //  Medicare Number
            MediCareNumber.SendKeys("Md-6783");
            MediCareNumber.GetAttribute("value");

            //  Asserts.All_Fields_Data_Filled if (Representative_First_Name.contains("[a-zA-Z0-9]+") && RepresentativePhoneNumber.contains("[0-9]+") == true);
            //  Asserts.All_Fields_Data_Filled(false);

            //Assertion On Data filled or Not


            if (Representative_First_Name.GetAttribute("value") == "Usama" && Representative_Last_Name.GetAttribute("value") == "Sohail" && Representative_Relationship.GetAttribute("value") == "Cousin" && AgentFirstName.GetAttribute("value") == "Ahad" && AgentLastName.GetAttribute("value") == "Ahmed" && str_AgentPhone == "234 6789874" && Beneficiary_First_Name.GetAttribute("value") == "Mujeed" && LastName.GetAttribute("value") == "Khan" && repres_str == "(234) 678-9874" && PermanentAddress.GetAttribute("value") == "72 house 342" && EmailAddress.GetAttribute("value") == "*****@*****.**" && PlansRepresented.GetAttribute("value") == "Plan A" && AppointmentOn.GetAttribute("value") == "10/12/2020" && AppointmentCompletedOn.GetAttribute("value") == "10/13/2020" && AgnetNPNIDNumber.GetAttribute("value") == "Md-4554" && MediCareNumber.GetAttribute("value") == "Md-6783")
            {
                Asserts.All_Fields_Data_Filled(true);
            }
            else
            {
                Asserts.All_Fields_Data_Filled(false);
            }
            //Assertion on Date


            Date_of_Appoinment = AppointmentOn.GetAttribute("value");
            Date_of_Appoinment = Date_of_Appoinment.Substring(Date_of_Appoinment.IndexOf("/"));
            Date_of_Appoinment = Date_of_Appoinment.Replace("/", "");
            // Complete Date
            Date_of_Appoinment_Complete = AppointmentCompletedOn.GetAttribute("value");

            Date_of_Appoinment_Complete = Date_of_Appoinment_Complete.Substring(Date_of_Appoinment_Complete.IndexOf("/"));
            Date_of_Appoinment_Complete = Date_of_Appoinment_Complete.Replace("/", "");



            int.TryParse(Date_of_Appoinment_Complete, out int Complete_Date);
            int.TryParse(Date_of_Appoinment, out int Start_Date);
            Console.WriteLine(Complete_Date);
            Console.WriteLine(Start_Date);
            if (Complete_Date > Start_Date)
            {
                Asserts.Date(true);
            }
            else
            {
                Asserts.Date(false);
            }
            //Clicking on E Sign button
            Genrete_Appoinment.ElementAt(0).Click();
            Genrete_Appoinment_Yes_Btn.ElementAt(1).Click();
            Web_Driver.ngWebDriver.WaitForAngular();
            Genrete_Appoinment_Ok_Btn.ElementAt(1).Click();
            Web_Driver.ngWebDriver.WaitForAngular();
            Web_Driver.driver.Navigate().Refresh();
            Home_Page_Url = Web_Driver.driver.Url;
            Console.WriteLine(Home_Page_Url);
            Console.WriteLine(Appoinment_Page_Url);
            Web_Driver.ngWebDriver.WaitForAngular();
            Up_Id = Created_ID_txt.ElementAt(0).Text;
            int.TryParse(Up_Id, out Updated_ID);
            Asserts.ID_Compare(Updated_ID, Previous_ID);
            Console.WriteLine(Previous_ID);
            Console.WriteLine(Updated_ID);
            return(new EA_POM());
        }
コード例 #2
0
        public EA_POM   Appointment_Search()
        {
            Thread.Sleep(4000);
            Apponitment_Tab.ElementAt(0).Click();
            Enrolment_Page page = new Enrolment_Page();

            Thread.Sleep(2000);
            //Clicking on DropDown

            page.Hash_Drop.ElementAt(0).Click();
            Thread.Sleep(3000);
            //Clicking inside the Search box
            page.Search_Records.ElementAt(0).Click();
            //Passing data into Search box
            page.Search_Records.ElementAt(0).SendKeys("1741");
            try
            {
                //Clicking on Search btn
                page.Search_btn.ElementAt(0).Click();
                //getting button Element
                Search_btn_bool = page.Search_btn.ElementAt(0).Displayed;
                Thread.Sleep(3000);
                //Search button verify
                if (Search_btn_bool == true)
                {
                    Asserts.Assert_Search_btn(true);
                }
            }
            catch
            {
                Asserts.Assert_Search_btn(false);
            }
            //Verifying Search results
            for (int i = 0; i < page.Search_Record_Results.Count; i++)
            {
                Thread.Sleep(3000);
                Text_Heightlight.highlight();
                Id_Bool = page.Search_Record_Results[i].Displayed;
                Console.WriteLine(page.Search_Record_Results[i].Text);
            }
            if (Id_Bool == true)
            {
                Asserts.Assert_Id_Found(true);
            }
            else
            {
                Asserts.Assert_Id_Found(false);
            }

            Thread.Sleep(3000);
            Double_click[0] = true;
            // Web_Driver.driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(3);
            Double();
            //Clicking on Clear Button
            Thread.Sleep(3000);
            try
            {
                //Verifying Search_Clear button
                page.Clear_Btn.ElementAt(0).Click();
                Clear_Bool = page.Clear_Btn.ElementAt(0).Displayed;

                if (Clear_Bool == true)
                {
                    Asserts.Assert_Search_Clear(true);
                }
            }
            catch
            {
                Asserts.Assert_Search_Clear(false);
            }
            //Disapear Drop
            Thread.Sleep(3000);
            page.Hash_Drop.ElementAt(0).Click();
            //Verifying Search With Name

            //Clicking on DropDown
            page.Hash_Drop.ElementAt(1).Click();
            Thread.Sleep(3000);
            //Clicking inside the Search box
            page.Search_Records.ElementAt(1).Click();
            //Passing data into Search box
            page.Search_Records.ElementAt(1).SendKeys("Usama");
            try
            {
                //Clicking on Search btn
                page.Search_btn.ElementAt(1).Click();
                //getting button Element
                Search_btn1_bool = page.Search_btn.ElementAt(1).Displayed;
                Thread.Sleep(3000);
                //Search button verify
                if (Search_btn1_bool == true)
                {
                    Asserts.Assert_Search_btn(true);
                }
            }
            catch
            {
                Asserts.Assert_Search_btn(false);
            }
            //Verifying Search results

            try

            {
                int    i;
                bool[] Name_Bool = new bool[page.Search_Record_Results.Count];
                Console.WriteLine(page.Search_Record_Results.Count + "" +
                                  " Records");
                for (i = 0; i < page.Search_Record_Results.Count; i++)
                {
                    Text_Heightlight.highlight1();
                    Name_Bool[i] = page.Search_Record_Results[i].Displayed;
                    Console.WriteLine(page.Search_Record_Results[i].Text);
                    if (Name_Bool[i] == true)
                    {
                        Asserts.Assert_Name_Found(Name_Bool[i]);
                    }
                }

                if (page.Search_Record_Results.Count == 0)
                {
                    Asserts.Assert_Name_Found(false);
                }
            }
            catch
            {
            }

            Thread.Sleep(3000);
            Double_click[1] = true;
            // Web_Driver.driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(3);
            Double();
            //Clicking on Clear Button
            Thread.Sleep(3000);
            try
            {
                //Verifying Search_Clear button
                page.Clear_Btn.ElementAt(1).Click();
                Clear_Bool_1 = page.Clear_Btn.ElementAt(1).Displayed;

                if (Clear_Bool_1 == true)
                {
                    Asserts.Assert_Search_Clear(true);
                }
            }
            catch
            {
                Asserts.Assert_Search_Clear(false);
            }
            //Disapear Drop
            Thread.Sleep(3000);
            page.Hash_Drop.ElementAt(1).Click();
            //Verifying email Address


            //Verifying Created
            //Getting Latest date
            Created_Latest_Date = Created_Date.Text;
            Text_Heightlight.highlight2();
            Console.WriteLine(Created_Latest_Date);
            page.Created_Click.Click();
            Thread.Sleep(3000);
            Created_Last_Date = Created_Date.Text;
            Console.WriteLine(Created_Last_Date);
            Asserts.Date_Comparison(Created_Latest_Date, Created_Last_Date);
            //Verifying Status
            page.Hash_Drop.ElementAt(2).Click();
            Thread.Sleep(3000);
            //Clicking inside the Search box
            page.Search_Records.ElementAt(2).Click();
            //Passing data into Search box
            page.Search_Records.ElementAt(2).SendKeys("Draft");
            try
            {
                //Clicking on Search btn

                page.Search_btn.ElementAt(3).Click();
                //getting button Element
                Search_btn2_bool = page.Search_btn.ElementAt(3).Displayed;
                Thread.Sleep(3000);
                //Search button verify
                if (Search_btn2_bool == true)
                {
                    Asserts.Assert_Search_btn(true);
                }
            }
            catch
            {
                Asserts.Assert_Search_btn(false);
            }
            //Verifying Search results
            Thread.Sleep(3000);
            Text_Heightlight.highlight3();
            try
            {
                int    i;
                bool[] Status_Bool = new bool[page.Search_Record_Results.Count];
                for (i = 67; i < page.Search_Record_Results.Count; i++)
                {
                    Status_Bool[i] = page.Search_Record_Results[i].Displayed;

                    Console.WriteLine(page.Search_Record_Results[i].Text);
                    if (Status_Bool[i] == true)
                    {
                        Asserts.Assert_Status_Found(Status_Bool[i]);
                    }
                }
                if (page.Search_Record_Results.Count == 0)
                {
                    Asserts.Assert_Status_Found(false);
                }
            }
            catch

            {
            }

            Thread.Sleep(3000);
            Double_click[3] = true;
            // Web_Driver.driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(3);
            Double();
            //Clicking on Clear Button
            Thread.Sleep(3000);
            try
            {
                //Verifying Search_Clear button
                page.Clear_Btn.ElementAt(3).Click();
                Clear_Bool_2 = page.Clear_Btn.ElementAt(3).Displayed;

                if (Clear_Bool_2 == true)
                {
                    Asserts.Assert_Search_Clear(true);
                }
            }
            catch
            {
                Asserts.Assert_Search_Clear(false);
            }
            //Disapear Drop
            Thread.Sleep(3000);
            page.Hash_Drop.ElementAt(2).Click();

            return(new EA_POM());
        }
コード例 #3
0
        public EA_POM Create_Enrolment()
        {
            Thread.Sleep(3000);
            //   string[] vals = new string[] { "H7607-002-001", "H7607-002-002", "H7607-002-003", "H7607-003-001", "H7607-003-002", "H7607-003-003" };
            En_Tab_Click.Click();
            Thread.Sleep(3000);
            Pre_Id = Previous_ID_txt.ElementAt(0).Text;
            int.TryParse(Pre_Id, out Previous_ID);
            Create_En_btn.Click();
            Url_Creat_En_page = Web_Driver.driver.Url;
            Asserts.Url_Create_En(Url_Creat_En_page, Url_En_page);
            Console.WriteLine(Url_Creat_En_page);
            Console.WriteLine(Url_En_page);
            //Plan radio button verifying
            for (int i = 0; i < Plan_Radio_btn.Count; i++)
            {
                try
                {
                    Plan_Radio_btn.ElementAt(i).Click();
                    radio = Plan_Radio_btn.ElementAt(i).Selected;
                    if (radio = Plan_Radio_btn.ElementAt(i).Selected)
                    {
                        //  Console.WriteLine(Plan_Radio_btn.ElementAt(i).Selected + "Button  clicked");
                        Asserts.Assert_Radiobtn(radio);
                    }
                }
                catch
                {
                    Asserts.Assert_Radiobtn(false);
                }
            }
            // List<string> list = new List<string>();
            IList <IWebElement> rows = Web_Driver.driver.FindElements(By.XPath("//table[@class='table-responsive table-bordered']//tbody//tr"));

            for (int i = 3; i < 6; i++)
            {
                // Console.WriteLine(rows[i].Text);
                if (rows[i].Text == "H7607-002-001 Los Angeles" || rows[i].Text == "H7607-002-002 Orange" || rows[i].Text == "H7607-002-003 San Diego")
                {
                    // Console.WriteLine(rows[i].Text);
                    bool txtverified = true;
                    Asserts.Assert_Plans(txtverified);
                }
                else
                {
                    bool txtverified = false;
                    Asserts.Assert_Plans(txtverified);
                }
                for (int j = 7; j < 10; j++)
                {
                    //Console.WriteLine(rows[i].Text);
                    if (rows[j].Text == "H7607-003-001 Los Angeles" || rows[j].Text == "H7607-003-002 Orange" || rows[j].Text == "H7607-003-003 San Diego")
                    {
                        //  Console.WriteLine(rows[j].Text);
                        bool txtverified = true;
                        Asserts.Assert_Plans1(txtverified);
                    }
                    else
                    {
                        bool txtverified = false;
                        Asserts.Assert_Plans1(txtverified);
                    }
                }
            }



            //First name verified
            Name.SendKeys("Usama");


            //Last name verified
            LName.SendKeys("Sohail");


            //Middle name verified

            MName.SendKeys("Puma");



            //Required Date Of Birth verified
            Dob.SendKeys("05/07/2020");

            //Sex Male/FeeMale radio btns
            for (int i = 0; i < Radio_M_F.Count; i++)
            {
                try
                {
                    Radio_M_F.ElementAt(i).Click();
                    radio_1 = Radio_M_F.ElementAt(i).Selected;
                    if (radio_1 = Radio_M_F.ElementAt(i).Selected)
                    {
                        Console.WriteLine(Radio_M_F.ElementAt(i).Selected + "Button is  clicked");
                        Asserts.Assert_Radiobtn(radio_1);
                    }
                }
                catch
                {
                    Asserts.Assert_Radiobtn(false);
                }
            }
            /// Entring Home Phone
            Hphone.SendKeys("5672348791");
            //Entering Permanent Address
            P_Address.SendKeys("72 Health center");
            //Entering Permanent City
            P_City.SendKeys("Lahore");
            //Entering Permanent County
            P_County.SendKeys("Pak");
            //Entering Permanent State
            P_State.SendKeys("Pakistan");
            //Entering Permanent Zip
            P_Zip.SendKeys("315550");
            //Mailing Adress CheckBox
            Mailing_Adress.Click();
            checkbox = Mailing_Adress.Selected;
            if (checkbox == true)
            {
                Asserts.Mailing_Checkbox(true);
            }
            else
            {
                Asserts.Mailing_Checkbox(false);
            }

            //Entering data into street address input box

            Street_Adress.SendKeys("72 Health center street No 10");
            //Entering data into Mailing City

            Mailing_City.SendKeys("Faisalabad");
            //Entering data into Mailing State

            Mailing_State.SendKeys("England");
            //Entering data into Mailing Zipcode

            Mailing_Zip.SendKeys("4532678");
            //Entering data into MdNumber

            MD_Number.SendKeys("Md-9999");
            //Entering data into AttorneName
            AttorneyName.SendKeys("Gul");
            //Entering data into AttorneAdree
            AttorneyAddress.SendKeys("123 street near new clonoy 1");
            //Entering data into Attorny Phone
            AttorneyPhone.SendKeys("2324445787");
            //Entering data into Attorny Phone
            Attorneyrelation.SendKeys("Cousin");
            for (int i = 0; i < Section_2_Checkbox2.Count; i++)
            {
                try
                {
                    Section_2_Checkbox2.ElementAt(i).Click();
                    Section_2_checked1 = Section_2_Checkbox2.ElementAt(i).Selected;
                    if (Section_2_checked1 = Section_2_Checkbox2.ElementAt(i).Selected)
                    {
                        Console.WriteLine(Section_2_Checkbox2.ElementAt(i).Selected + "Section 2 Button not clicked");
                        Asserts.Section2_Checkbox(Section_2_checked1);
                    }
                }
                catch
                {
                    Asserts.Section2_Checkbox(false);
                }

                {
                }
            }
            for (int i = 0; i < Section_2_Checkbox.Count; i++)
            {
                try
                {
                    Section_2_Checkbox.ElementAt(i).Click();
                    Section_2_checked = Section_2_Checkbox.ElementAt(i).Selected;
                    if (Section_2_checked = Section_2_Checkbox.ElementAt(i).Selected)
                    {
                        Console.WriteLine(Section_2_Checkbox.ElementAt(i).Selected + "Button not clicked");
                        Asserts.Assert_Radiobtn(Section_2_checked);
                    }
                }
                catch
                {
                    Asserts.Assert_Radiobtn(false);
                }

                {
                }
            }
            //Entring email address
            Email_Adress.SendKeys("*****@*****.**");
            Premium_check.Click();
            premium = Premium_check.Selected;
            if (premium == true)
            {
                Asserts.Section2_Checkbox(true);
            }
            else
            {
                Asserts.Section2_Checkbox(false);
            }
            for (int i = 0; i < Attestation.Count; i++)
            {
                try
                {
                    Attestation.ElementAt(i).Click();
                    radio_2 = Attestation.ElementAt(i).Selected;
                    if (radio_2 == true)
                    {
                        Console.WriteLine(Attestation.ElementAt(i).Selected + "Attestation Radio Button  clicked");
                        Asserts.Assert_Radiobtn(radio_2);
                    }
                }
                catch
                {
                    Asserts.Assert_Radiobtn(false);
                }

                Genrete_Enrolment.ElementAt(1).Click();
                Web_Driver.ngWebDriver.WaitForAngular();
                Genrete_Enrolment_Yes_Btn.ElementAt(1).Click();
                Web_Driver.ngWebDriver.WaitForAngular();
                Genrete_Appoinment_Ok_Btn.ElementAt(1).Click();
                Web_Driver.ngWebDriver.WaitForAngular();
                Web_Driver.driver.Navigate().Refresh();
                Web_Driver.ngWebDriver.WaitForAngular();
                Up_Id = Created_ID_txt.ElementAt(0).Text;
                int.TryParse(Up_Id, out Updated_ID);
                Asserts.ID_Compare(Updated_ID, Previous_ID);
                Console.WriteLine(Previous_ID);
                Console.WriteLine(Updated_ID);
            }
            return(new EA_POM());
        }
コード例 #4
0
        public EA_POM Search_Enrolment()
        {
            Thread.Sleep(2000);
            //Clicking on DropDown

            Hash_Drop.ElementAt(0).Click();
            Thread.Sleep(3000);
            //Clicking inside the Search box
            Search_Records.ElementAt(0).Click();
            //Passing data into Search box
            Search_Records.ElementAt(0).SendKeys("1741");
            try
            {
                //Clicking on Search btn
                Search_btn.ElementAt(0).Click();
                //getting button Element
                Search_btn_bool = Search_btn.ElementAt(0).Displayed;
                Thread.Sleep(3000);
                //Search button verify
                if (Search_btn_bool == true)
                {
                    Asserts.Assert_Search_btn(true);
                }
            }
            catch
            {
                Asserts.Assert_Search_btn(false);
            }
            //Verifying Search results
            for (int i = 0; i < Search_Record_Results.Count; i++)
            {
                Id_Bool = Search_Record_Results[i].Displayed;
                Console.WriteLine(Search_Record_Results[i].Text);
            }
            if (Id_Bool == true)
            {
                Asserts.Assert_Id_Found(true);
            }
            else
            {
                Asserts.Assert_Id_Found(false);
            }

            Thread.Sleep(3000);
            Double_click[0] = true;
            // Web_Driver.driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(3);
            Double();
            //Clicking on Clear Button
            Thread.Sleep(3000);
            try
            {
                //Verifying Search_Clear button
                Clear_Btn.ElementAt(0).Click();
                Clear_Bool = Clear_Btn.ElementAt(0).Displayed;

                if (Clear_Bool == true)
                {
                    Asserts.Assert_Search_Clear(true);
                }
            }
            catch
            {
                Asserts.Assert_Search_Clear(false);
            }
            //Disapear Drop
            Thread.Sleep(3000);
            Hash_Drop.ElementAt(0).Click();
            //Verifying Search With Name

            //Clicking on DropDown
            Hash_Drop.ElementAt(1).Click();
            Thread.Sleep(3000);
            //Clicking inside the Search box
            Search_Records.ElementAt(1).Click();
            //Passing data into Search box
            Search_Records.ElementAt(1).SendKeys("Usama");
            try
            {
                //Clicking on Search btn
                Search_btn.ElementAt(1).Click();
                //getting button Element
                Search_btn1_bool = Search_btn.ElementAt(1).Displayed;
                Thread.Sleep(3000);
                //Search button verify
                if (Search_btn1_bool == true)
                {
                    Asserts.Assert_Search_btn(true);
                }
            }
            catch
            {
                Asserts.Assert_Search_btn(false);
            }
            //Verifying Search results

            try
            {
                int    i;
                bool[] Name_Bool = new bool[Search_Record_Results.Count];
                Console.WriteLine(Search_Record_Results.Count + "" +
                                  " Records");
                for (i = 0; i < Search_Record_Results.Count; i++)
                {
                    Name_Bool[i] = Search_Record_Results[i].Displayed;
                    Console.WriteLine(Search_Record_Results[i].Text);
                    if (Name_Bool[i] == true)
                    {
                        Asserts.Assert_Name_Found(Name_Bool[i]);
                    }
                }

                if (Search_Record_Results.Count == 0)
                {
                    Asserts.Assert_Name_Found(false);
                }
            }
            catch
            {
            }

            Thread.Sleep(3000);
            Double_click[1] = true;
            // Web_Driver.driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(3);
            Double();
            //Clicking on Clear Button
            Thread.Sleep(3000);
            try
            {
                //Verifying Search_Clear button
                Clear_Btn.ElementAt(1).Click();
                Clear_Bool_1 = Clear_Btn.ElementAt(1).Displayed;

                if (Clear_Bool_1 == true)
                {
                    Asserts.Assert_Search_Clear(true);
                }
            }
            catch
            {
                Asserts.Assert_Search_Clear(false);
            }
            //Disapear Drop
            Thread.Sleep(3000);
            Hash_Drop.ElementAt(1).Click();
            //Verifying email Address
            Hash_Drop.ElementAt(2).Click();
            Thread.Sleep(3000);
            //Clicking inside the Search box
            Search_Records.ElementAt(2).Click();
            //Passing data into Search box
            Search_Records.ElementAt(2).SendKeys("*****@*****.**");
            try
            {
                //Clicking on Search btn
                Search_btn2_bool = Search_btn.ElementAt(2).Displayed;
                Search_btn.ElementAt(2).Click();
                //getting button Element

                Console.WriteLine(Search_btn2_bool);
                Thread.Sleep(3000);
                //Search button verify
                if (Search_btn2_bool == true)
                {
                    Asserts.Assert_Search_btn(true);
                }
                else
                {
                    Asserts.Assert_Search_btn(false);
                }
            }
            catch
            {
            }
            try
            {
                //Verifying Search results
                int    i          = 0;
                bool[] Email_Bool = new bool[Search_Record_Results.Count];
                for (i = 0; i < Search_Record_Results.Count; i++)
                {
                    Email_Bool[i] = Search_Record_Results[i].Displayed;
                    Console.WriteLine(Search_Record_Results[i].Text);
                    Console.WriteLine(Email_Bool + "  Email bool");
                    if (Email_Bool[i] == true)
                    {
                        Asserts.Assert_Email_Found(Email_Bool[i]);
                    }
                }

                if (Search_Record_Results.Count == 0)
                {
                    Asserts.Assert_Email_Found(false);
                }
            }
            catch
            {
            }



            Thread.Sleep(3000);
            Double_click[2] = true;
            // Web_Driver.driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(3);
            Double();
            //Clicking on Clear Button
            Thread.Sleep(3000);
            try
            {
                //Verifying Search_Clear button
                Clear_Btn.ElementAt(4).Click();
                Clear_Bool_2 = Clear_Btn.ElementAt(2).Displayed;

                if (Clear_Bool_2 == true)
                {
                    Asserts.Assert_Search_Clear(true);
                }
            }
            catch
            {
                Asserts.Assert_Search_Clear(false);
            }
            //Disapear Drop
            Thread.Sleep(3000);
            Hash_Drop.ElementAt(2).Click();
            //Verifying Plan Records
            //Clicking on DropDown
            Hash_Drop.ElementAt(3).Click();
            Thread.Sleep(3000);
            //Clicking inside the Search box
            Search_Records.ElementAt(3).Click();
            //Passing data into Search box
            Search_Records.ElementAt(3).SendKeys("H7607-003-003");
            try
            {
                //Clicking on Search btn
                Search_btn.ElementAt(3).Click();
                //getting button Element
                Search_btn3_bool = Search_btn.ElementAt(3).Displayed;
                Thread.Sleep(3000);
                //Search button verify
                if (Search_btn3_bool == true)
                {
                    Asserts.Assert_Search_btn(true);
                }
            }
            catch
            {
                Asserts.Assert_Search_btn(false);
            }
            //Verifying Search results
            try
            {
                int    i;
                bool[] Plan_Bool = new bool[Search_Record_Results.Count];
                for (i = 0; i < Search_Record_Results.Count; i++)
                {
                    Plan_Bool[i] = Search_Record_Results[20].Displayed;
                    Console.WriteLine(Search_Record_Results[i].Text);
                    if (Plan_Bool[i] == true)
                    {
                        Asserts.Assert_Plan_Found(Plan_Bool[i]);
                    }
                }
                if (Search_Record_Results.Count == 0)
                {
                    Asserts.Assert_Plan_Found(false);
                }
            }
            catch
            {
            }

            Thread.Sleep(3000);
            Double_click[3] = true;
            // Web_Driver.driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(3);
            Double();
            //Clicking on Clear Button
            Thread.Sleep(3000);
            try
            {
                //Verifying Search_Clear button
                Clear_Btn.ElementAt(3).Click();
                Clear_Bool_3 = Clear_Btn.ElementAt(3).Displayed;
                Console.WriteLine(Clear_Bool_3);



                if (Clear_Bool_3 == true)
                {
                    Asserts.Assert_Search_Clear(true);
                }
            }
            catch
            {
                Asserts.Assert_Search_Clear(false);
            }
            //Disapear Drop
            Thread.Sleep(3000);
            Hash_Drop.ElementAt(3).Click();

            //Verifying Created
            //Getting Latest date
            Created_Latest_Date = Created_Date.Text;
            Console.WriteLine(Created_Latest_Date);
            Created_Click.Click();
            Thread.Sleep(3000);
            Created_Last_Date = Created_Date.Text;
            Console.WriteLine(Created_Last_Date);
            Asserts.Date_Comparison(Created_Latest_Date, Created_Last_Date);
            //Verifying Status
            Hash_Drop.ElementAt(4).Click();
            Thread.Sleep(3000);
            //Clicking inside the Search box
            Search_Records.ElementAt(4).Click();
            //Passing data into Search box
            Search_Records.ElementAt(4).SendKeys("Draft");
            try
            {
                //Clicking on Search btn

                Search_btn.ElementAt(5).Click();
                //getting button Element
                Search_btn4_bool = Search_btn.ElementAt(5).Displayed;
                Thread.Sleep(3000);
                //Search button verify
                if (Search_btn4_bool == true)
                {
                    Asserts.Assert_Search_btn(true);
                }
            }
            catch
            {
                Asserts.Assert_Search_btn(false);
            }
            //Verifying Search results
            try
            {
                int    i;
                bool[] Status_Bool = new bool[Search_Record_Results.Count];
                for (i = 67; i < Search_Record_Results.Count; i++)
                {
                    Status_Bool[i] = Search_Record_Results[i].Displayed;
                    Console.WriteLine(Search_Record_Results[i].Text);
                    if (Status_Bool[i] == true)
                    {
                        Asserts.Assert_Status_Found(Status_Bool[i]);
                    }
                }
                if (Search_Record_Results.Count == 0)
                {
                    Asserts.Assert_Status_Found(false);
                }
            }
            catch

            {
            }

            Thread.Sleep(3000);
            Double_click[4] = true;
            // Web_Driver.driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(3);
            Double();
            //Clicking on Clear Button
            Thread.Sleep(3000);
            try
            {
                //Verifying Search_Clear button
                Clear_Btn.ElementAt(5).Click();
                Clear_Bool_4 = Clear_Btn.ElementAt(5).Displayed;

                if (Clear_Bool_4 == true)
                {
                    Asserts.Assert_Search_Clear(true);
                }
            }
            catch
            {
                Asserts.Assert_Search_Clear(false);
            }
            //Disapear Drop
            Thread.Sleep(3000);
            Hash_Drop.ElementAt(4).Click();
            return(new EA_POM());
        }
コード例 #5
0
        public EA_POM Edit_Enrolment()
        {
            Web_Driver.ngWebDriver.WaitForAngular();
            //Getting Records
            Edit_Record_Previous = Edit_Record.Text;
            Console.WriteLine(Edit_Record_Previous + "Previous Record");
            Edit_Id = Search_Record_Colums.Text;
            Console.WriteLine(Edit_Id + "Id");
            Edit_En_btn.Click();
            Web_Driver.ngWebDriver.WaitForAngular();
            //  Plan_Edit_Btn.Click();
            //Getting Text of previous Fields
            Plan_Edit_strng = Plan_Edit_Text.Text;
            Console.WriteLine(Plan_Edit_strng);
            //Getting First Name
            Name_strng = Name.GetAttribute("value");
            Console.WriteLine(Name_strng);
            Name.Clear();
            Name.SendKeys("Ali");
            //Getting New Values
            Name_strng1 = Name.GetAttribute("value");
            Console.WriteLine(Name_strng1);
            //Getting Last Name
            LName_strng = LName.GetAttribute("value");
            Console.WriteLine(LName_strng);
            LName.Clear();
            LName.SendKeys("Asad");
            //Getting new Values
            LName_strng1 = LName.GetAttribute("value");
            Console.WriteLine(LName_strng1);
            //Getting MidName
            MName_strng = MName.GetAttribute("value");
            Console.WriteLine(MName_strng);
            MName.Clear();
            MName.SendKeys("Asa");
            //Getting new Values
            MName_strng1 = MName.GetAttribute("value");
            Console.WriteLine(MName_strng1);
            //Getting Date of Birth
            Dob_strng = Dob.GetAttribute("value");
            Console.WriteLine(Dob_strng);
            Dob.Clear();
            Dob.SendKeys("10/11/2022");
            //Getting new Values
            Dob_strng1 = Dob.GetAttribute("value");
            Console.WriteLine(Dob_strng1);
            //Radio btn
            male_radio = Radio_M_F.ElementAt(0).GetAttribute("value");
            Console.WriteLine(male_radio);
            Radio_M_F.ElementAt(1).Click();
            Fee_Male_radio = Radio_M_F.ElementAt(1).GetAttribute("value");
            Console.WriteLine(Fee_Male_radio);
            //Phone number
            Hphone_strng = Hphone.GetAttribute("value");
            Console.WriteLine(Hphone_strng);
            Hphone.Clear();
            Hphone.SendKeys("9878564598");
            Hpnone1_strng = Hphone.GetAttribute("value");
            Console.WriteLine(Hpnone1_strng);
            //Permanent address
            P_Address_strng = P_Address.GetAttribute("value");
            Console.WriteLine(P_Address_strng);
            //New Values
            P_Address.Clear();
            P_Address.SendKeys("878# Street no5");
            P_Address_strng1 = P_Address.GetAttribute("value");
            Console.WriteLine(P_Address_strng1);
            //Permanent City
            P_City_Strng = P_City.GetAttribute("value");
            Console.WriteLine(P_City_Strng);
            //New Values
            P_City.Clear();
            P_City.SendKeys("Karachi");
            P_City_Strng1 = P_City.GetAttribute("value");
            Console.WriteLine(P_City_Strng1);
            //Permanent County
            P_County_Strng = P_County.GetAttribute("value");
            Console.WriteLine(P_County_Strng);
            //New Values
            P_County.Clear();
            P_County.SendKeys("County");
            P_County_Strng1 = P_County.GetAttribute("value");
            Console.WriteLine(P_County_Strng1);
            //Permanent State
            P_State_Strng = P_State.GetAttribute("value");
            Console.WriteLine(P_State_Strng);
            //New Values
            P_State.Clear();
            P_State.SendKeys("USA");
            P_State_Strng1 = P_State.GetAttribute("value");
            Console.WriteLine(P_State_Strng1);
            //ZipCode
            P_Zip_Strng = P_Zip.GetAttribute("value");
            Console.WriteLine(P_Zip_Strng);
            //New Values
            P_Zip.Clear();
            P_Zip.SendKeys("453454");
            P_Zip_Strng1 = P_Zip.GetAttribute("value");
            Console.WriteLine(P_Zip_Strng1);
            //MD_Number
            Md_No_strng = MD_Number.GetAttribute("value");
            Console.WriteLine(Md_No_strng);
            //New Values
            MD_Number.Clear();
            MD_Number.SendKeys("MD_9001");
            Md_No_strng1 = P_Zip.GetAttribute("value");
            Console.WriteLine(Md_No_strng1);
            //Email Address
            Email_Strng = Email_Adress.GetAttribute("value");
            Console.WriteLine(Email_Strng);
            //New Values
            Email_Adress.Clear();
            Email_Adress.SendKeys("*****@*****.**");
            Email_Strng = Email_Adress.GetAttribute("value");
            Console.WriteLine(Email_Strng1);
            //Pay List testing unchecked CheckBox


            Paylist_bool1 = Paylist.ElementAt(0).Selected;
            Paylist_bool2 = Paylist.ElementAt(1).Selected;
            Paylist_bool3 = Paylist.ElementAt(2).Selected;
            if (Paylist_bool1 == true || Paylist_bool2 == true || Paylist_bool3 == true)
            {
                if (Paylist_bool1 == true)
                {
                    Paylist.ElementAt(0).Click();
                }
                if (Paylist_bool2 == true)
                {
                    Paylist.ElementAt(1).Click();
                }
                if (Paylist_bool3 == true)
                {
                    Paylist.ElementAt(2).Click();
                }
                Asserts.Pay_list1(true);
            }

            if (Paylist_bool1 == false && Paylist_bool2 == false & Paylist_bool3 == false)
            {
                Asserts.Pay_list1(true);
            }
            //cliking on single paylist
            Paylist.ElementAt(0).Click();
            Paylist_bool1 = Paylist.ElementAt(0).Selected;
            Paylist_bool2 = Paylist.ElementAt(1).Selected;
            Paylist_bool3 = Paylist.ElementAt(2).Selected;
            if (Paylist_bool1 == true && Paylist_bool2 == false & Paylist_bool3 == false)
            {
                Asserts.Pay_list(Paylist_bool1);
            }
            else
            {
                Asserts.Pay_list(false);
            }
            //Asertion for Records inrequired fields are changed or not
            if (Name_strng != Name_strng1 && LName_strng != LName_strng1 && MName_strng != MName_strng1 && Dob_strng != Dob_strng1 && P_Address_strng != P_Address_strng1 && P_City_Strng != P_City_Strng1 && P_State_Strng != P_State_Strng1 && male_radio != Fee_Male_radio && Md_No_strng != Md_No_strng1 && Email_Strng != Email_Strng1)
            {
                Asserts.En_Search_Create_pages_Fields_Edit(true);
            }
            else
            {
                Asserts.En_Search_Create_pages_Fields_Edit(false);
            }
            //Save Draft
            Console.WriteLine("Colorsss");

            Save_Draft_Btn_Color = SaveDraft.ElementAt(0).GetCssValue("background-color");
            Console.WriteLine(Save_Draft_Btn_Color + "Color");
            Enroment_create_page_Url = Web_Driver.driver.Url;
            Console.WriteLine(Enroment_create_page_Url);
            SaveDraft.ElementAt(0).Click();


            Save_Draft_Btn_Color1 = SaveDraft.ElementAt(0).GetCssValue("background-color");
            Console.WriteLine(Save_Draft_Btn_Color1 + "Color-");
            //Draft Button cliking verifying

            Asserts.Save_Draft(Save_Draft_Btn_Color, Save_Draft_Btn_Color1);
            Web_Driver.ngWebDriver.WaitForAngular();
            Web_Driver.driver.Navigate().Refresh();


            Enroment_Search_page_Url = Web_Driver.driver.Url;

            Console.WriteLine(Enroment_Search_page_Url);
            Asserts.En_Search_Create_pages_Url(Enroment_create_page_Url, Enroment_Search_page_Url);
            //Getting New Record
            Web_Driver.ngWebDriver.WaitForAngular();


            //Search for Updated Enrolment
            Thread.Sleep(3000);
            Hash_Drop.ElementAt(0).Click();
            //Search by Id
            Search_Records.ElementAt(0).Click();
            Thread.Sleep(3000);

            Search_Records.ElementAt(0).SendKeys(Edit_Id);

            Thread.Sleep(3000);

            Search_btn.ElementAt(0).Click();
            Thread.Sleep(3000);
            //Getting text of updated record
            Edit_Record_Updated = Edit_Record.Text;
            Console.WriteLine(Edit_Record_Updated + " Updated Record");
            //Assertion For Edit Record check
            Asserts.Edit_Record_Update(Edit_Record_Previous, Edit_Record_Updated);
            return(new EA_POM());
        }