From ebbb0c26079da569d2896a29da7d530b8785abe3 Mon Sep 17 00:00:00 2001 From: Padget Avery Date: Fri, 10 Sep 2021 15:40:26 +0100 Subject: [PATCH] Updated login steps to allow single sign on --- .../Steps/LoginSteps.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bindings/src/Capgemini.PowerApps.SpecFlowBindings/Steps/LoginSteps.cs b/bindings/src/Capgemini.PowerApps.SpecFlowBindings/Steps/LoginSteps.cs index 9a17eb43..0077149a 100644 --- a/bindings/src/Capgemini.PowerApps.SpecFlowBindings/Steps/LoginSteps.cs +++ b/bindings/src/Capgemini.PowerApps.SpecFlowBindings/Steps/LoginSteps.cs @@ -35,8 +35,13 @@ public static void Login(IWebDriver driver, Uri orgUrl, string username, string usernameInput.SendKeys(Keys.Enter); IWebElement passwordInput = driver.WaitUntilClickable(By.XPath(Elements.Xpath[Reference.Login.LoginPassword]), 30.Seconds()); - passwordInput.SendKeys(password); - passwordInput.Submit(); + + // check to see if password is needed as it isn't needed in SSO scenario + if (passwordInput != null) + { + passwordInput.SendKeys(password); + passwordInput.Submit(); + } var staySignedIn = driver.WaitUntilClickable(By.XPath(Elements.Xpath[Reference.Login.StaySignedIn]), 10.Seconds()); if (staySignedIn != null)