public void CustomLoginAction(LoginRedirectEventArgs args) { //Login Page details go here. You will need to find out the id of the password field on the form as well as the submit button. //You will also need to add a reference to the Selenium Webdriver to use the base driver. //Example //-------------------------------------------------------------------------------------- var d = args.Driver; d.FindElement(By.Id("userNameInput")).SendKeys(args.Username.ToUnsecureString()); d.FindElement(By.Id("passwordInput")).SendKeys(args.Password.ToUnsecureString()); d.ClickWhenAvailable(By.Id("submitButton"), new TimeSpan(0, 0, 2)); //Insert any additional code as required for the SSO scenario //Wait for CRM Page to load d.WaitUntilVisible(By.XPath(Elements.Xpath[Reference.Login.CrmMainPage]) , new TimeSpan(0, 0, 60), e => { d.WaitForPageToLoad(); d.SwitchTo().Frame(0); d.WaitForPageToLoad(); }); //-------------------------------------------------------------------------------------- }
public void ADFSLoginAction(LoginRedirectEventArgs args) { var d = args.Driver; d.FindElement(By.Id("passwordInput")).SendKeys(args.Password.ToUnsecureString()); d.ClickWhenAvailable(By.Id("submitButton"), new TimeSpan(0, 0, 2)); d.WaitForPageToLoad(); }
public void ADFSLoginAction(LoginRedirectEventArgs args) { //Login Page details go here. You will need to find out the id of the password field on the form as well as the submit button. //You will also need to add a reference to the Selenium Webdriver to use the base driver. //Example //-------------------------------------------------------------------------------------- // var d = args.Driver; // d.FindElement(By.Id("passwordInput")).SendKeys(args.Password.ToUnsecureString()); // d.ClickWhenAvailable(By.Id("submitButton"), new TimeSpan(0, 0, 2)); // d.WaitForPageToLoad(); //-------------------------------------------------------------------------------------- }
public void FederatedLoginAction(LoginRedirectEventArgs args) { // Login Page details go here. // You will need to find out the id of the password field on the form as well as the submit button. // You will also need to add a reference to the Selenium Webdriver to use the base driver. // Example var driver = args.Driver; var passwordInput = driver.WaitUntilAvailable(By.Id("passwordInput")); passwordInput.SendKeys(args.Password.ToUnsecureString()); driver.ClickWhenAvailable(By.Id("submitButton"), TimeSpan.FromSeconds(5)); // Insert any additional code as required for the SSO scenario // Wait for Maker Portal Page to load driver.WaitUntilVisible(By.XPath(Elements.Xpath[Reference.Login.MainPage]) , new TimeSpan(0, 2, 0), e => { try { e.WaitUntilVisible(By.ClassName("apps-list"), new TimeSpan(0, 0, 30)); } catch (Exception exc) { Console.WriteLine("The Maker Portal Apps List did not return visible."); throw new InvalidOperationException($"The Maker Portal Apps List did not return visible.: {exc}"); } e.WaitForPageToLoad(); }, f => { Console.WriteLine("Login.MainPage failed to load in 2 minutes using Federated Identity Login."); throw new Exception("Login page failed using Federated Identity Login."); }); }