问题
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
回答1:
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
回答2:
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.
Make sure that you have phpunit
Make sure you have Firefox browser. (other browsers are ok as well, but firefox has the best support).
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)
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\
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
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.
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.
To record your own tests, start the selenium ide and navigate to the age you want to test and start clicking around.
来源:https://stackoverflow.com/questions/33078502/selenium-automation-testing-in-crm-2015