Git Product home page Git Product logo

easyrepro's Introduction

Overview

The purpose of this library is to provide Dynamics customers the ability to facilitate automated UI testing for their projects. These API's provide an easy to use set of commands that make setting up UI testing quick and easy. The functionality provided covers the core CRM commands that end users would perform on a typical workday and working to extend that coverage to more functionality.

Software Requirements

Supported Version

Supported Operating System

Windows 11, Windows 10 , Windows 7, Windows 8, Windows 8.1, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2

Supported Visual studio

Microsoft Visual Studio 2015, Microsoft Visual Studio 2017, Microsoft Visual Studio 2019, Microsoft Visual Studio 2022

CRM Versions

Easy Repro supports below CRM Versions

  • Microsoft Dynamics 365 Online Version 9.1 (9.1.x) (DB 9.1.x) online
  • Microsoft Dynamics 365 Online Version 9.2 (9.2.x) (DB 9.2.x) online

Selenium Webdriver & Support

Selenium is a set of different software tools each with a different approach to supporting browser automation. These tools are highly flexible, allowing many options for locating and manipulating elements within a browser, and one of its key features is the support for automating multiple browser platforms. This package contains the .NET bindings for the newer, more concise and object-based Selenium WebDriver API, which uses native OS-level events to manipulate the browser, bypassing the JavaScript sandbox, and does not require the Selenium Server to automate the browser.

File Name Version Release date
Selenium.WebDriver v3.11.2 April 12, 2018
Selenium.Support v3.11.2 April 12, 2018

Coverage

CRM Functionality Covered

  • Activity Record Wall
  • Business Process Flow
  • Charts
  • Commandbar
  • Dashboards
  • Entities (Create, Update, Delete, Duplicate Detection, Assign)
  • Global Search
  • Guided Help
  • Grids
  • Sub-Grids
  • Navigation
  • Notifications
  • Performance Center
  • Quick Create
  • Run Workflows
  • Run Reports

CRM Functionality Not Covered

  • Settings Area (Administration)
  • Customization
  • Advanced Find Query execution(Open Advanced Find is available)
  • Export to Excel
  • Templates
  • Other Add on Applications

Although we don't have specific commands to cover the above funcationality, we have generic commands that will allow you to still interact with those features.

Known Issues

  • Firefox has sometimes been inconsistent with testing results. The click command is inconsistent. This is a known issue and has been reported to that team that manages that driver.
  • IE Driver has a 32-bit version and a 64-bit version. If you're using the 32-bit version on 64-bit windows with 64-bit IE then the driver will not work as intended. Use the appropriate version of IE Driver with the specific version of IE.

Setup

Install Instructions:

The Sample project should have NUGET packages added and you just need to build the solution and restore the packages. For the specific browser drivers, you can add them using NUGET. The default driver is Chrome and the NUGET package is already installed on the Sample project.

Run the Sample Project

Change the keys in your app.config below to match your environment. Open the Test explorer window. Right click and run one test to ensure everything works. Trying the CreateAccount test under Microsoft.Dynamics365.UIAutomation.Sample.Web is a good start.

<add key="OnlineUsername" value="[email protected]" />
<add key="OnlinePassword" value="*********" />
<add key="OnlineCrmUrl" value="https://org.crm.dynamics.com/" />

MFA Support

If the account you are using has MFA (Multi-Factor Authentication) enabled, you will also need to provide an MFA Secret Key. You can obtain an MFA secret key for your account using these instructions - you will need Microsoft's Authenticator App to get this working:

  1. Go to your Office365 'Security info' page at: https://mysignins.microsoft.com/security-info
  2. Enter your O365 login and password
  3. Click 'Add method' and select "Authenticator app" in Combobox, click Add
  4. Click on "I want to use a different authenticator app" link
  5. Click on the 'Next' button, click on the 'Next' button
  6. Click on 'Can't scan image?'
  7. Make a note of the 'Secret key' which is displayed
  8. Open Authenticator app and click the '+' to add an account and select 'work or school account'
  9. Scan the QR code displayed on the web page
  10. When the App displays a six-digit code, click 'Next' on the web page
  11. Enter the six-digit verification code from the app into the web page and Click the 'Next' button
  12. Add your MFA Secret key from step 7 with the spaces removed to your app.config as shown below, in the same section that you add your username and password
<add key="MfaSecretKey" value="MfaSecretKeyWithSpacesRemoved" />

Supported Browser WebDriver

The application supports following browser:

Browser WebDriver Version Release date
Chrome ChromeDriver SeleniumWebDriver.ChromeDriver Found in NuGet Package
Firefox GeckoDriver v.0.16.1 April 27, 2017
IE IEDriver v.3.4 April 22, 2017
Edge MicrosoftWebDriver v.10.0.15063.0 April 18, 2017

Browser Driver Download and install instructions

If you want to download the drivers manually you can go to the specific driver download links and put them in the bin folder of your project.

Chrome:

Download the Chrome Web driver from the below link Download chrome driver

Internet Explorer:

Download the IE Web driver from the below link Download IE driver

FireFox:

The Firefox web driver can be installed through Nuget package manager.

  • In Visual studio ,Go to Tools -> NuGet Package Manager -> Manage Nuget Packages for the solution FileName : Selenium.WebDriver.GeckoDriver.Win64

Edge:

Click on the below link to download Edge driver Download Edge driver

easyrepro's People

Contributors

aliyoussefi avatar amarsinghmsft avatar angelrodriguez8008 avatar bwmodular avatar chrisfairfax avatar dependabot[bot] avatar dtu11 avatar dylanhaskins avatar ewingjm avatar ggeiszle avatar imartinflores avatar jfinnecy avatar jlattimer avatar jowells1 avatar markcunninghamuk avatar martynnevers avatar microsoft-github-policy-service[bot] avatar microsoftopensource avatar msftgits avatar mvermaat avatar s-bauer avatar sanjint avatar shakevg avatar shariquekhan1997 avatar thathi avatar tpalus avatar tylerol avatar ugreg avatar uthra22 avatar zwuai avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

easyrepro's Issues

Search_Results pointing to wrong xpath value

