我无法覆盖默认超时值Selenium 3.14

时间:2019-12-14 02:26:07

标签: c# selenium selenium-webdriver pageloadtimeout

我已经查看了所有答案,但似乎对我没有任何帮助,无论我做什么,我都无法覆盖页面加载的默认60秒驱动程序超时。即使在Selenium服务器上,当我设置全局超时值时,它也不适用。

Breakpoint

ChromeOptions options = new ChromeOptions();
options = GetChromeOptions();

string projectPath = System.AppDomain.CurrentDomain.BaseDirectory;
IWebDriver test = new ChromeDriver(projectPath,options, TimeSpan.FromMinutes(10));
test.Manage().Timeouts().PageLoad = TimeSpan.FromMinutes(2);
test.Manage().Timeouts().ImplicitWait = TimeSpan.FromMinutes(2);

设置的选项:

private static ChromeOptions GetChromeOptions()
{
    var chromeOptions = new ChromeOptions();
    chromeOptions.AddArgument("no-sandbox");
    chromeOptions.AddUserProfilePreference("download.default_directory", Config.TempPath);
    chromeOptions.AddUserProfilePreference("download.prompt_for_download", false);
    chromeOptions.AddUserProfilePreference("disable-popup-blocking", "true");


    if (Config.IsHeadless)
    {
        chromeOptions.AddArgument("headless");
    }
    chromeOptions.AddArgument("--disable-dev-shm-usage");
    chromeOptions.AddArgument("proxy-server='direct://'");
    chromeOptions.AddArgument("proxy-bypass-list=*");
    chromeOptions.SetLoggingPreference(LogType.Browser, Config.BrowserErrorLoggingType);
    return chromeOptions;
}

服务器配置: Selenium Server Config

0 个答案:

没有答案