[BUG] NoSuchElementException for email input field during login in system with single sign-on
See original GitHub issueBug Report
EasyRepro Version
- Microsoft Dynamics 365 Online Version 8.2 (8.2.x) (DB 8.2.x) online
- Microsoft Dynamics 365 Online Version 9.0 (9.0.x) (DB 9.0.x) online
- Microsoft Dynamics 365 Online Version 9.0.2 (9.0.2) (DB 9.0.2) online
- Microsoft Dynamics 365 Online Version 9.1 (9.1.x) (DB 9.1.x) online
UCI or Classic Web
- UCI (XrmApp)
- Classic Web (XrmBrowser)
Online or On Premise
- Online
- On Premise
Browser
- Chrome (v73)
- Firefox
- IE
- Edge
Describe the bug
Upon running the test identified by Microsoft.Dynamics365.UIAutomation.Sample.Web.CreateAccount.WEBTestCreateNewAccount
following call xrmBrowser.LoginPage.Login(_xrmUri, _username, _password);
(here) fails with the exception below as our system will auto-sign-in even in a Chrome incognito session.
OpenQA.Selenium.NoSuchElementException
HResult=0x80131500
Message=no such element: Unable to locate element: {"method":"xpath","selector":"//input[@type='email']"}
(Session info: chrome=73.0.3683.86)
(Driver info: chromedriver=73.0.3683.68 (47787ec04b6e38e22703e856e101e840b65afe72),platform=Windows NT 10.0.18363 x86_64)
Source=WebDriver
StackTrace:
at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
at OpenQA.Selenium.Remote.RemoteWebDriver.FindElement(String mechanism, String value)
at OpenQA.Selenium.Remote.RemoteWebDriver.FindElementByXPath(String xpath)
at OpenQA.Selenium.By.<>c__DisplayClass19_0.<XPath>b__0(ISearchContext context)
at OpenQA.Selenium.By.FindElement(ISearchContext context)
at OpenQA.Selenium.Remote.RemoteWebDriver.FindElement(By by)
at Microsoft.Dynamics365.UIAutomation.Browser.SeleniumExtensions.<>c__DisplayClass45_0.<WaitUntilAvailable>b__0(IWebDriver d) in [redacted]\EasyRepro-develop\EasyRepro-develop\Microsoft.Dynamics365.UIAutomation.Browser\Extensions\SeleniumExtensions.cs:line 591
at OpenQA.Selenium.Support.UI.DefaultWait`1.Until[TResult](Func`2 condition)
Code to reproduce
See this.
Expected behavior
The code should not throw an exception and continue on line 26.
Additional context
The configuration files has been updated to fit our system.
When logging out in Dynamics 365, closing the browser, opening the browser and going to the Dynamics 365 page again. I am automatically logged in. This is also the case in Chrome incognito.
I am using Chrome 73 because we did not have newer available that was also older than 77, which is the latest Chrome.WebDriver package available in Nuget.
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (4 by maintainers)
Top GitHub Comments
@VivianVoss - We’ve merged a change into the develop branch via #694 . Could you try testing out this new Login method and see if it accommodates your scenario? Based on the description of events, I believe it should.
We’re in a holiday code freeze at the moment, but could get this change into the core releases/v9.1 branch by January 3rd, 2020 if you can confirm this works.
Edit: For the legacy webClient APIs, the code should look like:
xrmBrowser.LoginPage.Login(_xrmUri);
Hi all, I have just tried the tests again but with UCI and it seems to work fine. Thanks for the help 😃