Closed 8its closed 1 year ago
8its Could you make a screenshot on an error and check it https://github.com/microsoft/EasyRepro/blob/3dc3570c5ad72e812381c4b874110ede5d93a507/Microsoft.Dynamics365.UIAutomation.Sample/AzureDevOps/UCI/RegressionTests.cs#L148
onlineusername, password and crm url are set in EasyRepro.runsettings file. what I am missing?
thank you
... and after modifying the code to make it runnable, same error as in the beginning
here the results of a local test execution
any hint will be welcome thank you.
Please take a screenshot in Azure DevOps of how you pass parameters to run test step
This is how we call the test plan
this is the task in YAML format `steps:
The Test plan has been defined as follows
You should specify Settings file or path to it in task: EasyRepro.runsettings
I´ve updated the RegressionTests.cs file, to open the Sales Hub app and commented everything after that.
EasyRepro.runsettings has been configured in the Pipeline
Error after running the pipeline
Standard_Console_Output.log
BrowserAutomation Information: 9000 : BrowserInitialized invoked. BrowserAutomation Information: 9001 : BrowserInitialized completed. BrowserAutomation Information: 10001 : Command Start: Login - Attempt 1/5 BrowserAutomation Information: 10002 : Command Success: Login - 1 attempts - total execution time 9770.4938ms - Return Result: Success BrowserAutomation Information: 10001 : Command Start: Initialize Unified Interface Modes - Attempt 1/5 BrowserAutomation Information: 10002 : Command Success: Initialize Unified Interface Modes - 1 attempts - total execution time 16342.4372ms - Return Result: True BrowserAutomation Information: 10001 : Command Start: Open personalSettings SettingsMenu.About - Attempt 1/5 BrowserAutomation Information: 10002 : Command Success: Open personalSettings SettingsMenu.About - 1 attempts - total execution time 699.7381ms - Return Result: True BrowserAutomation Information: 10001 : Command Start: Dialog Click OK - Attempt 1/5 BrowserAutomation Information: 10002 : Command Success: Dialog Click OK - 1 attempts - total execution time 30161.6847ms - Return Result: True BrowserAutomation Information: 10001 : Command Start: Open App Sales Hub - Attempt 1/5 BrowserAutomation Information: 10004 : Command Retry: Open App Sales Hub - OpenQA.Selenium.ElementClickInterceptedException: element click intercepted: Element <iframe id="AppLandingPage" title="AppLandingPage" src="/%7b638181253350000220%7d/webresources/msdyn_appmanagementcontrol" class="pa-bk pa-cu pa-cm " cd_frame_id_="2c6d3d49d2b56fb748b123519a3223fe"></iframe> is not clickable at point (364, 591). Other element would receive the click: <div id="modalDialogRoot_1_1" tabindex="-1" class="pa-f pa-bk pa-a pa-p pa-au flexbox">...</div> (Session info: chrome=112.0.5615.138) - Retry 2/5 initiated BrowserAutomation Information: 10004 : Command Retry: Open App Sales Hub - OpenQA.Selenium.ElementClickInterceptedException: element click intercepted: Element <iframe id="AppLandingPage" title="AppLandingPage" src="/%7b638181253350000220%7d/webresources/msdyn_appmanagementcontrol" class="pa-bk pa-cu pa-cm " cd_frame_id_="099429835a801af46ddbc37d05218efd"></iframe> is not clickable at point (364, 591). Other element would receive the click: <div id="modalDialogRoot_1_1" tabindex="-1" class="pa-f pa-bk pa-a pa-p pa-au flexbox">...</div> (Session info: chrome=112.0.5615.138) - Retry 3/5 initiated BrowserAutomation Information: 10003 : Command Failure: Open App Sales Hub - 3 attempts - total execution time 13885.1272ms - Return Result: OpenQA.Selenium.ElementClickInterceptedException: element click intercepted: Element <iframe id="AppLandingPage" title="AppLandingPage" src="/%7b638181253350000220%7d/webresources/msdyn_appmanagementcontrol" class="pa-bk pa-cu pa-cm " cd_frame_id_="94c362b2284f45407006e69b57d8d26e"></iframe> is not clickable at point (364, 591). Other element would receive the click: <div id="modalDialogRoot_1_1" tabindex="-1" class="pa-f pa-bk pa-a pa-p pa-au flexbox">...</div> (Session info: chrome=112.0.5615.138) at OpenQA.Selenium.WebDriver.UnpackAndThrowOnError(Response errorResponse, String commandToExecute) at OpenQA.Selenium.WebDriver.Execute(String driverCommandToExecute, Dictionary
2 parameters)
at OpenQA.Selenium.WebDriver.InternalExecute(String driverCommandToExecute, Dictionary2 parameters) at OpenQA.Selenium.WebElement.Execute(String commandToExecute, Dictionary
2 parameters)
at OpenQA.Selenium.WebElement.Click()
at Microsoft.Dynamics365.UIAutomation.Browser.SeleniumExtensions.<>c.2 searchFunc, Nullable
1 timeout, Action1 successCallback, Action failureCallback) in D:\a\1\s\Microsoft.Dynamics365.UIAutomation.Browser\Extensions\SeleniumExtensions.cs:line 578 at Microsoft.Dynamics365.UIAutomation.Browser.SeleniumExtensions.WaitUntilClickable(ISearchContext driver, By by, Nullable
1 timeout, Action1 successCallback, Action failureCallback) in D:\a\1\s\Microsoft.Dynamics365.UIAutomation.Browser\Extensions\SeleniumExtensions.cs:line 528 at Microsoft.Dynamics365.UIAutomation.Browser.SeleniumExtensions.WaitUntilClickable(ISearchContext driver, By by, Nullable
1 timeout, Action1 successCallback, String exceptionMessage) in D:\a\1\s\Microsoft.Dynamics365.UIAutomation.Browser\Extensions\SeleniumExtensions.cs:line 520 at Microsoft.Dynamics365.UIAutomation.Browser.SeleniumExtensions.ClickWhenAvailable(ISearchContext driver, By by, Nullable
1 timeout, String errorMessage) in D:\a\1\s\Microsoft.Dynamics365.UIAutomation.Browser\Extensions\SeleniumExtensions.cs:line 43
at Microsoft.Dynamics365.UIAutomation.Api.UCI.WebClient.<>c__DisplayClass32_0.2 searchFunc, Nullable
1 timeout, Action1 successCallback, Action failureCallback) in D:\a\1\s\Microsoft.Dynamics365.UIAutomation.Browser\Extensions\SeleniumExtensions.cs:line 578 at Microsoft.Dynamics365.UIAutomation.Browser.SeleniumExtensions.WaitUntilVisible(ISearchContext driver, By by, Nullable
1 timeout, Action1 successCallback, Action failureCallback) in D:\a\1\s\Microsoft.Dynamics365.UIAutomation.Browser\Extensions\SeleniumExtensions.cs:line 503 at Microsoft.Dynamics365.UIAutomation.Api.UCI.WebClient.TryToClickInAppTile(String appName, IWebDriver driver) in D:\a\1\s\Microsoft.Dynamics365.UIAutomation.Api.UCI\WebClient.cs:line 474 at Microsoft.Dynamics365.UIAutomation.Api.UCI.WebClient.<>c__DisplayClass29_0.<OpenApp>b__0(IWebDriver driver) in D:\a\1\s\Microsoft.Dynamics365.UIAutomation.Api.UCI\WebClient.cs:line 398 at Microsoft.Dynamics365.UIAutomation.Browser.DelegateBrowserCommand
1.ExecuteCommand(IWebDriver driver, Object[] params) in D:\a\1\s\Microsoft.Dynamics365.UIAutomation.Browser\DelegateBrowserCommand.cs:line 28
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 D:\a\1\s\Microsoft.Dynamics365.UIAutomation.Browser\BrowserCommand.cs:line 103
Creating Page Source file with name EXCEPTION_Source_20230428080731.html
BrowserAutomation Information: 9000 : BrowserDisposing invoked.
BrowserAutomation Information: 9001 : BrowserDisposing completed.
Debug Trace: Creating Page Source file with name EXCEPTION_Source_20230428080731.html
`
Enable video recording and check what is happening, it looks like some extra dialog is opening. https://learn.microsoft.com/en-us/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file?view=vs-2022#videorecorder-data-collector
Nice feature! Now I can see that the test is not able to simulate a click on Sales, Accounts, so the test is stuck in the command xrmApp.Navigation.OpenSubArea("Sales",
"Accounts");` The error message is the same "Unable to click element" as I mentioned at the beginning.
One thing that is so confusing is that when I run the test Regression_EntityControls_GetValue_SetValue locally it works but when running in the pipeline it does not. Is there any particular reason for this behavior?
Thank you for your support.
Post screenshot please
Regression_EntityConttrols_GetValue_SetValue(). Some code is commented to avoid issues.
public void Regression_EntityControls_GetValue_SetValue()
{
var telemetry = new Microsoft.ApplicationInsights.TelemetryClient { InstrumentationKey = _azureKey };
telemetry.Context.Operation.Id = Guid.NewGuid().ToString();
telemetry.Context.Operation.ParentId = _sessionId;
telemetry.Context.GlobalProperties.Add("Test", TestContext.TestName);
var client = new WebClient(TestSettings.Options);
var xrmApp = new XrmApp(client);
try
{
telemetry.TrackTrace("Login Started");
xrmApp.OnlineLogin.Login(_xrmUri, _username, _password, _mfaSecretKey);
telemetry.TrackTrace("Login Completed");
TakeScreenshot(client, xrmApp.CommandResults.Last());
//xrmApp.Navigation.OpenApp(UCIAppName.Sales);
//telemetry.TrackTrace("OpenAbout Started");
//xrmApp.Navigation.OpenAbout();
//telemetry.TrackTrace("OpenAbout Completed");
//TakeScreenshot(client, xrmApp.CommandResults.Last());
//xrmApp.Dialogs.ClickOk();
telemetry.TrackTrace("Open Sales Hub Started");
xrmApp.Navigation.OpenApp(UCIAppName.Sales);
telemetry.TrackTrace("Open Sales Hub Completed");
TakeScreenshot(client, xrmApp.CommandResults.Last());
telemetry.TrackTrace("OpenSubArea Started");
xrmApp.Navigation.OpenSubArea("Sales", "Accounts");
telemetry.TrackTrace("OpenSubArea Completed");
TakeScreenshot(client, xrmApp.CommandResults.Last());
telemetry.TrackTrace("SwitchView Started");
xrmApp.Grid.SwitchView("All Accounts");
telemetry.TrackTrace("SwitchView Completed");
TakeScreenshot(client, xrmApp.CommandResults.Last());
//telemetry.TrackTrace("GetGridControl Started");
//var gridHtml = xrmApp.Grid.GetGridControl();
//WriteSource("GRID_", gridHtml);
//telemetry.TrackTrace("GetGridControl Completed");
telemetry.TrackTrace("Search Started");
xrmApp.Grid.Search("Economic");
telemetry.TrackTrace("Search Completed");
TakeScreenshot(client, xrmApp.CommandResults.Last());
telemetry.TrackTrace("OpenRecord Started");
xrmApp.Grid.OpenRecord(0);
telemetry.TrackTrace("OpenRecord Completed");
TakeScreenshot(client, xrmApp.CommandResults.Last());
#region Boolean
telemetry.TrackTrace("GetValue-Text Started");
xrmApp.Entity.GetValue("telephone1");
telemetry.TrackTrace("GetValue-Text Completed");
telemetry.TrackTrace("SetValue-Text Started");
xrmApp.Entity.SetValue("telephone1","867-5309");
telemetry.TrackTrace("SetValue-Text Completed");
#endregion
TakeScreenshot(client, xrmApp.CommandResults.Last());
//#region Lookup
//telemetry.TrackTrace("SetValue-LookupItem Started");
//xrmApp.Entity.SetValue(new LookupItem { Name = "customerid", Value = "maria campbell", Index = 0 });
//telemetry.TrackTrace("SetValue-LookupItem Completed");
//#endregion
telemetry.TrackEvent(String.Format("{0} is successful.", TestContext.TestName));
}
catch (System.Exception ex)
{
telemetry.TrackException(ex);
WriteSource("EXCEPTION_Source_", client.Browser.Driver.PageSource);
TakeScreenshot(client, xrmApp.CommandResults.Last());
throw ex;
}
finally
{
xrmApp.Dispose();
telemetry.Flush();
}
}
Execution from Visual Studio locally
Execution from Pipeline
I meant dynamics web app screenshot when error appeared
There is no error at all. The following is a screenshot of the ScreenCapture.wmv file created during the test.
In the video I can see the same screen from minute1.15 until the end at min 2.49
This is the video screen capture. At the end, after closing the blue bubble at top right, the test doesn´t do anything else, and it should open the Accounts list.
I hope this could help
Could please post screen for full stacktrace Looks like issue with blue drop that block any click on app, you should close it before. Do you use the same account for local and Azure test run? Do you see this drop on local run?
Could please post screen for full stacktrace Looks like issue with blue drop that block any click on app, you should close it before. Do you use the same account for local and Azure test run? Do you see this drop on local run?
Sorry Shakevg, I don´t know where to get the full stacktrace. I use the same account for local and pipeline runs. In local run the blue bubble does not appear.
Thank you
Hello.
Here is the Error and Stack Trace pointing at line 335:
Error message Test method Microsoft.Dynamics365.UIAutomation.Sample.UCI.RegressionTests.Regression_EntityControls_GetValue_SetValue threw exception: System.InvalidOperationException: Unable to click element. Stack trace at Microsoft.Dynamics365.UIAutomation.Sample.UCI.RegressionTests.Regression_EntityControls_GetValue_SetValue() in \Microsoft.Dynamics365.UIAutomation.Sample\AzureDevOps\UCI\RegressionTests.cs:line 335
Here is the function that I am testing. Line 335 is the throw ex
in the catch
at the end
public void Regression_EntityControls_GetValue_SetValue()
{
var telemetry = new Microsoft.ApplicationInsights.TelemetryClient { InstrumentationKey = _azureKey };
telemetry.Context.Operation.Id = Guid.NewGuid().ToString();
telemetry.Context.Operation.ParentId = _sessionId;
telemetry.Context.GlobalProperties.Add("Test", TestContext.TestName);
var client = new WebClient(TestSettings.Options);
var xrmApp = new XrmApp(client);
try
{
telemetry.TrackTrace("Login Started");
xrmApp.OnlineLogin.Login(_xrmUri, _username, _password, _mfaSecretKey);
telemetry.TrackTrace("Login Completed");
TakeScreenshot(client, xrmApp.CommandResults.Last());
//xrmApp.Navigation.OpenApp(UCIAppName.Sales);
// ***
//telemetry.TrackTrace("OpenAbout Started");
//xrmApp.Navigation.OpenAbout();
//telemetry.TrackTrace("OpenAbout Completed");
//TakeScreenshot(client, xrmApp.CommandResults.Last());
//xrmApp.Dialogs.ClickOk();
//telemetry.TrackTrace("Open Sales Hub Started");
//xrmApp.Navigation.OpenApp(UCIAppName.Sales);
//telemetry.TrackTrace("Open Sales Hub Completed");
//TakeScreenshot(client, xrmApp.CommandResults.Last());
telemetry.TrackTrace("OpenSubArea Started");
xrmApp.Navigation.OpenSubArea("Sales", "Accounts");
telemetry.TrackTrace("OpenSubArea Completed");
TakeScreenshot(client, xrmApp.CommandResults.Last());
//telemetry.TrackTrace("SwitchView Started");
//xrmApp.Grid.SwitchView("All Accounts");
//telemetry.TrackTrace("SwitchView Completed");
//TakeScreenshot(client, xrmApp.CommandResults.Last());
// ***
//telemetry.TrackTrace("GetGridControl Started");
//var gridHtml = xrmApp.Grid.GetGridControl();
//WriteSource("GRID_", gridHtml);
//telemetry.TrackTrace("GetGridControl Completed");
//telemetry.TrackTrace("Search Started");
//xrmApp.Grid.Search("Economic");
//telemetry.TrackTrace("Search Completed");
//TakeScreenshot(client, xrmApp.CommandResults.Last());
//telemetry.TrackTrace("OpenRecord Started");
//xrmApp.Grid.OpenRecord(0);
//telemetry.TrackTrace("OpenRecord Completed");
//TakeScreenshot(client, xrmApp.CommandResults.Last());
//#region Boolean
//telemetry.TrackTrace("GetValue-Text Started");
//xrmApp.Entity.GetValue("telephone1");
//telemetry.TrackTrace("GetValue-Text Completed");
//telemetry.TrackTrace("SetValue-Text Started");
//xrmApp.Entity.SetValue("telephone1","867-5309");
//telemetry.TrackTrace("SetValue-Text Completed");
//#endregion
//TakeScreenshot(client, xrmApp.CommandResults.Last());
// ***
//#region Lookup
//telemetry.TrackTrace("SetValue-LookupItem Started");
//xrmApp.Entity.SetValue(new LookupItem { Name = "customerid", Value = "maria campbell", Index = 0 });
//telemetry.TrackTrace("SetValue-LookupItem Completed");
//#endregion
telemetry.TrackEvent(String.Format("{0} is successful.", TestContext.TestName));
}
catch (System.Exception ex)
{
telemetry.TrackException(ex);
WriteSource("EXCEPTION_Source_", client.Browser.Driver.PageSource);
TakeScreenshot(client, xrmApp.CommandResults.Last());
throw ex; // line 335
}
finally
{
xrmApp.Dispose();
telemetry.Flush();
}
}
Oh my gosh! You won't believe it.
I've found this question, and now my pipeline is working after adding a task to resize the screen.
Thank you for your help, after all I've learned several things.
EasyRepro Version
UCI or Classic Web
Online or On Premise
Browser
Describe the bug
I´ve run the UCITestOpenActiveAccount test successfully in my local VS. I´ve associated this test to a Test Case in a DevOps project. Then I have a pipeline that runs the Test Case using Visual Studio Test. I get the following error:
I´m trying to run the following code:
All packages have been updated to the latest stable version.
Expected behavior
Finish the test successfully