Giter VIP home page Giter VIP logo

Comments (9)

dtu11 avatar dtu11 commented on May 23, 2024

The latest update should address this change. Let me know if you have the latest changes and the login api doesn't get past this issue.

from easyrepro.

maichung77 avatar maichung77 commented on May 23, 2024

Is it fixed in 8.2 version? I just downloaded the 8.2 version and this issue is still there.

from easyrepro.

dtu11 avatar dtu11 commented on May 23, 2024

That branch has the update. If you check the LoginPage.cs there should be code that looks like below.

if (driver.IsVisible(By.XPath(Elements.Xpath[Reference.Login.StaySignedIn])))
{
driver.ClickWhenAvailable(By.XPath(Elements.Xpath[Reference.Login.StaySignedIn]));
driver.FindElement(By.XPath(Elements.Xpath[Reference.Login.StaySignedIn])).Submit();
}
You may be running into another issue. Does it just stop on that page?

from easyrepro.

maichung77 avatar maichung77 commented on May 23, 2024

The LoginPage.cs does have the code you mentioned. The following exception was thrown when executing the following line in the Login method. driver.FindElement(By.XPath(Elements.Xpath[Reference.Login.LoginPassword])).SendKeys(password.ToUnsecureString());

Error Message: {"no such element: Unable to locate element: {"method":"xpath","selector":"//input[@type='password']"}\n (Session info: chrome=61.0.3163.91)\n (Driver info: chromedriver=2.31.488763 (092de99f48a300323ecf8c2a4e2e7cab51de5ba8),platform=Windows NT 10.0.14393 x86_64)"}

I'm using Office 365 authentication, so a password is not needed when logging in from the browser. I have confirmed that the correct online user name and password are stored in App.config.

from easyrepro.

dtu11 avatar dtu11 commented on May 23, 2024

Ok, the login process is expecting the password input to be there. If your authentication is bypassing that step then the API will not work. You will need to either 1) modify the Login API to skip that step or 2) Look at the ADFSLogin.cs sample and use that to build you're own login logic that bypass the password input. Make sense?

from easyrepro.

maichung77 avatar maichung77 commented on May 23, 2024

Interesting, I was able to get it working by putting the thread to sleep for 1 second and commenting out a few lines of code in the Login method as shown below. Is this a valid workaround?

//Wait for a second
Thread.Sleep(1000);
//driver.FindElement(By.XPath(Elements.Xpath[Reference.Login.LoginPassword])).SendKeys(password.ToUnsecureString()); //driver.FindElement(By.XPath(Elements.Xpath[Reference.Login.LoginPassword])).SendKeys(Keys.Tab);
//driver.FindElement(By.XPath(Elements.Xpath[Reference.Login.LoginPassword])).Submit();

if (driver.IsVisible(By.XPath(Elements.Xpath[Reference.Login.StaySignedIn])))
{
driver.ClickWhenAvailable(By.XPath(Elements.Xpath[Reference.Login.StaySignedIn]));
driver.FindElement(By.XPath(Elements.Xpath[Reference.Login.StaySignedIn])).Submit();
}

from easyrepro.

dtu11 avatar dtu11 commented on May 23, 2024

That is a valid workaround that will work for your environment. Just keep in mind that if the authentication changes and requires a password then it will stop working. It's either that or look at the ADFSLogin.cs as an alternative. That sample basically enters the email address, waits for the redirect and then calls your custom method that handles your login page. In your case it won't require a password.

Let me know if you need anything else.

from easyrepro.

maichung77 avatar maichung77 commented on May 23, 2024

Got it, thanks very much Daren for your help!

from easyrepro.

dtu11 avatar dtu11 commented on May 23, 2024

You're welcome!

from easyrepro.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.