Comments (7)
ADFSLoginTest.txt
I am also running into this problem except it isn't occasional CRM asks every-time I login and the login test fails with "
Test Name: TestADFSLogin
Test FullName: Microsoft.Dynamics365.UIAutomation.Sample.ADFSLogin.TestADFSLogin
Test Source: C:\Users\kcarn\Documents\Test Studio Projects\EasyRepro-master\Microsoft.Dynamics365.UIAutomation.Sample\ADFSLogin.cs : line 23
Test Outcome: Failed
Test Duration: 0:00:14.5637165
Result StackTrace:
at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary2 parameters) at OpenQA.Selenium.Remote.RemoteWebElement.get_Location() at Microsoft.Dynamics365.UIAutomation.Browser.InteractiveBrowser.EventDriver_ElementClicked(Object sender, WebElementEventArgs e) in C:\Users\kcarn\Documents\Test Studio Projects\EasyRepro-master\Microsoft.Dynamics365.UIAutomation.Browser\InteractiveBrowser.cs:line 458 at OpenQA.Selenium.Support.Events.EventFiringWebDriver.OnElementClicked(WebElementEventArgs e) at OpenQA.Selenium.Support.Events.EventFiringWebDriver.EventFiringWebElement.Click() at Microsoft.Dynamics365.UIAutomation.Browser.SeleniumExtensions.<>c__DisplayClass2_0.<ClickWhenAvailable>b__0(IWebDriver d) in C:\Users\kcarn\Documents\Test Studio Projects\EasyRepro-master\Microsoft.Dynamics365.UIAutomation.Browser\Extensions\SeleniumExtensions.cs:line 47 at Microsoft.Dynamics365.UIAutomation.Browser.SeleniumExtensions.WaitUntilClickable(IWebDriver driver, By by, TimeSpan timeout, Action
1 successCallback, Action1 failureCallback) in C:\Users\kcarn\Documents\Test Studio Projects\EasyRepro-master\Microsoft.Dynamics365.UIAutomation.Browser\Extensions\SeleniumExtensions.cs:line 540 at Microsoft.Dynamics365.UIAutomation.Browser.SeleniumExtensions.ClickWhenAvailable(IWebDriver driver, By by, TimeSpan timeout) in C:\Users\kcarn\Documents\Test Studio Projects\EasyRepro-master\Microsoft.Dynamics365.UIAutomation.Browser\Extensions\SeleniumExtensions.cs:line 44 at Microsoft.Dynamics365.UIAutomation.Sample.ADFSLogin.ADFSLoginAction(LoginRedirectEventArgs args) in C:\Users\kcarn\Documents\Test Studio Projects\EasyRepro-master\Microsoft.Dynamics365.UIAutomation.Sample\ADFSLogin.cs:line 35 at Microsoft.Dynamics365.UIAutomation.Api.LoginPage.Login(IWebDriver driver, Uri uri, SecureString username, SecureString password, Action
1 redirectAction) in C:\Users\kcarn\Documents\Test Studio Projects\EasyRepro-master\Microsoft.Dynamics365.UIAutomation.Api\Pages\LoginPage.cs:line 126
at Microsoft.Dynamics365.UIAutomation.Browser.DelegateBrowserCommand5.ExecuteCommand(IWebDriver driver, Object[] params) in C:\Users\kcarn\Documents\Test Studio Projects\EasyRepro-master\Microsoft.Dynamics365.UIAutomation.Browser\DelegateBrowserCommand.cs:line 134 at Microsoft.Dynamics365.UIAutomation.Browser.BrowserCommand
1.Execute[T1,T2,T3,T4,T5,T6,T7,T8,T9](IWebDriver driver, T1 p1, T2 p2, T3 p3, T4 p4, T5 p5, T6 p6, T7 p7, T8 p8, T9 p9) in C:\Users\kcarn\Documents\Test Studio Projects\EasyRepro-master\Microsoft.Dynamics365.UIAutomation.Browser\BrowserCommand.cs:line 167
at Microsoft.Dynamics365.UIAutomation.Browser.BrowserCommand1.Execute[T1,T2,T3,T4](IWebDriver driver, T1 p1, T2 p2, T3 p3, T4 p4) in C:\Users\kcarn\Documents\Test Studio Projects\EasyRepro-master\Microsoft.Dynamics365.UIAutomation.Browser\BrowserCommand.cs:line 60 at Microsoft.Dynamics365.UIAutomation.Browser.BrowserPage.Execute[TResult,T1,T2,T3,T4](String commandName, Func
6 delegate, T1 p1, T2 p2, T3 p3, T4 p4) in C:\Users\kcarn\Documents\Test Studio Projects\EasyRepro-master\Microsoft.Dynamics365.UIAutomation.Browser\BrowserPage.cs:line 102
at Microsoft.Dynamics365.UIAutomation.Api.LoginPage.Login(Uri uri, SecureString username, SecureString password, Action`1 redirectAction) in C:\Users\kcarn\Documents\Test Studio Projects\EasyRepro-master\Microsoft.Dynamics365.UIAutomation.Api\Pages\LoginPage.cs:line 84
at Microsoft.Dynamics365.UIAutomation.Sample.ADFSLogin.TestADFSLogin() in C:\Users\kcarn\Documents\Test Studio Projects\EasyRepro-master\Microsoft.Dynamics365.UIAutomation.Sample\ADFSLogin.cs:line 26
Result Message:
Test method Microsoft.Dynamics365.UIAutomation.Sample.ADFSLogin.TestADFSLogin threw exception:
OpenQA.Selenium.StaleElementReferenceException: stale element reference: element is not attached to the page document
(Session info: chrome=62.0.3202.94)
(Driver info: chromedriver=2.33.506120 (e3e53437346286c0bc2d2dc9aa4915ba81d9023f),platform=Windows NT 10.0.15063 x86_64)
"
Even though the browser window showed that it logged in and is at the "would you like to stay logged in" prompt.
Also of note,
If I set the browser to Firefox the login test indicates that it passes but if I step through the code in the debugger it fails at the "do you want to stay logged in?" screen. My guess is that the failure is masked for a number of people due to the way that EasyRepro fails and the fact that it does not error on stale or not present elements. I have still not figured out exactly what function is causing the failure,
This line, in SeleniumExtensions.cs, is the one that starts the end
if (success.HasValue && success.Value && successCallback != null)
successCallback(driver);
This sends us to line 114 in Browser commands.cs
Using Windows 10 Pro Build 15063
Microsoft Visual Studio Enterprise 2017 (2)
Version 15.3.5
VisualStudio.15.Release/15.3.5+26730.16
Microsoft .NET Framework
Version 4.7.02046
Installed Version: Enterprise
Visual C# 2017 00369-60000-00001-AA951
Microsoft Visual C# 2017
USING FireFox;
I put a break-point at the thread sleep after the click event should have been executed in the browser, according to the code,
IWebDriver Cdriver = args.Driver;
Cdriver.FindElement(By.Id("passwordInput")).SendKeys(args.Password.ToUnsecureString());
Cdriver.ClickWhenAvailable(By.Id("submitButton"), new TimeSpan(0, 1, 6));
Thread.Sleep(2500);
And luckily the submit button was not clicked. If I clicked Submit and Clicked yes to stay logged in the code executes "correctly" in Firefox. In Chrome it still errors out, so the click bug in firefox sometimes get's around the failure to handle login.
+++++++++++++++++++++++++++++++++++++++++++++++
The code below works.
IWebDriver Cdriver = args.Driver;
Cdriver.FindElement(By.Id("passwordInput")).SendKeys(args.Password.ToUnsecureString());
//Cdriver.ClickWhenAvailable(By.Id("submitButton"), new TimeSpan(0, 1, 6));
Cdriver.FindElement(By.Id("submitButton")).Submit();
Thread.Sleep(2500);
Cdriver.FindElement(By.Id("idSIButton9")).Submit();
Cdriver.WaitForPageToLoad();
I think the issue is in how .Click works.
If you change the Submit to .Click it fails. So this may be a driver issue. But the work around may be to use Submit instead of Click.
from easyrepro.
^This. Right now, if I manually interfere and click the "Yes" or "No" button on that page, it will continue for that test fine; however, considering the whole point of automated testing is so that the user doesn't have to interact manually, I would place an update for this scenario to be of high importance.
from easyrepro.
This issue is fixed in the latest release. Please test with the latest build and let us know if you run into any issues.
Thanks
from easyrepro.
Same problem.
System.Exception occurred
HResult=0x80131500
Message=Login page failed.
Source=Microsoft.Dynamics365.UIAutomation.Api
StackTrace:
at Microsoft.Dynamics365.UIAutomation.Api.LoginPage.<>c.b__12_2(IWebDriver f) in C:\Users\Trent\Source\Repos\JT_EasyRepro\Microsoft.Dynamics365.UIAutomation.Api\Pages\LoginPage.cs:line 148
at Microsoft.Dynamics365.UIAutomation.Browser.SeleniumExtensions.WaitUntilVisible(IWebDriver driver, By by, TimeSpan timeout, Action1 successCallback, Action
1 failureCallback) in C:\Users\Trent\Source\Repos\JT_EasyRepro\Microsoft.Dynamics365.UIAutomation.Browser\Extensions\SeleniumExtensions.cs:line 497
at Microsoft.Dynamics365.UIAutomation.Api.LoginPage.Login(IWebDriver driver, Uri uri, SecureString username, SecureString password, Action1 redirectAction) in C:\Users\Trent\Source\Repos\JT_EasyRepro\Microsoft.Dynamics365.UIAutomation.Api\Pages\LoginPage.cs:line 145 at Microsoft.Dynamics365.UIAutomation.Browser.DelegateBrowserCommand
5.ExecuteCommand(IWebDriver driver, Object[] params) in C:\Users\Trent\Source\Repos\JT_EasyRepro\Microsoft.Dynamics365.UIAutomation.Browser\DelegateBrowserCommand.cs:line 134
at Microsoft.Dynamics365.UIAutomation.Browser.BrowserCommand1.Execute[T1,T2,T3,T4,T5,T6,T7,T8,T9](IWebDriver driver, T1 p1, T2 p2, T3 p3, T4 p4, T5 p5, T6 p6, T7 p7, T8 p8, T9 p9) in C:\Users\Trent\Source\Repos\JT_EasyRepro\Microsoft.Dynamics365.UIAutomation.Browser\BrowserCommand.cs:line 167 at Microsoft.Dynamics365.UIAutomation.Browser.BrowserCommand
1.Execute[T1,T2,T3,T4](IWebDriver driver, T1 p1, T2 p2, T3 p3, T4 p4) in C:\Users\Trent\Source\Repos\JT_EasyRepro\Microsoft.Dynamics365.UIAutomation.Browser\BrowserCommand.cs:line 60
at Microsoft.Dynamics365.UIAutomation.Browser.BrowserPage.Execute[TResult,T1,T2,T3,T4](String commandName, Func`6 delegate, T1 p1, T2 p2, T3 p3, T4 p4) in C:\Users\Trent\Source\Repos\JT_EasyRepro\Microsoft.Dynamics365.UIAutomation.Browser\BrowserPage.cs:line 102
at Microsoft.Dynamics365.UIAutomation.Api.LoginPage.Login(Uri uri, SecureString username, SecureString password) in C:\Users\Trent\Source\Repos\JT_EasyRepro\Microsoft.Dynamics365.UIAutomation.Api\Pages\LoginPage.cs:line 71
at Microsoft.Dynamics365.UIAutomation.Testing.Tests.JT.BSCR.CreateAccountTests.TestCreateNewAccountDS() in C:\Users\Trent\source\repos\JT_EasyRepro\Microsoft.Dynamics365.UIAutomation.Testing\Tests\JT\BSCR\CreateAccount.cs:line 25
at Microsoft.Dynamics365.UIAutomation.Testing.Controller.Run() in C:\Users\Trent\source\repos\JT_EasyRepro\Microsoft.Dynamics365.UIAutomation.Testing\Controller.cs:line 18
at Microsoft.Dynamics365.UIAutomation.Testing.Program.Main(String[] args) in C:\Users\Trent\source\repos\JT_EasyRepro\Microsoft.Dynamics365.UIAutomation.Testing\Program.cs:line 9
from easyrepro.
This is a different error. Looks like you are logging in fine but it's timing out when waiting for the CRM Application.
driver.WaitUntilVisible(By.XPath(Elements.Xpath[Reference.Login.CrmMainPage])
, new TimeSpan(0, 0, 60),
e => { e.WaitForPageToLoad(); },
f => { throw new Exception("Login page failed."); });
We've seen the login take longer then 60 seconds to load unfortunately.
from easyrepro.
It's logging in correctly but it does not handle the "Stay Logged In?" menu, which is why the main CRM page does not load.
from easyrepro.
I am having this issue with this line of code in the login page. EasyRepro logs me in and I get to my dynamics dashboard.
I comment it out and wait it works but for some reason I am not sure why this fails.
from easyrepro.
Related Issues (20)
- Compatibility with selenium 4.11 version and CFT
- [BUG] Command Bar not found when header is expanded
- [FEATURE] Get/Retrieve/Search records from timeline
- [BUG] Setting value on Subject field on Case entity (tree-view type)
- [FEATURE] Read the Values from the SLA Timer Section
- [HOW-TO] Run tests on Jenkins
- [HOW-TO] Use with Customer Service Workspace app
- [HOW-TO] <implement read data from excel in easyrepro> HOT 2
- Command xrmApp.Navigation.OpenSubArea("Area", "Sub-Area"); running in Local but failing in pipeline
- How to Close Alert dialogue box of Dynamics crm Opened via Xrm.Navigation.openAlertDialog.
- .NET 6 not .NET Core 6
- Timeout Issue with System.Net.HttpWebRequest.GetResponse()
- [BUG] <Getting webdriver exception "unknown error: unable to discover open pages" when running the test on server through ADO test plan. Code works locally>
- [BUG]GetFormNotifications() does not get notifications text. Get error
- Moving to .NET Core HOT 1
- MFA secret key issue HOT 8
- How to click on the phone (subgrid record header) phone number HOT 5
- Url is not working even after adding & in the url in app.config file HOT 1
- How can I effectively load and execute the EasyRepro framework within Visual Studio Code? HOT 1
- Not able to find xpath from inspect element for any change area options.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from easyrepro.