Menu

#15 ModalDialog exists() method request

open
nobody
None
5
2007-06-22
2007-06-22
No

I have a situation when a modal dialog may or may not appear, depending on the state of the document displayed on the page. I'm trying to deal with the situation when the dialog does NOT appear. There is no ModalDialog exists() method that would meet my needs here. It would be helpful to have.

I've attached a class definition for a new unit test, based off of existing modaldialog test, along with a sample html file for it to use.

Discussion

  • Derek Kozikowski

    ZIP with test case class and test html file demonstrating problem

     
  • Robert Hjertmann Christiansen

    Logged In: YES
    user_id=1081294
    Originator: NO

    Hi,

    some code I use in a unit test might be of some use. (errorchecking not included)

    using
    com.jniwrapper.win32.ui.Wnd;

    IE ie;

    //create ie etc...

    Wnd x = new Wnd(ie.iWebBrowser2().getHWND().getValue());
    Wnd w =x.getWindow(Wnd.GW_HWNDNEXT | Wnd.GW_OWNER);
    if ("Internet Explorer_TridentDlgFrame".equals(w.getWindowClassName())) {
    //Modal exist
    ModalDialog md = ie.modalDialog();
    //work with modal

    w.sendMessageEx(0x10, 0, 0); //Send Close Message to modal window, md.close() doesn't work for me...
    }

     

Log in to post a comment.