Watij version 3.1.0
IE Version 6.0.2800.1106
When a Modal Dialog triggers another Modal Dialog to open, the current version of Watij is unable to get a handle on the 2nd Modal Dialog.
I have modified the ModalDialogTest.java to include this test:
1) testModalDialogLaunchModalDialogNotWorking
- this test tries to use ie.modalDialog() again to try to get a handle on the second ModalDialog. This test fails, since the call to ie.modalDialog() just hangs.
- However, if this test is run in debug mode, and some breakpoints are placed on the call to ie.modalDialog() and the modalDialog() method itself, then the test succeeds.
- It seems that IE needs some time in order to register the 2nd ModalDialog so if we delay the retrieval of the 2nd ModalDialog then it works.
2) testModalDialogLaunchModalDialogWorking
- this test uses the added method ModalDialog.modalDialog() that I have added which is implemented in IEModalDialog.modalDialog() as simple calling IE.modalDialog(). However the IE within IEModalDialog now contains the hwnd of the first ModalDialog so the call to IEModalDialog.modalDialog() in effect uses the first modal dialog's hwnd as its parent.
- All files I have modified are attached including html.
File contains files that I have modified including test files to demonstrate the bug and the solution I have made