Ejemplo n.º 1
0
        //Register to SkillSwap Website
        public void JoinStep(SignUpDetails signUpObj)
        {
            //Click on Join link to register to the SkillSwap Website
            JoinLink.Click();

            //Enter First Name
            FirstName.SendKeys(signUpObj.FirstName);

            //Enter Last Name
            LastName.SendKeys(signUpObj.LastName);

            //Enter Email address
            EmailAddress.SendKeys(signUpObj.EmailAddress);

            //Enter Password
            Password.SendKeys(signUpObj.Password);

            //Enter Confirm Password
            ConfirmPassword.SendKeys(signUpObj.ConfirmPassword);

            //Click on Terms and Conditions checkbox
            TermAndCondition.Click();

            //Click on Join button
            JoinButton.Click();
        }
Ejemplo n.º 2
0
        //Function to register new user
        public void Register()
        {
            ExcelLibHelpers.PopulateInCollection(ServiceData.ExcelPath, "SignUp");

            //Click Join to sign up for the skill exchange Portal
            Join.Click();

            //Enter the data for First name
            FirstName.SendKeys(ExcelLibHelpers.ReadData(2, "FirstName"));

            //Enter the data for Last name
            LastName.SendKeys(ExcelLibHelpers.ReadData(2, "LastName"));

            //Enter the data for EmailID
            Email.SendKeys(ExcelLibHelpers.ReadData(2, "EmailID"));

            //Enter the data for Password
            Password.SendKeys(ExcelLibHelpers.ReadData(2, "Password"));

            //Enter the data for Confirm Password
            CnfrmPswrd.SendKeys(ExcelLibHelpers.ReadData(2, "ConfirmPassword"));

            //Check on the terms and conditions check box prior to clicking the Join button
            TermsCndtnsChkbox.Click();

            //Click on the Join button to complete the registration
            JoinButton.Click();

            //Implicit wait for the registeration pop up to be available
            Wait.wait(2, driver);

            try
            {
                if (FirstTime)
                {
                    if (PopUp.Text == "Registration Successfull")
                    {
                        TestContext.WriteLine(PopUp.Text);
                    }
                }
                else
                {
                    String EmailValidationMsg = EmailValidation.Text;
                    if (EmailValidationMsg == "This email has already been used to register an account.")
                    {
                        TestContext.WriteLine("The account has already been created with this emailID, Please log in using exisitng account details");
                    }
                }
            }
            catch (Exception e)
            {
                Assert.Fail("Registration failed due to 1 or more errors. Make sure that there isn't an existing account", e.Message);
            }
        }