2017-05-07 105 views
1
  • Ranorex 7.0.1,试用版,有28天的时间
  • 操作系统中,Windows 10
  • Chrome的司机,2.29
  • 硒webdriver的独立服务器,3.4 .0

我已经将端点设置为本地Selenium WebDriver,它的连接已经过“连接”测试。Ranorex无法启动Chrome浏览器,没有警告或错误

WebDriver,WebDriver.Support已被添加到引用。

的代码片段如下:

namespace HoT 
{ 
    class Program 
    { 
     [STAThread] 
     public static int Main(string[] args) 
     { 
      // Uncomment the following 2 lines if you want to automate Windows apps 
      // by starting the test executable directly 
      //if (Util.IsRestartRequiredForWinAppAccess) 
      // return Util.RestartWithUiAccess(); 

      Keyboard.AbortKey = System.Windows.Forms.Keys.Pause; 
      int error = 0; 
      var webDriver = new ChromeDriver(@"C:\Users\myName\Documents\Ranorex\RanorexStudio Projects\HoT\HoT\ExternalModules\chromedriver"); 
      webDriver.Navigate().GoToUrl("http://www.google.com"); 

      try 
      { 
       error = TestSuiteRunner.Run(typeof(Program), Environment.CommandLine); 
      } 
      catch (Exception e) 
      { 
       Report.Error("Unexpected exception occurred: " + e.ToString()); 
       error = -1; 
      } 
      return error; 
     } 
    } 
} 

我得到的是一个控制台窗口,弹出窗口,没有Chrome浏览器实例或警告或错误。有人知道为什么

enter image description here

回答

1

您需要启动浏览器

Host.Current.OpenBrowser( “http://www.google.com”, “铬”, “”,假的,假的,假的,假的,假的);

相关问题