Selenium Webdriver - 访问第二个子窗口(弹出窗口)

时间:2017-05-17 12:09:22

标签: selenium selenium-webdriver selenium-iedriver

我在IE中自动化应用程序,如果用户单击主窗口上的链接,则弹出子窗口。用户进一步单击子窗口中弹出第二个子窗口的另一个链接。请找到相同application screenshot

的屏幕截图

问题是第三个弹出窗口在第二个弹出窗口后面。使用以下代码,我可以获得第三个弹出窗口的标题,但无法在那里工作(如点击任何链接等)。

请在下面找到我用于从第二个窗口导航到第三个窗口的代码。

  [{"source": "Delhi", "target": "Mangalore", "type": "forward"},
         {"source": "Mangalore", "target": "Delhi", "type": "back"},
          {"source": "Delhi", "target": "Yashvanthpur", "type": "back"},
          {"source": "Mangalore", "target": "Rome", "type": "forward"},
          {"source": "Delhi", "target": "Mysore", "type": "forward"},

          {"source": "Chandigarh", "target": "Vellore", "type": "forward"},
          {"source": "Chandigarh", "target": "Mangalore", "type": "forward"},
          {"source": "Delhi", "target": "Nagpur", "type": "forward"}

        ]

请告诉我如何访问第3个窗口。谢谢

1 个答案:

答案 0 :(得分:2)

使用以下代码切换到所需的窗口

<xsl:for-each select="/releasenotes/notes/note[component/@type=$unitTag]">
    <xsl:for-each select=".[component/@number=$versionNumber and text/@type='new']">