In the file XrmElementReference.cs, the value for Search_Result is pointing to entityDiv_1, however when I have been testing in Dynamics 365 I dont see an element of entityDiv_1 so trying to select a search result would fail from the framework. When I changed the value to contentResult it was then able to find values.

        { "Search_Result"       , "id(\"entityDiv_1\")"},

should be changed to

       { "Search_Result"       , "id(\"contentResult\")"},

XrmBrowser.LoginPage.Login does not handle "Stay signed in?" menu

Sometimes when signing in to crm.dynamics.com, after entering the username and password, the page will ask if you want to stay signed in, offering a yes or no button. I am using the XrmBrowser.LoginPage.Login(Uri url, SecureString username, SecureString password) overload.

Is there a way for me to handle this with what's already included in the project?

Error with ADFSLoginAction function

I am getting the a stale element reference when I try to use the ADFSLoginAction with the code that is currently present (it is commented out in the code). Everything seems to work (the initial login page loads, code enters the username, waits for page to reload to redirected login page, enters the password and then clicks submit) but it gets a stale element reference error

public void ADFSLoginAction(LoginRedirectEventArgs args)
{
var d = args.Driver;
d.FindElement(By.Id("passwordInput")).SendKeys(args.Password.ToUnsecureString());
d.ClickWhenAvailable(By.Id("submitButton"), new TimeSpan(0, 0, 2));
d.WaitForPageToLoad();
}

I tried changing how I submit with a different line of code but it also failed with the same error
d.FindElement(By.Id("passwordInput")).SendKeys(Keys.Enter);

it ended up working if I put in the submit()

d.FindElement(By.Id("passwordInput")).Submit();

Test Name: TestOpenActiveContact
Test FullName: Microsoft.Dynamics365.UIAutomation.Sample.OpenContact.TestOpenActiveContact
Test Source: C:\Code\EasyRepro-master\EasyRepro-master\Microsoft.Dynamics365.UIAutomation.Sample\OpenContact.cs : line 21
Test Outcome: Failed
Test Duration: 0:00:55.4222568

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_ElementValueChanged(Object sender, WebElementEventArgs e) in C:\Code\EasyRepro-master\EasyRepro-master\Microsoft.Dynamics365.UIAutomation.Browser\InteractiveBrowser.cs:line 490 at OpenQA.Selenium.Support.Events.EventFiringWebDriver.OnElementValueChanged(WebElementEventArgs e) at OpenQA.Selenium.Support.Events.EventFiringWebDriver.EventFiringWebElement.SendKeys(String text) at Microsoft.Dynamics365.UIAutomation.Sample.OpenContact.ADFSLoginAction(LoginRedirectEventArgs args) in C:\Code\EasyRepro-master\EasyRepro-master\Microsoft.Dynamics365.UIAutomation.Sample\OpenContact.cs:line 58 at Microsoft.Dynamics365.UIAutomation.Api.LoginPage.Login(IWebDriver driver, Uri uri, SecureString username, SecureString password, Action1 redirectAction) in C:\Code\EasyRepro-master\EasyRepro-master\Microsoft.Dynamics365.UIAutomation.Api\Pages\LoginPage.cs:line 126
at Microsoft.Dynamics365.UIAutomation.Browser.DelegateBrowserCommand5.ExecuteCommand(IWebDriver driver, Object[] params) in C:\Code\EasyRepro-master\EasyRepro-master\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:\Code\EasyRepro-master\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:\Code\EasyRepro-master\EasyRepro-master\Microsoft.Dynamics365.UIAutomation.Browser\BrowserCommand.cs:line 60 at Microsoft.Dynamics365.UIAutomation.Browser.BrowserPage.Execute[TResult,T1,T2,T3,T4](String commandName, Func6 delegate, T1 p1, T2 p2, T3 p3, T4 p4) in C:\Code\EasyRepro-master\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:\Code\EasyRepro-master\EasyRepro-master\Microsoft.Dynamics365.UIAutomation.Api\Pages\LoginPage.cs:line 84
at Microsoft.Dynamics365.UIAutomation.Sample.OpenContact.TestOpenActiveContact() in C:\Code\EasyRepro-master\EasyRepro-master\Microsoft.Dynamics365.UIAutomation.Sample\OpenContact.cs:line 25
Result Message:
Test method Microsoft.Dynamics365.UIAutomation.Sample.OpenContact.TestOpenActiveContact threw exception:
OpenQA.Selenium.StaleElementReferenceException: stale element reference: element is not attached to the page document
(Session info: chrome=61.0.3163.100)
(Driver info: chromedriver=2.31.488763 (092de99f48a300323ecf8c2a4e2e7cab51de5ba8),platform=Windows NT 10.0.15063 x86_64)

Does this work for On-Premise CRM version?

As per documentation:
Easy Repro supports below CRM Versions
-- Microsoft Dynamicsยฎ CRM Online 2016 Update (8.1.1.1003) (DB 8.1.1.1003)
-- Microsoft Dynamics 365 Version 1612 (8.2.1.185) (DB 8.2.1.185) online
+- Microsoft Dynamicsยฎ CRM Online 2016 8.1 (8.1.1.x) (DB 8.1.1.x)
+- 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

Can't we use this for Dynamics 365 on-premises version?

Login detection issue when Pending Emails exist

When the logged in user has any pending emails older than 24 hours, then CRM displays a popup notifying it. EasyRepro now tries to detect a successful login by looking for the ribbon, but when the pending emails pop-up is visible, the ribbon is not accessible.

Maybe the pending emails pop-up can also be one of the triggers to identify a successful login?

Also is it possible to provide a commend to dismiss that pop-up?

Test fails when using phantomjs

Everything runs as expected with the chrome driver, but with the phantomjs driver, I get and exception when calling the following:
xrmBrowser.LoginPage.Login(_xrmUri, _username, _password);

Here's the exception:
Test Name: TestsCrmAsyncRequestResponseSample
Test FullName: UIAutomationTests.CrmAsyncRequestResponseSampleTests.TestsCrmAsyncRequestResponseSample
Test Source: C:\github\devkeydet\CrmAsyncRequestResponseSampleV2\UIAutomationTests\CrmAsyncRequestResponseSampleTests.cs : line 27
Test Outcome: Failed
Test Duration: 0:01:12.2264863

