Ranorex 无法启动 Chrome 浏览器,没有警告或错误

Ranorex can not start Chrome browser, no warning or error

我已将 Endpoint 设置为 Local Selenium WebDriver,它的连接已被测试为 "Connected"。

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;
        }
    }
}

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

您需要使用

启动浏览器
Host.Current.OpenBrowser("http://www.google.com", "Chrome", "", false, false, false, false, false);