对于模态弹出窗口,Selenium测试用例失败

时间:2015-06-15 09:38:13

标签: selenium testing dialog modal-dialog

在执行重定向到CRM URL的测试用例后,所有测试用例都失败。它在浏览器中打开URL,其凭据弹出窗口为crm。它说了以下消息

try {
    UIManager.setLookAndFeel(new SyntheticaAluOxideLookAndFeel());
} catch (UnsupportedLookAndFeelException e) {
    e.printStackTrace();
} catch (ParseException e) {
    e.printStackTrace();
}
EventQueue.invokeLater(new Runnable() {
    public void run() {
        JFrame frame = new JFrame();
        …
        frame.pack(true);
        frame.setVisible(true);
    }
});

我使用以下代码来处理问题。但它没有用。 我使用的代码段:

"An exception of type 'OpenQA.Selenium.UnhandledAlertException' occurred in WebDriver.dll 
but was not handled in user code  Additional information: Modal dialog present".

如何关闭凭据模式对话框并返回到父窗口以继续其余的测试用例?

0 个答案:

没有答案