Result StackTrace:
at Microsoft.Dynamics365.UIAutomation.Api.LoginPage.<>c.b__12_2(IWebDriver f)
at Microsoft.Dynamics365.UIAutomation.Browser.SeleniumExtensions.WaitUntilVisible(IWebDriver driver, By by, TimeSpan timeout, Action1 successCallback, Action1 failureCallback)
at Microsoft.Dynamics365.UIAutomation.Api.LoginPage.Login(IWebDriver driver, Uri uri, SecureString username, SecureString password, Action1 redirectAction) at Microsoft.Dynamics365.UIAutomation.Browser.DelegateBrowserCommand5.ExecuteCommand(IWebDriver driver, Object[] params)
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) at Microsoft.Dynamics365.UIAutomation.Browser.BrowserCommand1.Execute[T1,T2,T3,T4](IWebDriver driver, T1 p1, T2 p2, T3 p3, T4 p4)
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)
at Microsoft.Dynamics365.UIAutomation.Api.LoginPage.Login(Uri uri, SecureString username, SecureString password)
at UIAutomationTests.CrmAsyncRequestResponseSampleTests.TestsCrmAsyncRequestResponseSample() in C:\github\devkeydet\CrmAsyncRequestResponseSampleV2\UIAutomationTests\CrmAsyncRequestResponseSampleTests.cs:line 27
Result Message:
Test method UIAutomationTests.CrmAsyncRequestResponseSampleTests.TestsCrmAsyncRequestResponseSample threw exception:
System.Exception: Login page failed.

Enhancement: Enable API access to JavaScript XRM Object

Hi,

I've just found your tool and it will most likely solve a lot of my issues.
Please ignore this if this feature already exist. It would be great if if was possible to be able to access the XRM JavaScript object in the content frame and get the return values.
Some features that this would enable

  • Get ID from newly created records
  • Verify settings on fields like (in)visible, required level

Thanks

XrmBrowser.LoginPage.Login does not handle "Stay signed in?" Reference: menu #48

Same issue occurs as reported in referenced issue: #48

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, Action1 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.DelegateBrowserCommand5.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.BrowserCommand1.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

SwitchView for Activities i.e Task is not Working

I tried to navigate to Task Views from Activities grid view. But not able to do so, I get error as view with "Task" doesn't exists and View with "My Tasks" doesn't exists. Please find my code below:-
xrmBrowser.Navigation.OpenSubArea("Sales", "Activities");
xrmBrowser.ThinkTime(2000);
xrmBrowser.Grid.SwitchView("Task");
xrmBrowser.Grid.SwitchView("My Tasks");

KeyNotFoundException in XrmBrowser.Grid.Search

XrmBrowser.Grid.Search types a string in the search text box but it returns the following error.

An exception of type 'System.Collections.Generic.KeyNotFoundException' occurred in Microsoft.Dynamics365.UIAutomation.Browser.dll but was not handled in user code

Additional information: The given key was not present in the dictionary.

Stack trace

