Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/google-chrome/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 暂时停止Chrome选项卡切换可见性_C#_Google Chrome - Fatal编程技术网

C# 暂时停止Chrome选项卡切换可见性

C# 暂时停止Chrome选项卡切换可见性,c#,google-chrome,C#,Google Chrome,我使用硒处理铬。任务的本质是切换到具有所需URL的窗口 这个代码有效。但与此同时,chrome会疯狂地翻页。我需要停止在chrome中切换所有选项卡,直到找到所需的选项卡。如何加速?提前谢谢 string current_url = GetActiveTabUrl(); // Here i need to stop the animation of switching tabs foreach (string k in Browser.Wind

我使用硒处理铬。任务的本质是切换到具有所需URL的窗口

这个代码有效。但与此同时,chrome会疯狂地翻页。我需要停止在chrome中切换所有选项卡,直到找到所需的选项卡。如何加速?提前谢谢

        string current_url = GetActiveTabUrl();

        // Here i need to stop the animation of switching tabs

        foreach (string k in Browser.WindowHandles)
        {
            Browser.SwitchTo().Window(k);

            if (Browser.Url.ToString().Contains(current_url))
            {
                // Here i need to bring everything back to normal
                string name = "Undefined";
                name = Browser.FindElement(By.XPath("//*[@id='lot_title']")).GetAttribute("value").ToString();

                set_a_photo(chosePicture(name));

                break;
            }
        }