public bool VerifyUserNameFieldText()
        {
            bool isSuccess = false;

            try
            {
                string UserNameFieldText = GetObjectAttributeValue(txt_UserId, "text");
                if (UserNameFieldText.Equals(null))
                {
                    Reporter.Add(new Act("UsernameField is Empty"));
                    Reporter.Add(new Act("Value in UsernameField is:" + UserNameFieldText));
                }
                // if (!(UserNameFieldText.Equals(null)))
                else
                {
                    Reporter.Add(new Act("UsernameField is not-Empty"));
                    Reporter.Add(new Act("Value in UsernameField is:" + UserNameFieldText));
                }
                isSuccess = true;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            return(isSuccess);
        }
        public bool DisableRememberMeButton()
        {
            bool isSuccess = false;

            try
            {
                string UserNameFieldText = GetObjectAttributeValue(btn_RememeberMe, "text");
                if (UserNameFieldText.Equals("0"))
                {
                    Reporter.Add(new Act("Verify RememberMe Button is OFF"));
                }
                if (UserNameFieldText.Equals("1"))
                {
                    Reporter.Add(new Act("Verify RememberMe Button is ON"));
                    ClickonRemememberMe();
                    Reporter.Add(new Act("RememberMe Button is in OFF Mode"));
                    ClearObjectValue(txt_UserId);
                    Reporter.Add(new Act("UserNameField Value is cleared"));
                }
                isSuccess = true;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            return(isSuccess);
        }
        public bool Login(string userName = "", string password = "")
        {
            bool isSuccess = false;

            try
            {
                Reporter.Add(new Act("Click on username field"));
                ClickOnObject(txt_UserId);

                Reporter.Add(new Act("Enter user name"));
                SetValueToObject(txt_UserId, userName);

                Reporter.Add(new Act("Click on password field"));
                ClickOnObject(txt_Password);

                Reporter.Add(new Act("Enter password"));
                SetValueToObject(txt_Password, password);

                Reporter.Add(new Act("Click on Login"));
                ClickOnObject(btn_LogIn);

                Thread.Sleep(10000);
                Reporter.Add(new Act("Verify the successful login"));
                WaitForElementVisible(text_Directory);
                isSuccess = true;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            return(isSuccess);
        }
예제 #4
0
        protected bool VerifyElementExistsUnderRow(string expRowName, string expValue, By locator, int maxWaitTime = 0)
        {
            bool objFound = false;

            maxWaitTime = maxWaitTime > 0 ? maxWaitTime : ElementSyncTimeOut;
            try
            {
                IWebElement table = GetNativeElement(locator);
                ICollection <IWebElement> rows = GetNativeElementsInAElement(table, By.TagName("tr"));
                foreach (var row in rows)
                {
                    string name = row.Text;
                    if (name.Contains(expRowName))
                    {
                        if (name.Contains(expValue))
                        {
                            objFound = true;
                            Reporter.Add(new Act(expRowName + " contains " + expValue));
                            break;
                        }
                        else
                        {
                            Reporter.Add(new Act(expRowName + " does not contains " + expValue));
                        }
                    }
                }
            }

            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            return(objFound);
        }
        public bool Insufficientchars37(string userName = "", string password = "")
        {
            bool isSuccess = false;

            try
            {
                Reporter.Add(new Act("Clear username field data"));
                ClearObjectValue(txt_UserId);


                Reporter.Add(new Act("Enter user name"));
                SetValueToObject(txt_UserId, userName);

                Reporter.Add(new Act("Click on password field"));

                ClearObjectValue(txt_Password2);


                Reporter.Add(new Act("Enter password"));
                SetValueToObject(txt_Password, password);

                Reporter.Add(new Act("Verify SignIn button"));
                GetElementStateclick(btn_LogIn);

                isSuccess = true;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            return(isSuccess);
        }
예제 #6
0
        protected override void ExecuteTestCase()
        {
            Reporter.Add(new Chapter("Verify that whether the application save the username used in the last successful login,when the Remember Me setting is ON"));
            var pg_LoginPage = Page <HomeSiteLogin>(Driver, TestDataNode, Reporter);

            Step = "Launch the YPO application";
            Step = "Click on Remember Me buuton";
            pg_LoginPage.ClickonRemememberMe();
            Step = "Verify the Remember me option is ON";
            pg_LoginPage.VerifyRemememberMe(TestDataNode.SelectSingleNode("ExpectedStatus").InnerText);
            Step = "Login to YPO";
            pg_LoginPage.Login(TestDataNode.SelectSingleNode("UserName").InnerText, TestDataNode.SelectSingleNode("Password").InnerText);
            Step = "wait for Logged out the YPO Application";
            Thread.Sleep(65000);
            Step = "Logged out";
            Driver.Quit();
            Thread.Sleep(1000);
            Step = "Re-Launch the YPO application";
            DesiredCapabilities dc = new DesiredCapabilities();

            dc.SetCapability(IOSMobileCapabilityType.BundleId, "com.ypo.connect.qa");
            Driver = new IOSDriver <IOSElement>(new Uri("http://localhost:4723/wd/hub"), dc);
            Step   = "Re-Launched sussessfully";
            Step   = "Username should be prepopulated";
            pg_LoginPage.VerifyUserNameFieldText();
        }
예제 #7
0
        protected override void ExecuteTestCase()
        {
            Reporter.Add(new Chapter("Validating Sign In"));
            var pg_LoginPage = Page <HomeSiteLogin>(Driver, TestDataNode, Reporter);

            Step = "Click on Forgot Password? link";
            pg_LoginPage.NeedFurtherHelp();
        }
예제 #8
0
        //public IOSDriver<IOSElement> driver;
        protected override void ExecuteTestCase()
        {
            Reporter.Add(new Chapter("Validating Sign In"));
            var pg_LoginPage = Page <HomeSiteLogin>(Driver, TestDataNode, Reporter);

            Step = "Usernamefield_pre_populatedifRemembermeisturnedON";
            pg_LoginPage.InactiveUser(TestDataNode.SelectSingleNode("UserName").InnerText, TestDataNode.SelectSingleNode("Password").InnerText);
        }
        protected override void ExecuteTestCase()
        {
            Reporter.Add(new Chapter("Verify that Remember Me setting is OFF by default on the login screen"));
            var pg_LoginPage = Page <HomeSiteLogin>(Driver, TestDataNode, Reporter);

            Step = "Launch the YPO application";
            Step = "Verify the Remember me option is OFF";
            pg_LoginPage.VerifyRemememberMe(TestDataNode.SelectSingleNode("ExpectedStatus").InnerText);
        }
예제 #10
0
        //public IOSDriver<IOSElement> driver;

        protected override void ExecuteTestCase()
        {
            Reporter.Add(new Chapter("Validating Sign In"));
            var pg_LoginPage = Page <HomeSiteLogin>(Driver, TestDataNode, Reporter);

            Step = "Login to YPO";
            pg_LoginPage.Login(TestDataNode.SelectSingleNode("UserName").InnerText, TestDataNode.SelectSingleNode("Password").InnerText);
            Step = "Validate message";
            pg_LoginPage.InvalidLogin(TestDataNode.SelectSingleNode("invalidcredentialsval_msg").InnerText);
        }
        protected override void ExecuteTestCase()
        {
            Reporter.Add(new Chapter("To verify the display of Privacy Policy link on the login screen."));
            var pg_LoginPage = Page <HomeSiteLogin>(Driver, TestDataNode, Reporter);

            Step = "Launch the YPO application";
            Thread.Sleep(1000);
            Step = "Verify the Display Of -Privacy Policy- Link";
            pg_LoginPage.VerifyPrivacyPolicy();
        }
        protected override void ExecuteTestCase()
        {
            Reporter.Add(new Chapter("Verify that whether the Username field is empty when the user comes to the Login screen to sign in when the Remember Me setting is OFF"));
            var pg_LoginPage = Page <HomeSiteLogin>(Driver, TestDataNode, Reporter);

            Step = "Launch the YPO application";
            Thread.Sleep(1000);
            Step = "Verify the Display Of -Terms Of Use- Link";
            pg_LoginPage.VerifyTermsofUseLink();
        }
        protected override void ExecuteTestCase()
        {
            Reporter.Add(new Chapter("Verify that the member is able to enable Remember Me option on the login screen"));
            var pg_LoginPage = Page <HomeSiteLogin>(Driver, TestDataNode, Reporter);

            Step = "Launch the YPO application";
            Step = "Click on Remember Me buuton";
            pg_LoginPage.ClickonRemememberMe();
            Step = "Verify the Remember me option is ON";
            pg_LoginPage.VerifyRemememberMe(TestDataNode.SelectSingleNode("ExpectedStatus").InnerText);
        }
        //public IOSDriver<IOSElement> driver;
        protected override void ExecuteTestCase()
        {
            Reporter.Add(new Chapter("Validating Sign In"));
            var pg_CommonPage = Page <Common>(Driver, TestDataNode, Reporter);
            var pg_LoginPage  = Page <HomeSiteLogin>(Driver, TestDataNode, Reporter);

            Step = "Login with YPO_member";
            pg_LoginPage.Login(TestDataNode.SelectSingleNode("YPOChapterAdmin").InnerText, TestDataNode.SelectSingleNode("Password").InnerText);
            Step = "Wait for Directory Page";
            pg_LoginPage.WaitforDirectorypage();
        }
예제 #15
0
        protected override void ExecuteTestCase()
        {
            Reporter.Add(new Chapter("To verify the display of Terms of Use link on the login screen for unauthenticated users"));
            var pg_LoginPage = Page <HomeSiteLogin>(Driver, TestDataNode, Reporter);

            Step = "Launch the YPO application";
            Thread.Sleep(1000);

            Step = "Verify the Display Of -Terms Of Use- Link";
            pg_LoginPage.VerifyTermsofUseLink();
        }
        //public IOSDriver<IOSElement> driver;

        protected override void ExecuteTestCase()
        {
            Reporter.Add(new Chapter("Validating Sign In"));
            var pg_LoginPage = Page <HomeSiteLogin>(Driver, TestDataNode, Reporter);

            Step = "Enter 2 characters in username field and 7 characters in password field";
            pg_LoginPage.Insufficientchars27(TestDataNode.SelectSingleNode("UserName").InnerText, TestDataNode.SelectSingleNode("Password").InnerText);
            Step = "Enter 3 characters in username field and 6 characters in password field";
            pg_LoginPage.Insufficientchars36(TestDataNode.SelectSingleNode("UserName1").InnerText, TestDataNode.SelectSingleNode("Password1").InnerText);
            Step = "Enter 3 characters in username field and 7 characters in password field";
            pg_LoginPage.Insufficientchars37(TestDataNode.SelectSingleNode("UserName2").InnerText, TestDataNode.SelectSingleNode("Password2").InnerText);
        }
        public bool Claims()
        {
            bool isSuccess = false;

            try
            {
                if (pageBrowserType == BrowserTypes.MobileBrowser)
                {
                    Reporter.Add(new Act("Click on Menu button"));
                    ClickOnObject(btn_Menu);
                }
                if (pageBrowserType == BrowserTypes.WebBrowser)
                {
                    Reporter.Add(new Act("Click on Claims button"));
                    ClickOnObject(btn_claims);
                }


                //NavigateToURL("https://www.homesite.com/OnlineServicing/Policy/Claims/Center/");

                /* Reporter.Add(new Act("Click on Create a new Claim button"));
                 * ClickOnObject(btn_Newclaims);
                 * Thread.Sleep(3000);
                 * Reporter.Add(new Act("Validate if FNOL page shows up - String Renter Claim Form"));
                 * Reporter.Add(new Act("Click on Back to Claim center button"));
                 * ClickOnObject(btn_BackToClaimCenter);
                 * Thread.Sleep(3000);
                 * Reporter.Add(new Act("Validate if user navigates to Claim Center page shows up - String Closed Claims"));
                 * Reporter.Add(new Act("Click on Visit Help Center"));
                 * ClickOnObject(btn_visitHelpCenter);
                 * Reporter.Add(new Act("Validate if user navigates to Claim Center page shows up - String Claims FAQs"));
                 * Thread.Sleep(3000);*/
                Thread.Sleep(4000);
                Reporter.Add(new Act("Validate if previous claims information shows - Claim number 2151715"));
                Reporter.Add(new Act("Validate if previous claims information shows - Status Closed"));
                Reporter.Add(new Act("Validate if previous claims information shows - Loss type - Bodily Injury"));
                Reporter.Add(new Act("Validate if previous claims information shows - Loss Date - 12/28/2016"));


                if (pageBrowserType == BrowserTypes.MobileBrowser)
                {
                    Reporter.Add(new Act("Click on Menu button"));
                    ClickOnObject(btn_Menu);
                }

                isSuccess = true;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            return(isSuccess);
        }
        public bool ClickonPrivacyPolicy()
        {
            bool isSuccess = false;

            try
            {
                ClickOnObject(btn_PrivacyPolicy);
                Reporter.Add(new Act("Successfully Clicked on Privacy Policy Link"));
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            return(isSuccess);
        }
        public bool LogOut2()
        {
            bool isSuccess = false;

            try
            {
                Reporter.Add(new Act("Click on SignOut Button"));
                ClickOnObject(btn_BkHelpCenter);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            return(isSuccess);
        }
        public bool VerifyDocumentLoadedOrNot()
        {
            bool isSuccess = false;

            try
            {
                WaitForElementVisible(pdf_DocumentPage);
                Reporter.Add(new Act("Corresponding PDF Document opened successfully."));
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            return(isSuccess);
        }
        protected override void ExecuteTestCase()
        {
            Reporter.Add(new Chapter("To Verify that Privacy Policy document will be opened in the device's default PDF viewer application for unauthenticated users"));
            var pg_LoginPage = Page <HomeSiteLogin>(Driver, TestDataNode, Reporter);

            Step = "Launch the YPO application";
            Thread.Sleep(1000);
            Step = "Verify the Display Of -Privacy Policy- Link";
            pg_LoginPage.VerifyPrivacyPolicy();
            Step = "Click on -Privacy Policy- Link";
            pg_LoginPage.ClickonPrivacyPolicy();
            Thread.Sleep(1000);
            Step = "Verify the -Privacy Policy- Link pdf is Opened";
            pg_LoginPage.VerifyDocumentLoadedOrNot();
        }
        public bool closeDocument()
        {
            bool isSuccess = false;

            try
            {
                ClickOnObject(btn_Close);
                Reporter.Add(new Act("Document Closed Successfully."));
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            return(isSuccess);
        }
        public bool ClickonRemememberMe()
        {
            bool isSuccess = false;

            try
            {
                ClickOnObject(btn_RememeberMe);
                Reporter.Add(new Act("Successfully Clicked on RememeberMe Button"));
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            return(isSuccess);
        }
예제 #24
0
        protected override void ExecuteTestCase()
        {
            Reporter.Add(new Chapter("Verify that Terms of Use document will be opened in the device's default PDF viewer application"));
            var pg_LoginPage = Page <HomeSiteLogin>(Driver, TestDataNode, Reporter);

            Step = "Launch the YPO application";
            Thread.Sleep(1000);
            Step = "Verify the Display Of -Terms Of Use- Link";
            pg_LoginPage.VerifyTermsofUseLink();
            Step = "Click on -Terms Of Use- Link";
            pg_LoginPage.ClickonTermsofUseLink();
            Thread.Sleep(1000);
            Step = "Verify the -Terms Of Use- Link pdf is Opened";
            pg_LoginPage.VerifyDocumentLoadedOrNot();
        }
        public bool WaitforDirectorypage()
        {
            bool isSuccess = false;

            try
            {
                Reporter.Add(new Act("Wait for Directory Page"));
                WaitForElementVisible(txt_Directory);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            return(isSuccess);
        }
        public bool ClickonTermsofUseLink()
        {
            bool isSuccess = false;

            try
            {
                ClickOnObject(btn_TermsOfUse);
                Reporter.Add(new Act("Successfully Clicked on Terms of Use Link"));
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            return(isSuccess);
        }
예제 #27
0
        public bool BuyProduct()
        {
            bool isSuccess = false;

            try
            {
                Reporter.Add(new Act(String.Format("Click on Buy Now")));
                ClickOnObject(btn_BuyNow);
                isSuccess = true;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            return(isSuccess);
        }
예제 #28
0
        public bool CheckResultsAndSelectOne()
        {
            bool isSuccess = false;

            try
            {
                Reporter.Add(new Act(String.Format("Select top one match from the search results")));
                ClickOnObject(lnk_SearchResults(TestDataNode.SelectSingleNode("SearchValue").InnerText));
                isSuccess = true;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            return(isSuccess);
        }
        public bool VerifyPrivacyPolicy()
        {
            bool isSuccess = false;

            try
            {
                //WaitForElementVisible(Link_PrivacyPolicy);
                WaitForElementVisible(btn_PrivacyPolicy);
                Reporter.Add(new Act("TermsofUse Link is Present in Login Screen"));
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            return(isSuccess);
        }
예제 #30
0
        protected void VerifyResultSortedByColumnName(string expcolumnName, By locator)
        {
            try
            {
                int            i            = 1;
                string         val          = string.Empty;
                IList <string> DisplayNames = new List <string>();

                IWebElement table = GetNativeElement(locator);
                ICollection <IWebElement> rows    = GetNativeElementsInAElement(table, By.TagName("tr"));
                ICollection <IWebElement> columns = GetNativeElementsInAElement(table, By.TagName("td"));
                string[] words = locator.ToString().Split(':');
                string   path  = words[1].Trim();
                foreach (var row in rows)
                {
                    IWebElement displayName = row.FindElement(By.XPath(path + "/tbody/" + "tr[" + i + "]" + "/td[5]/a"));
                    string      value       = displayName.Text.ToString();
                    DisplayNames.Add(value);
                    i++;
                    if (i == rows.Count)
                    {
                        //Sort elements by Alphabets
                        List <string> list = DisplayNames.ToList <string>();
                        list.Sort();

                        for (int k = 0; k <= DisplayNames.Count - 1; k++)
                        {
                            if (list.Count == DisplayNames.Count)
                            {
                                if (list[k] == DisplayNames[k])
                                {
                                    if (k == DisplayNames.Count - 1)
                                    {
                                        Reporter.Add(new Act("Elements are displayed in the alphabetical order"));
                                        return;
                                    }
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Reporter.Add(new Act(ex.Message));
            }
        }