在 IE11 32 位 C# 中识别弹出窗口 window Selenium

Identify popup window Selenium in IE11 32 bit C#

我无法识别用于处理它的弹出窗口。这是我试过的:

            string dialog4;
            string dialog5;
            try
            {
                IAlert alert = driver.SwitchTo().Alert();
                dialog4 = alert.Text;
                alert.Accept();
                dialog5 = "nothing alert";
            }
            catch (NoAlertPresentException f)
            {
                try
                {
                    dialog4 = driver.SwitchTo().Frame(0).Title;// "dialog4";//
                    dialog5 = driver.SwitchTo().Frame(1).Title;// "dialog5";// 
                }
                catch (NoSuchFrameException e)
                {
                    try
                    {
                        dialog4 = driver.SwitchTo().Window("iHTKK").Title;
                        dialog5 = "nothing window";
                    }
                    catch
                    {
                        dialog4 = "nothing 4";
                        dialog5 = "nothing 5";
                    }
                }
            }

我还能做些什么来识别这个弹出窗口?

经过测试,确认 Window 间谍工具是识别 browser/driver 是否生成弹出窗口的好方法。在ahk_exe行,会说window是运行哪个可执行文件。在我的例子中,弹出窗口确实是一个从网站加载的 Java 插件,在我的计算机上 运行。我终于使用 AutoIt 来处理 window。如果有人使用 AutoIt,请记住它是一种不同的语言,所有操作都必须以其格式启动。