8

We are going to implementation Selenium automation testing for functional testing in CRM 2015 (Client suggestion , because it is open source tool), I did a lot of exploration in Google and different search engine for Selenium for CRM 2015. Could you advise/guide me how to use selenium in crm 2015

Peter G.
  • 7,816
  • 20
  • 80
  • 154
Kumar Manish
  • 3,746
  • 3
  • 37
  • 42

2 Answers2

2

I wonder why isn't it answered yet, basically you can install the nuget package and choose a webdriver for the browser you want to automate. Then write a console application like

    using OpenQA.Selenium;
    using OpenQA.Selenium.IE;

    string crmUrl = "http://mycrm.url";
    //create a ieAutomation
    IWebDriver ieAutomation = new InternetExplorerDriver();//BrowserDriver
    
    // open url
    ieAutomation.Navigate().GoToUrl(crmUrl);
    
    // find element by id and set text
    ieAutomation.FindElement(By.Id("name")).SendKeys("set the text");
                    
    // find element by id and make a click
    ieAutomation.FindElement(By.Id("id")).Click();
    
    // close the driver & exit
    ieAutomation.Close();
    ieAutomation.Quit();

This is one quick startup tutorial to start with, you can found more in the documentation. Although being a SPA it's too expensive to set it up and not worth the effort but LEAPTEST claims it be easy with a price.

Note: make sure IEDriverServer.exe is available in the Bin\Debug folder

Update 2020:

Looking back to this answer i found a Sikuli to be more useful, as it identifies the objects by using image recognition and control GUI (Graphical User Interface) components. Sikuli is good option when there is no easy access to a GUI's internal or source code.

For that, you can add Nuget reference

  <package id="SikuliIntegrator" version="1.1.0" targetFramework="net452" />

You can save the screenshots to a folder say in c:\\crm folder and use the code below:

static void Main(string[] args)
{

    SikuliModule.SikuliAction.Click("C:\\crm\\Sales.png");
    SikuliModule.SikuliAction.Click("C:\\crm\\Accounts.png");
    SikuliModule.SikuliAction.Click("C:\\crm\\New.png");
    SikuliModule.SikuliAction.DoubleClick("C:\\crm\\ParentAccountQ.png");
    SikuliModule.SikuliAction.Click("C:\\crm\\LookupLense.png");
    //SikuliModule.SikuliAction.Click()
}
Vinod Srivastav
  • 3,644
  • 1
  • 27
  • 40
0

Note that this may differ from each OS. Also the configuration was writen a year and half ago by me for php and zend 1. However most of the things should not differ.

  1. Make sure that you have phpunit

  2. Make sure you have Firefox browser. (other browsers are ok as well, but firefox has the best support).

  3. Go to the following link and download selenium-remote-control-1.0.3.zip. http://code.google.com/p/selenium/downloads/detail?name=selenium-remote-control-1.0.3.zip&can=2&q= ( couldn't find a newer verion)

  4. Unzip the zip file, go to selenium-remote-control-1.0.3=> selenium-php-client-driver-1.0.1=> PEAR, copy ‘Testing’ folder and then paste it to C:\xampp\php folder. The rest of the files add in C:. So it becomes C:\selenium-remote-control-1.0.3\selenium-server-1.0.3\

  5. Download the Selenium RC server http://selenium-release.storage.googleapis.com/index.html?path=2.48/ i was using the standalone file version 2.41 Now there is version 2.48 + some dotnet files

    5.1. to start the server open your command prompt or terminal navigate to C:\selenium-remote-control-1.0.3\selenium-server-1.0.3 and type java -jar selenium-server-standalone-2.41.0.jar

    5.2. For the server to run you’ll need Java installed and the PATH environment variable correctly configured to run it from the console. You can check that you have Java correctly installed by running the following on a console:

    java -version

    if the version is >= 1.5 you can use Selenium RC

  6. Get Selenium IDE for Firefox and install it http://release.seleniumhq.org/selenium-ide/ pick the version you want. I was using 2.5.0 at that time.

  7. Run already configured test. Start the selenium server (see point 5.1), navigate to your phpunit tests and run the test. Firefox should start after few seconds and perform the test. If there is an error the test will be terminated.

  8. To record your own tests, start the selenium ide and navigate to the age you want to test and start clicking around.

JeffC
  • 22,180
  • 5
  • 32
  • 55
Stanimir Dimitrov
  • 1,872
  • 2
  • 20
  • 25
  • 1
    I want to use selenium with crm 2015 , this is .net based application and Microsoft prevents to direct access in the DOM object and Selenium is JavaScript-based and runs directly in the browser. Selenium access to the browser object by javascript-based windows access and the HTML Document Object Model (DOM), Did you implement selenium with Dynamics CRM 2015 ? @stanimir – Kumar Manish Oct 14 '15 at 12:15
  • Sorry, no. I did implemeneted it with PHP. If MS prevents the DOM access I don't think that there is a way to access it. – Stanimir Dimitrov Oct 14 '15 at 12:19
  • i guess the answer what he is looking for is to startup with the CRM automation with Selenium and not with php although this is a good intro for PHP with Selenium – Vinod Srivastav Apr 03 '17 at 19:56