コード例 #1
0
        internal void SetPassword()
        {
            //Populate the excel data
            GlobalDefinitions.ExcelLib.PopulateInCollection(Base.ExcelPath, "SignIn");

            //Click on Name
            GlobalDefinitions.WaitForElementVisibility(GlobalDefinitions.driver, "XPath", "//*[@id='account-profile-section']/div/div[1]/div[2]/div/span", 10000);
            NameBtn.Click();

            //Click on change password
            GlobalDefinitions.WaitForElementVisibility(GlobalDefinitions.driver, "XPath", "//*[@id='account-profile-section']/div/div[1]/div[2]/div/span/div/a[2]", 10000);
            ChgPwdBtn.Click();

            //Enter old password
            GlobalDefinitions.WaitForElementVisibility(GlobalDefinitions.driver, "XPath", "/html/body/div[4]/div/div[2]/form/div[1]/input", 10000);
            CurrentPwd.Click();
            CurrentPwd.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "NewPassword"));


            //Enter new password
            GlobalDefinitions.WaitForElementVisibility(GlobalDefinitions.driver, "XPath", "/html/body/div[4]/div/div[2]/form/div[2]/input", 10000);
            NewPwd.Click();
            NewPwd.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Password"));

            //Confirm new password
            GlobalDefinitions.WaitForElementVisibility(GlobalDefinitions.driver, "XPath", "/html/body/div[4]/div/div[2]/form/div[3]/input", 10000);
            ConfirmNewPwd.Click();
            ConfirmNewPwd.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Password"));

            //Click on save button
            GlobalDefinitions.WaitForElementVisibility(GlobalDefinitions.driver, "XPath", "/html/body/div[4]/div/div[2]/form/div[4]/button", 10000);
            SaveBtn.Click();
        }
コード例 #2
0
 public void ChangePwdSteps()
 {
     //initialize excel data reader
     GlobalDefinitions.ExcelLib.PopulateInCollection(Base.ExcelPath, "ChangePassword");
     UserNameTab.Click();
     GlobalDefinitions.wait(10);
     ChangPwdTab.Click();
     //check if its an alert
     CurrentPwd.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Current Password"));
     NewPwd.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "New Password"));
     ConfirmPwd.SendKeys(GlobalDefinitions.ExcelLib.ReadData(2, "Confirm Password"));
     SavePwd.Click();
     GlobalDefinitions.WaitForElement(GlobalDefinitions.driver, By.XPath("//div[contains(@class,'ns-box ns-growl ns-effect-jelly ns-type-success ns-show')]"), 10);
 }