at System.Collections.Generic.Dictionary2.get_Item(TKey key) at Microsoft.Dynamics365.UIAutomation.Api.XrmGridPage.<>c__DisplayClass11_0.<Search>b__0(IWebDriver driver) in C:\Repository\Git\EasyRepro\Microsoft.Dynamics365.UIAutomation.Api\Pages\XrmGridPage.cs:line 293 at Microsoft.Dynamics365.UIAutomation.Browser.DelegateBrowserCommand1.ExecuteCommand(IWebDriver driver, Object[] params) in C:\Repository\Git\EasyRepro\Microsoft.Dynamics365.UIAutomation.Browser\DelegateBrowserCommand.cs:line 28
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:\Repository\Git\EasyRepro\Microsoft.Dynamics365.UIAutomation.Browser\BrowserCommand.cs:line 136 at Microsoft.Dynamics365.UIAutomation.Browser.BrowserCommand1.Execute(IWebDriver driver) in C:\Repository\Git\EasyRepro\Microsoft.Dynamics365.UIAutomation.Browser\BrowserCommand.cs:line 36
at Microsoft.Dynamics365.UIAutomation.Browser.BrowserPage.Execute[TResult](BrowserCommandOptions options, Func`2 delegate) in C:\Repository\Git\EasyRepro\Microsoft.Dynamics365.UIAutomation.Browser\BrowserPage.cs:line 180
at Microsoft.Dynamics365.UIAutomation.Api.XrmGridPage.Search(String searchCriteria, Int32 thinkTime) in C:\Repository\Git\EasyRepro\Microsoft.Dynamics365.UIAutomation.Api\Pages\XrmGridPage.cs:line 290
at Microsoft.Dynamics365.UIAutomation.Sample.CreateAccountTests.TestCreateNewAccount() in C:\Repository\Git\EasyRepro\Microsoft.Dynamics365.UIAutomation.Sample\CreateAccount.cs:line 45

Pending email warning dialog box

This is my first time using this tool. What API can I use to close the Pending email warning dialog box that is automatically shown after login? Thanks in advance for your help.

Enhacement: API access Business Process Error pop-up

Hi,

Great tool. I'm new to it and I cannot find a way to handle error text. Neither notifications on field level or Business process errors. It whould be great to be able to run negative test cases.

My specific test case is to verify it is not possible to save when form when some attributes don't comply with a business rule.

Thanks

Navigate to an App?

Is there a way to navigate to a specific app that was built with the new app model?

Grid.Search is not able to click the searchCriteria search icon

I am getting the following error when trying to perform a search in a grid. the value is being passed in but the framework is unable to click the search icon. this is the code block I have in OpenAccount.cs

            xrmBrowser.LoginPage.Login(_xrmUri, _username);
            xrmBrowser.Navigation.OpenSubArea("Sales", "Accounts");
            xrmBrowser.Grid.Search("Test");

Test Name: TestOpenActiveAccount
Test FullName: Microsoft.Dynamics365.UIAutomation.Sample.OpenAccount.TestOpenActiveAccount
Test Source: K:\Master Automation\EasyRepro-master\Microsoft.Dynamics365.UIAutomation.Sample\OpenAccount.cs : line 19
Test Outcome: Failed
Test Duration: 0:01:35.9989661

Result StackTrace:
at Microsoft.Dynamics365.UIAutomation.Browser.SeleniumExtensions.<>c.b__2_1(IWebDriver e) in K:\Master Automation\EasyRepro-master\Microsoft.Dynamics365.UIAutomation.Browser\Extensions\SeleniumExtensions.cs:line 48
at Microsoft.Dynamics365.UIAutomation.Browser.SeleniumExtensions.WaitUntilClickable(IWebDriver driver, By by, TimeSpan timeout, Action1 successCallback, Action1 failureCallback) in K:\Master Automation\EasyRepro-master\Microsoft.Dynamics365.UIAutomation.Browser\Extensions\SeleniumExtensions.cs:line 542
at Microsoft.Dynamics365.UIAutomation.Browser.SeleniumExtensions.ClickWhenAvailable(IWebDriver driver, By by, TimeSpan timeout) in K:\Master Automation\EasyRepro-master\Microsoft.Dynamics365.UIAutomation.Browser\Extensions\SeleniumExtensions.cs:line 44
at Microsoft.Dynamics365.UIAutomation.Browser.SeleniumExtensions.ClickWhenAvailable(IWebDriver driver, By by) in K:\Master Automation\EasyRepro-master\Microsoft.Dynamics365.UIAutomation.Browser\Extensions\SeleniumExtensions.cs:line 37
at Microsoft.Dynamics365.UIAutomation.Api.XrmGridPage.<>c__DisplayClass11_0.b__0(IWebDriver driver) in K:\Master Automation\EasyRepro-master\Microsoft.Dynamics365.UIAutomation.Api\Pages\XrmGridPage.cs:line 293
at Microsoft.Dynamics365.UIAutomation.Browser.DelegateBrowserCommand1.ExecuteCommand(IWebDriver driver, Object[] params) in K:\Master Automation\EasyRepro-master\Microsoft.Dynamics365.UIAutomation.Browser\DelegateBrowserCommand.cs:line 28 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 K:\Master Automation\EasyRepro-master\Microsoft.Dynamics365.UIAutomation.Browser\BrowserCommand.cs:line 136
at Microsoft.Dynamics365.UIAutomation.Browser.BrowserCommand1.Execute(IWebDriver driver) in K:\Master Automation\EasyRepro-master\Microsoft.Dynamics365.UIAutomation.Browser\BrowserCommand.cs:line 36 at Microsoft.Dynamics365.UIAutomation.Browser.BrowserPage.Execute[TResult](BrowserCommandOptions options, Func2 delegate) in K:\Master Automation\EasyRepro-master\Microsoft.Dynamics365.UIAutomation.Browser\BrowserPage.cs:line 182
at Microsoft.Dynamics365.UIAutomation.Api.XrmGridPage.Search(String searchCriteria, Int32 thinkTime) in K:\Master Automation\EasyRepro-master\Microsoft.Dynamics365.UIAutomation.Api\Pages\XrmGridPage.cs:line 290
at Microsoft.Dynamics365.UIAutomation.Sample.OpenAccount.TestOpenActiveAccount() in K:\Master Automation\EasyRepro-master\Microsoft.Dynamics365.UIAutomation.Sample\OpenAccount.cs:line 28
Result Message:
Test method Microsoft.Dynamics365.UIAutomation.Sample.OpenAccount.TestOpenActiveAccount threw exception:
System.InvalidOperationException: Unable to click element.

I performed the test using both the IE and Chrome Drivers with the same result

Remote webdriver?

So PhantomJS support has been removed. How do I get Webdriver Remote to work in EasyRepro? I have tried setting the browser type to Remote, and I get the predictable "browser type not recognized" error.

Exception with data type "Two Options" and no default value

There is an exception when I try to set the value of an element with data type "Two Options" and no default value and when option was never set. Because of the unset state of the element the GetAttribute("checked") returns null. The parsing of null to a Boolean value throws an exception.

Test Method/ Function for a MultiSelectPicklistControl

Hi,

Is there a function/Method to test a MultiSelectPicklistControl field? I haven't found one in the framework (or maybe I've just overlooked it).
This is how I've gotten around to test it but it would be better if it could be done in one line

            xrmBrowser.Entity.SelectSubgridLookup("MultiSelectPicklistControlFieldid", true);
            xrmBrowser.Document.getElementById("MultiSelectPicklistControlFieldid").SendKeys("Value");
            xrmBrowser.Entity.SelectLookup("MultiSelectPicklistControlFieldid_selectAll", 0);

How to Change Form/View on Entity

I apologize if there is a better place to ask questions like this, if there is, please let me know.

Is there already functionality in EasyRepro for checking and/or changing the form/view for an Entity? I'm having a problem where some entities default to a form/view that is different than the one I'm wanting to test, and I am not sure how to go about changing that. I'm familiar with using Grid.SwitchView(), but I can't find an equivalent method for Entities.

Note: I am not referring to the Form dropdown directly to the right of the Entity name. I am referring to the dropdown directly above the entity name.

xrmBrowser.Navigation.OpenSubArea("Sales", "Opportunities")

This works some times and most of the time it gives error

: System.NullReferenceException: 'Object reference not set to an instance of an object.'

No Inner Exception: : Null

Stack Trace:

at Microsoft.Dynamics365.UIAutomation.Api.XrmNavigationPage.<>c__DisplayClass3_0.b__0(IWebDriver driver)
at Microsoft.Dynamics365.UIAutomation.Browser.DelegateBrowserCommand1.ExecuteCommand(IWebDriver driver, Object[] params) 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)
at Microsoft.Dynamics365.UIAutomation.Browser.BrowserCommand1.Execute(IWebDriver driver) at Microsoft.Dynamics365.UIAutomation.Browser.BrowserPage.Execute[TResult](BrowserCommandOptions options, Func2 delegate)
at Microsoft.Dynamics365.UIAutomation.Api.XrmNavigationPage.OpenSubArea(String area, String subArea, Int32 thinkTime)

Exception with Lookup Functions when more than one record has the same value

I noticed that if a lookup result has results with the same value, the function will fail with the error 'An item with the same key has already been added.' I have a Lookup into the contact list where there are 2 Andrew Smith's and this causes a failure.
I've tried with the following and all failed

                xrmBrowser.Entity.SelectLookup("customerid", "Tester"); //attempt 1
                xrmBrowser.Entity.SetValue(new Lookup { Name = "customerid", Value = "Tester" }); //attempt 2
                xrmBrowser.Entity.SelectLookup("customerid", 0); //attempt 3

I feel that the lookup functions implementation should allow you to enter in a value and then click the search icon rather than the current implementations where the Lookup field search icon is clicked after finding the lookup element and then checks the lookup results.

I've also tried entering the value into the field and then trying the selectloopup function but with no success

                xrmBrowser.Entity.SetValue("customerid", "TEST");
                xrmBrowser.Entity.SelectLookup("customerid", 0);

System.ArgumentException occurred
HResult=0x80070057
Message=An item with the same key has already been added.
Source=mscorlib
StackTrace:
at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
at System.Collections.Generic.Dictionary2.Insert(TKey key, TValue value, Boolean add) at System.Collections.Generic.Dictionary2.Add(TKey key, TValue value)
at Microsoft.Dynamics365.UIAutomation.Api.XrmEntityPage.OpenDialog(IWebElement dialog) in C:\AutomationTesting\EasyRepro-master\dynamicscrm\Microsoft.Dynamics365.UIAutomation.Api\Pages\XrmEntityPage.cs:line 358
at Microsoft.Dynamics365.UIAutomation.Api.XrmEntityPage.<>c__DisplayClass12_0.b__0(IWebDriver driver) in C:\AutomationTesting\EasyRepro-master\dynamicscrm\Microsoft.Dynamics365.UIAutomation.Api\Pages\XrmEntityPage.cs:line 290
at Microsoft.Dynamics365.UIAutomation.Browser.DelegateBrowserCommand1.ExecuteCommand(IWebDriver driver, Object[] params) in C:\AutomationTesting\EasyRepro-master\dynamicscrm\Microsoft.Dynamics365.UIAutomation.Browser\DelegateBrowserCommand.cs:line 28 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:\AutomationTesting\EasyRepro-master\dynamicscrm\Microsoft.Dynamics365.UIAutomation.Browser\BrowserCommand.cs:line 192
at Microsoft.Dynamics365.UIAutomation.Browser.BrowserCommand1.Execute(IWebDriver driver) in C:\AutomationTesting\EasyRepro-master\dynamicscrm\Microsoft.Dynamics365.UIAutomation.Browser\BrowserCommand.cs:line 36 at Microsoft.Dynamics365.UIAutomation.Browser.BrowserPage.Execute[TResult](BrowserCommandOptions options, Func2 delegate) in C:\AutomationTesting\EasyRepro-master\dynamicscrm\Microsoft.Dynamics365.UIAutomation.Browser\BrowserPage.cs:line 182
at Microsoft.Dynamics365.UIAutomation.Api.XrmEntityPage.SelectLookup(String field, String value) in C:\AutomationTesting\EasyRepro-master\dynamicscrm\Microsoft.Dynamics365.UIAutomation.Api\Pages\XrmEntityPage.cs:line 275
at Microsoft.Dynamics365.UIAutomation.Sample.CreateProgramEnrolmentValidation.TestCreateProgramEnrolmentValidation() in C:\AutomationTesting\EasyRepro-master\dynamicscrm\Microsoft.Dynamics365.UIAutomation.Sample\CreateProgramEnrolmentValidation.cs:line 35

problem to setup

hey , i dont know exactly javascript. so i have some problems to startup the solution and make some tests. do you have a brief tutorial? it is not clear for me what to do.
it comes the message "main not defined'

Change value of lookup field enters linked old entity

When try to change the value of a lookup the field is clicked a second time to check if the focus is already on field. If the field already has a focus this leads in entering the linked entity and therfore leaving the current page.

Problem when sitemap spans more than 1 page

When there are too many items on the sitemap to fit into 1 page, items that are on the second or later pages cannot be clicked. Will EasyRepro be able to bundle the logic to detect if a button exists, but is not visible, scroll to the next page and so on until it can either click or fail?

We're currently using custom code to do this manually.

Sample test, CreaateAccount.cs, failing to login unable to find element by XPATH

Using an unmodified CreateAccount.cs pointing app.config at our azure CRM instance, the test fails to find the password field in the redirected login page. I have looked at XrmElementReference.cs and see that the XPATH is looking for i0118 but when I examine the redirected login page password box it shows *[@id="passwordInput"] as the XPATH attempts to use passwordInput fail with unable to find element passwordInput.
LoginPage.cs
shows
...
if (redirectToNewPassword)
{
driver.FindElement(By.XPath(Elements.Xpath[Reference.Login.Password])).SendKeys(password.ToUnsecureString());
driver.FindElement(By.XPath(Elements.Xpath[Reference.Login.Password])).SendKeys(Keys.Tab);
driver.FindElement(By.XPath(Elements.Xpath[Reference.Login.Password])).Submit();
}
That the code uses XPATH to find the password field.
Any help would be appreciated.

Test Name: TestCreateNewAccount
Test FullName: Microsoft.Dynamics365.UIAutomation.Sample.CreateAccountTests.TestCreateNewAccount
Test Source: C:\Users\kcarn\Documents\Test Studio Projects\EasyRepro-master\Microsoft.Dynamics365.UIAutomation.Sample\CreateAccount.cs : line 19
Test Outcome: Failed
Test Duration: 0:00:09.919094

Result StackTrace:
at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary2 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 OpenQA.Selenium.Support.Events.EventFiringWebDriver.FindElement(By by) at Microsoft.Dynamics365.UIAutomation.Api.LoginPage.Login(IWebDriver driver, Uri uri, SecureString username, SecureString password, Action1 redirectAction) in C:\Users\kcarn\Documents\Test Studio Projects\EasyRepro-master\Microsoft.Dynamics365.UIAutomation.Api\Pages\LoginPage.cs:line 134
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.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\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, Func6 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) in C:\Users\kcarn\Documents\Test Studio Projects\EasyRepro-master\Microsoft.Dynamics365.UIAutomation.Api\Pages\LoginPage.cs:line 71
at Microsoft.Dynamics365.UIAutomation.Sample.CreateAccountTests.TestCreateNewAccount() in C:\Users\kcarn\Documents\Test Studio Projects\EasyRepro-master\Microsoft.Dynamics365.UIAutomation.Sample\CreateAccount.cs:line 22
Result Message:
Test method Microsoft.Dynamics365.UIAutomation.Sample.CreateAccountTests.TestCreateNewAccount threw exception:
OpenQA.Selenium.NoSuchElementException: no such element: Unable to locate element: {"method":"xpath","selector":"id("i0118")"}
(Session info: chrome=62.0.3202.94)
(Driver info: chromedriver=2.33.506120 (e3e53437346286c0bc2d2dc9aa4915ba81d9023f),platform=Windows NT 10.0.15063 x86_64)

+++++++++++++++++++++++++++++++++++++++++++++++
Added 12/2/2017
From XrmElementReferences

        //Login           
        { "Login_UserId", "id(\"i0116\")"},
        { "Login_Password", "id(\"i0118\")"}, 
        { "Login_OldUserId", "id(\"cred_userid_inputtext\")"},

Now when I pull the Xpath selector for the login ID
I get
//*[@id="i0281"]/div[1]/div/div[2]/div[2]/div/div/div[2]/div[2]/div/div[2]/div

Last time I looked i0281 was not i0116
So I do not understand how the selector can even find the Id field.

Locate a element by xpath in easyrepro framework

Hi All,

Can any one guide me that how to locate a element by xpath in EasyRepro framework?

We have tried with below two options, but not identifying the control.

  1. { "Nav_PhoneCallPage", "img[contains(@src,'/_imgs/incoming_call_32.png')]"},
  2. { "Nav_PhoneCallPage", "id("notescontrolactivityContainer_notescontrol")//img[contains(@src,'/_imgs/incoming_call_32.png']"},

Thanks in advance!

Build Microsoft.Dynamics365.UIAutomation.Api failing

After cloning the project, the build of Microsoft.Dynamics365.UIAutomation.Api fails with the following error:

'ReadOnlyCollection' does not contain a definition for 'Any' and no extension method 'Any' accepting a first argument of type 'ReadOnlyCollection' could be found (are you missing a using directive or an assembly reference?)

easyrepro

PhantomJS Support

Is support for PhantomJS coming? I saw it was listed in the browser type enums.

Stay signed in message

Hi,
I'm using CRM online version. I got the "Stay signed in" message after logging in and couldn't proceed further. Is there an API that I can use to close this dialog box?

Thanks,
Mai

ContextSwitchDeadlock exception

it raised an exceptiono named "ContextSwitchDeadlock" while I'm using the below code:
xrmBrowser.LoginPage.Login(_xrmUri, _username, _password);
xrmBrowser.GuidedHelp.CloseGuidedHelp();
xrmBrowser.ThinkTime(500);
xrmBrowser.CommandBar.ClickCommand("CREATE SR");
xrmBrowser.Driver.WaitUntilVisible(OpenQA.Selenium.By.Id("hw_contactphonenumber")); //raised at the line
xrmBrowser.Entity.SetValue("hw_contactphonenum", "15914314812");

or set the think time more longer ,like 3000ms , it also raised this exception .

Wrong selector for GridSearch

Hi
Thanks for an easy-to-use test framework :-)

In 9.0 xrmBrowser.Grid.Search didn't work for me.
search action would not fire.

Following change to "XrmElementReference.cs" worked for me

//{ "Grid_FindCriteriaImg"       , "id(\"crmGrid_findCriteriaImg\")"},
   { "Grid_FindCriteriaImg"       , "id(\"crmGrid_findCriteriaButton\")"},

Sales-Contact-Connection Not able to select or enter text

Hi Everyone,

  I am not able to enter text & select value in lookup field.

Sales-Contact-Connection

error: {"no such element: Unable to locate element: {"method":"class name","selector":"ms-crm-Inline-Edit"}\n (Session info: chrome=61.0.3163.100)\n (Driver info: chromedriver=2.31.488763 (092de99f48a300323ecf8c2a4e2e7cab51de5ba8),platform=Windows NT 6.1.7601 SP1 x86_64)"}

          xrmBrowser.Navigation.OpenSubArea("Sales", "Contacts");
          xrmBrowser.Navigation.OpenRelated("Connections");
            
            xrmBrowser.Related.ClickCommand("Connect", "To Me", false, 500);
                      
            xrmBrowser.ThinkTime(1000);
                            
            xrmBrowser.Navigation.SwitchToPopupWindow();
            xrmBrowser.Navigation.SwitchToDefaultContent();
            xrmBrowser.Navigation.SwitchToContentFrame();

            xrmBrowser.Entity.SetValue("description", "test");

            xrmBrowser.Entity.SelectLookup("record2roleid", 6);
            xrmBrowser.Entity.Save();
           
            xrmBrowser.CommandBar.ClickCommand("Save & Close");

I am seeing an exception while running my tests in Debug mode.

When I run the test in debug mode I get an exception. This happens with the sample tests as well (tried with TestCreateNewCase), running version 9 of EasyRepro.

Exception thrown: 'OpenQA.Selenium.NoSuchElementException' in WebDriver.Support.dll
An exception of type 'OpenQA.Selenium.NoSuchElementException' occurred in WebDriver.Support.dll but was not handled in user code
no such element: Unable to locate element: {"method":"xpath","selector":"//input[@type='email']"}
  (Session info: chrome=63.0.3239.132)
  (Driver info: chromedriver=2.31.488763 (092de99f48a300323ecf8c2a4e2e7cab51de5ba8),platform=Windows NT 10.0.15063 x86_64)

Test if a field is enabled

Hi,

I'm currently playing with the API and it's very nice, but I haven't found how to test if a field is enabled.
May be I missed something, but if not, it would be nice to have this possibility :-)

Account case grid search not working

Hi,

I am trying to search a case from Account. The ID of the Find criteria under Account -> Case tab is 'crmGrid_incident_customer_accounts_findCriteria'. When I tried searching with this id, i am not getting the input control. Please help me to handle this issue or provide me an alternate work around.

With Thanks
Anusha

EasyRepro is not working in Unified Interface

  1. I would like to know whether this EasyRepro will work on Unified Interface. I try few scenarios but it seems like not working. I gone deeper into EasyRepro the reference for element ID and Xpath and CssClass is different due to this its failed to identify the controls. (Correct me if I am wrong).

  2. How to switch between the Apps?
    For eg: I am working in Dynamics 365 - Custom, I need to go to Sales Hub apps
    I try to add ElementId, CssClass in XrmElementRefernce but its not able to identify the control in the apps, its throwing exception.

nuget

Please make Microsoft.Dynamics365.UIAutomation.Api and Microsoft.Dynamics365.UIAutomation.Browser available as nuget packages. This will make it much easier to get started running tests vs having to download a bunch of source code that I need to then put in my repo. I just want to use the functionality, not clutter my repo with source code which I should be able to just reference as assemblies from nuget.

xrmBrowser.LoginPage.Login not working

xrmBrowser.LoginPage.Login is not working if CRM is configured for token-based authentication and have a custom page to login which pass security token and redirect to CRM.

Selection of Review form after case creation

Hi Everyone,

Not able to create the review form after creation of Case form in service module:
XrmBrowser.Entity.SelectForm("Review", PreThinkTime(7000)) is not working

Steps:

  1. Go to Case
  2. Select new case
  3. Select create form
    'XrmBrowser.Entity.SelectForm("Create", PreThinkTime(7000))
  4. Save the case form
  5. Try to select Review form
    'XrmBrowser.Entity.SelectForm("Review", PreThinkTime(7000))
    Here not selecting the Review form.

How to select Review form after case creation?

Thanks in advance!

xrmBrowser.Navigation.OpenSubArea("Sales", "Dashboards") does not work for Version 1612 (8.2.1.344) (DB 8.2.1.344) online

While working even with samples I faced an issue for all calls
xrmBrowser.Navigation.OpenSubArea("Sales", "Leads");
This line fails with
no such element: Unable to locate element: {"method":"xpath","selector":"id("TabSFA")"} (Session info: chrome=60.0.3112.113) (Driver info: chromedriver=2.31.488763 (092de99f48a300323ecf8c2a4e2e7cab51de5ba8),platform=Windows NT 10.0.10586 x86_64)

at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary2 parameters) at OpenQA.Selenium.Remote.RemoteWebDriver.FindElement(String mechanism, String value) at OpenQA.Selenium.Remote.RemoteWebDriver.FindElementByXPath(String xpath) at OpenQA.Selenium.By.<>c__DisplayClasse.<XPath>b__c(ISearchContext context) at OpenQA.Selenium.By.FindElement(ISearchContext context) at OpenQA.Selenium.Remote.RemoteWebDriver.FindElement(By by) at OpenQA.Selenium.Support.Events.EventFiringWebDriver.FindElement(By by) at Microsoft.Dynamics365.UIAutomation.Browser.SeleniumExtensions.ClickWhenAvailable(IWebDriver driver, By by, TimeSpan timeout) in C:\Users\serhii.horkun\Downloads\EasyRepro-master\Microsoft.Dynamics365.UIAutomation.Browser\Extensions\SeleniumExtensions.cs:line 42 at Microsoft.Dynamics365.UIAutomation.Browser.SeleniumExtensions.ClickWhenAvailable(IWebDriver driver, By by) in C:\Users\serhii.horkun\Downloads\EasyRepro-master\Microsoft.Dynamics365.UIAutomation.Browser\Extensions\SeleniumExtensions.cs:line 37 at Microsoft.Dynamics365.UIAutomation.Api.XrmNavigationPage.<>c.<OpenMenu>b__2_0(IWebDriver driver) in C:\Users\serhii.horkun\Downloads\EasyRepro-master\Microsoft.Dynamics365.UIAutomation.Api\Pages\XrmNavigationPage.cs:line 51 at Microsoft.Dynamics365.UIAutomation.Browser.DelegateBrowserCommand1.ExecuteCommand(IWebDriver driver, Object[] params) in C:\Users\serhii.horkun\Downloads\EasyRepro-master\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 C:\Users\serhii.horkun\Downloads\EasyRepro-master\Microsoft.Dynamics365.UIAutomation.Browser\BrowserCommand.cs:line 111

xrmBrowser.Grid.OpenRecord() returns a "Record with Index does not exist" error when record does exist

While trying to open a record in the grid view I found that Open record threw an error, while Select record found the record.

`
public void TestMakeSkypeCall()
{
using (var xrmBrowser = new XrmBrowser(TestSettings.Options))
{
xrmBrowser.LoginPage.Login(_xrmUri, _username, _password, LoginHelper.ADFSLoginAction);

            xrmBrowser.ThinkTime(500);

            xrmBrowser.Navigation.OpenSubArea("Sales", "Contacts");  //open contacts list

            xrmBrowser.ThinkTime(2000);

            xrmBrowser.Dashboard.SwitchToContentFrame(); // Switch into the Iframe that has the content

            xrmBrowser.Grid.Sort("Last Name", 4000);     // sort the grid elements by the Last Name field

            //xrmBrowser.Grid.SelectRecord(2, 3500);       // get the second element in the array wait 3.5 seconds before selecting the record.

            xrmBrowser.Grid.OpenRecord(2, 3500);

        }//close using xrmBrowser

    }//close make skype call test

`

Test Name: TestMakeSkypeCall
Test FullName: MedSol_EasyRepro_Selenium.MakeSkypeCallToTraveler.TestMakeSkypeCall
Test Source: C:\Users\Media\source\repos\Quality Assurance\MedSol_EasyRepro_Selenium\MedSol_EasyRepro_Selenium\MakeSkypeCallToTraveler.cs : line 17
Test Outcome: Failed
Test Duration: 0:01:10.7279757

Result StackTrace:
at Microsoft.Dynamics365.UIAutomation.Api.XrmGridPage.<>c__DisplayClass14_0.b__0(IWebDriver driver)
at Microsoft.Dynamics365.UIAutomation.Browser.DelegateBrowserCommand1.ExecuteCommand(IWebDriver driver, Object[] params) 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)
at Microsoft.Dynamics365.UIAutomation.Browser.BrowserPage.Execute[TResult](BrowserCommandOptions options, Func`2 delegate)
at Microsoft.Dynamics365.UIAutomation.Api.XrmGridPage.OpenRecord(Int32 index, Int32 thinkTime)
at MedSol_EasyRepro_Selenium.MakeSkypeCallToTraveler.TestMakeSkypeCall() in C:\Users\Media\source\repos\Quality Assurance\MedSol_EasyRepro_Selenium\MedSol_EasyRepro_Selenium\MakeSkypeCallToTraveler.cs:line 28
Result Message:
Test method MedSol_EasyRepro_Selenium.MakeSkypeCallToTraveler.TestMakeSkypeCall threw exception:
System.InvalidOperationException: No record with the index '2' exists.

