2015年crm的Selenium自动化测试

Kum*_*PMP 9 selenium dynamics-crm-2013

我们将在CRM 2015中实现Selenium自动化测试以进行功能测试(客户端建议,因为它是开源工具),我在Google和Selenium for CRM 2015上做了很多探索.你能建议/指导我吗?如何在crm 2015中使用硒

Vin*_*tav 2

我想知道为什么它还没有得到答复,基本上你可以安装nuget 包并为你想要自动化的浏览器选择一个网络驱动程序。然后编写一个控制台应用程序,例如

    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();
Run Code Online (Sandbox Code Playgroud)

这是一个快速入门教程,您可以在文档中找到更多内容。虽然作为一个 SPA,设置它太贵了,不值得付出努力,但 LEAPTEST 声称它很容易定价。

注意:确保Bin\Debug文件夹中存在IEDriverServer.exe

2020 年更新:

回顾这个答案,我发现Sikuli更有用,因为它通过使用图像识别和控制 GUI(图形用户界面)组件来识别对象。当无法轻松访问 GUI 的内部或源代码时,Sikuli是不错的选择。

为此,您可以添加 Nuget 参考

  <package id="SikuliIntegrator" version="1.1.0" targetFramework="net452" />
Run Code Online (Sandbox Code Playgroud)

您可以将屏幕截图保存到文件夹中的c:\\crm文件夹中,并使用以下代码:

  <package id="SikuliIntegrator" version="1.1.0" targetFramework="net452" />
Run Code Online (Sandbox Code Playgroud)