Giter VIP home page Giter VIP logo

Comments (18)

Shakevg avatar Shakevg commented on June 8, 2024 1

You should specify Settings file or path to it in task: EasyRepro.runsettings
image

from easyrepro.

8its avatar 8its commented on June 8, 2024 1

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.

from easyrepro.

Shakevg avatar Shakevg commented on June 8, 2024

8its Could you make a screenshot on an error and check it

TakeScreenshot(client, xrmApp.CommandResults.Last());

from easyrepro.

8its avatar 8its commented on June 8, 2024

image

image

image

onlineusername, password and crm url are set in EasyRepro.runsettings file.
what I am missing?

thank you

from easyrepro.

8its avatar 8its commented on June 8, 2024

... and after modifying the code to make it runnable, same error as in the beginning

image

here the results of a local test execution

image

any hint will be welcome
thank you.

from easyrepro.

Shakevg avatar Shakevg commented on June 8, 2024

Please take a screenshot in Azure DevOps of how you pass parameters to run test step

from easyrepro.

8its avatar 8its commented on June 8, 2024

This is how we call the test plan
image

this is the task in YAML format
`steps:

  • task: VSTest@2
    displayName: 'VsTest - testAssemblies TEST'
    inputs:
    testSelector: testPlan
    testPlan: 2799
    testSuite: '2800,2801'
    testConfiguration: 7
    searchFolder: '$(System.DefaultWorkingDirectory)\Microsoft.Dynamics365.UIAutomation.Sample\bin\Debug'
    resultsFolder: '$(Common.TestResultsDirectory)'
    uiTests: true
    vsTestVersion: toolsInstaller
    runInParallel: false
    codeCoverageEnabled: true
    diagnosticsEnabled: true
    continueOnError: true`

The Test plan has been defined as follows
image

from easyrepro.

8its avatar 8its commented on June 8, 2024

I´ve updated the RegressionTests.cs file, to open the Sales Hub app and commented everything after that.
image

EasyRepro.runsettings has been configured in the Pipeline
image

Error after running the pipeline
image

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, Dictionary2 parameters)
at OpenQA.Selenium.WebDriver.InternalExecute(String driverCommandToExecute, Dictionary2 parameters) at OpenQA.Selenium.WebElement.Execute(String commandToExecute, Dictionary2 parameters)
at OpenQA.Selenium.WebElement.Click()
at Microsoft.Dynamics365.UIAutomation.Browser.SeleniumExtensions.<>c.b__2_0(IWebElement e) in D:\a\1\s\Microsoft.Dynamics365.UIAutomation.Browser\Extensions\SeleniumExtensions.cs:line 43
at Microsoft.Dynamics365.UIAutomation.Browser.SeleniumExtensions.WaitUntil(ISearchContext driver, Func2 searchFunc, Nullable1 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, Nullable1 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, Nullable1 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, Nullable1 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.b__1(IWebElement appContainer) in D:\a\1\s\Microsoft.Dynamics365.UIAutomation.Api.UCI\WebClient.cs:line 475
at Microsoft.Dynamics365.UIAutomation.Browser.SeleniumExtensions.WaitUntil(ISearchContext driver, Func2 searchFunc, Nullable1 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, Nullable1 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.DelegateBrowserCommand1.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

`

from easyrepro.

Shakevg avatar Shakevg commented on June 8, 2024

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

from easyrepro.

8its avatar 8its commented on June 8, 2024

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.

from easyrepro.

Shakevg avatar Shakevg commented on June 8, 2024

Post screenshot please

from easyrepro.

8its avatar 8its commented on June 8, 2024

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
image

Execution from Pipeline
image

from easyrepro.

Shakevg avatar Shakevg commented on June 8, 2024

I meant dynamics web app screenshot when error appeared

from easyrepro.

8its avatar 8its commented on June 8, 2024

There is no error at all. The following is a screenshot of the ScreenCapture.wmv file created during the test.

image

In the video I can see the same screen from minute1.15 until the end at min 2.49

from easyrepro.

8its avatar 8its commented on June 8, 2024

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.

Regression_Test.mp4

I hope this could help

from easyrepro.

Shakevg avatar Shakevg commented on June 8, 2024

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?

from easyrepro.

8its avatar 8its commented on June 8, 2024

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

from easyrepro.

8its avatar 8its commented on June 8, 2024

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();
            }
        }

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.