Date format

Hi, I'm facing an issue actually while testing your API.
I'm working on an european computer with european locals. My CRM instance is an US one. When I run any test with a date putting a DateTime.Now, it put the date in dd/MM/yyyy because of my computer locals so the test fails.

I can easily modify it on my side, but it could be very nice to detect this format conflict and/or set in the app.config the output DateTime region (en-US, gb-GB, ...)

Composite Control is hard coded to fullname field

the composite control currently only works for fullname in an Add Contact test as the value in
XrmElementReference.cs is hardcoded to fullname
{ "SetValue_CompositionLinkControlId" , "fullname_compositionLinkControl_"},

it would need to be
{ "SetValue_CompositionLinkControlId" , "[NAME]_compositionLinkControl_"},

but I'm not certain what changes need to be done in the SetValue(CompositeControl control) and GetValue(CompositeControl control)

Dynamics 365 for Operations Support

I really like the look of this and seems to work well. I was wondering if there is a plan to support Dynamics 365 for Operations?

Would it work in any way in it's current state on Dynamics 365 for Operations?

Any info would be greatly appreciated.

Create New Contact Records not saved

When running a create contact test using version 8.2, without regard to setting detect duplicates to true or false the record is not saved.
The pop up that comes after hitting save is never told to save so cancel is assumed.
So new contact name new data save at end results in duplicate detection even if I set duplicatedetection to false record isn't saved. Set duplicate detection to true and still record is not saved.
Duplicate Contact; Duplicatedetection true still no record saved.

