microsoft / EasyRepro

Automated UI testing API for Dynamics 365
MIT License
513 stars 286 forks source link

javascript error: Cannot read property 'isAppIdle' of undefined #571

Closed ArvindBhat83 closed 5 years ago

ArvindBhat83 commented 5 years ago

Below line in function WaitForTransaction(this IWebDriver driver, int maxWaitTimeInSeconds) is returning an error.

Filename - SeleniumExtensions.cs Line 467 - state = (bool)driver.ExecuteScript("return window.UCWorkBlockTracker.isAppIdle()", "")

Error: OpenQA.Selenium.WebDriverException HResult=0x80131500 Message=javascript error: Cannot read property 'isAppIdle' of undefined (Session info: chrome=74.0.3729.169) (Driver info: chromedriver=74.0.3729.6 (255758eccf3d244491b8a1317aa76e1ce10d57e9-refs/branch-heads/3729@{#29}),platform=Windows NT 10.0.17134 x86_64) Source=WebDriver StackTrace: at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse) at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary2 parameters) at OpenQA.Selenium.Remote.RemoteWebDriver.ExecuteScriptCommand(String script, String commandName, Object[] args) at OpenQA.Selenium.Remote.RemoteWebDriver.ExecuteScript(String script, Object[] args) at Microsoft.Dynamics365.UIAutomation.Browser.SeleniumExtensions.ExecuteScript(IWebDriver driver, String script, Object[] args) in C:\Users\Administrator\Source\Repos\EasyRepro\Microsoft.Dynamics365.UIAutomation.Browser\Extensions\SeleniumExtensions.cs:line 129 at Microsoft.Dynamics365.UIAutomation.Browser.SeleniumExtensions.<>c__DisplayClass34_0.<WaitForTransaction>b__0(IWebDriver d) in C:\Users\Administrator\Source\Repos\EasyRepro\Microsoft.Dynamics365.UIAutomation.Browser\Extensions\SeleniumExtensions.cs:line 467 at OpenQA.Selenium.Support.UI.DefaultWait1.Until[TResult](Func`2 condition)

ArvindBhat83 commented 5 years ago

I am trying the scenario to create a case. I have specified the crm url, credentials, the UCI app name, sub area. Can you please help? I am really keen to adopt this framework for automation testing

TYLEROL commented 5 years ago

@ArvindBhat83 - Do you receive this error when running a test normally? Due to current implementation you will likely receive this when debugging, but you should be able to F5/Continue with the rest of the test.

If this is specific to debugging, please let me know and I'll see what we can do to adjust this behavior when debugging.

Thanks, Tyler

ArvindBhat83 commented 5 years ago

Hello Tyler,

So nice to see a quick response from you! Firstly, thanks for the speed at which the execution takes place. Feel so much better in comparison to spec flow.

You are right, this comes up during debug and am able to continue but the reason I had to resort to debug is that when chrome launches and it connects to CRM, it enters the specified credentials, then redirects to my organization page where in it expects the credentials to be specified again. The code isn't able to handle that as it expects CRM to be launched by then. I am able to get over this during debug as I can manually key it in to proceed. Hope it makes sense. Am putting another bug for easy tracking.,

Regards, Arvind.

TYLEROL commented 5 years ago

@ArvindBhat83 - This will be resolved via PR https://github.com/microsoft/EasyRepro/pull/591 currently merged into the develop branch.

I've assigned a milestone to the PR that you can track as an ETA for when we'll merge the change into master.

Thanks, Tyler

prdpmv commented 4 years ago

This error is still coming from Microsoft.Dynamics365.UIAutomation.Api.UCI.Webclient OpenApp method in debug mode.

TYLEROL commented 4 years ago

Hi @prdpmv - There is a currently known issue in #683 in a regression of core Dynamics 365 code. This was identified and fixed earlier in the week, and rollout should occur across all public regions this weekend.

I am working to identify approximate build numbers that are required for the fix which will help with validation post-deployment. Please keep an eye on #683 for further updates.

TYLEROL commented 4 years ago

@prdpmv - Please see issue #683 for an update with deployments that occurred this last weekend. If your organization received an update, please let us know if you continue to experience issues with the OpenApp() method.

Thanks, Tyler