Sign out function doesnt seem to work

I am getting an error when trying to run the sign out command. Below is the code block i am using

            xrmBrowser.LoginPage.Login(_xrmUri, _username, _password, ADFSLoginAction);
            xrmBrowser.ThinkTime(500);
            xrmBrowser.Navigation.OpenSubArea("Service", "Accounts");
            xrmBrowser.Navigation.SignOut();

OpenQA.Selenium.ElementNotVisibleException occurred
HResult=0x80131500
Message=Cannot click on element
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.RemoteWebElement.Click() at OpenQA.Selenium.Support.Events.EventFiringWebDriver.EventFiringWebElement.Click() at Microsoft.Dynamics365.UIAutomation.Api.XrmNavigationPage.<>c.<SignOut>b__8_0(IWebDriver driver) in K:\Master Automation\EasyRepro-master\Microsoft.Dynamics365.UIAutomation.Api\Pages\XrmNavigationPage.cs:line 231 at Microsoft.Dynamics365.UIAutomation.Browser.DelegateBrowserCommand1.ExecuteCommand(IWebDriver driver, Object[] params) in K:\Master Automation\EasyRepro-master\Microsoft.Dynamics365.UIAutomation.Browser\DelegateBrowserCommand.cs:line 28
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 K:\Master Automation\EasyRepro-master\Microsoft.Dynamics365.UIAutomation.Browser\BrowserCommand.cs:line 192 at Microsoft.Dynamics365.UIAutomation.Browser.BrowserCommand1.Execute(IWebDriver driver) in K:\Master Automation\EasyRepro-master\Microsoft.Dynamics365.UIAutomation.Browser\BrowserCommand.cs:line 36
at Microsoft.Dynamics365.UIAutomation.Browser.BrowserPage.Execute[TResult](BrowserCommandOptions options, Func`2 delegate) in K:\Master Automation\EasyRepro-master\Microsoft.Dynamics365.UIAutomation.Browser\BrowserPage.cs:line 182
at Microsoft.Dynamics365.UIAutomation.Api.XrmNavigationPage.SignOut(Int32 thinkTime) in K:\Master Automation\EasyRepro-master\Microsoft.Dynamics365.UIAutomation.Api\Pages\XrmNavigationPage.cs:line 226
at Microsoft.Dynamics365.UIAutomation.Sample.SigningOut.TestSigningOut() in K:\Master Automation\EasyRepro-master\Microsoft.Dynamics365.UIAutomation.Sample\SigningOut.cs:line 28

The Signout function seems to be looking for the element navTabButtonUserInfoSignOutId before it becomes visible on the screen. I think it only becomes visible after the UserInfo link (id navTabButtonUserInfoLinkId) is clicked.

    public BrowserCommandResult<bool> SignOut(int thinkTime = Constants.DefaultThinkTime)
    {
        Browser.ThinkTime(thinkTime);

        return this.Execute(GetOptions($"SignOut"), driver =>
        {
            var userInfo = driver.FindElement(By.XPath(Elements.Xpath[Reference.Navigation.UserInfo]));
            userInfo?.Click();
            var signOut = driver.FindElement(By.XPath(Elements.Xpath[Reference.Navigation.SignOut]));
            signOut?.Click();
            return true;
        });
    }

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.