Hi, Last few days I have been investigating this and tried all the dialog related tests in the current watir (1.5) code. None of the test I tried works if the IE windows is not in focus.
I started digging about how this could be achieved and I came across few win32 api (getting window handle, sending messages to applications) and I got one proof of concept vb code build, which can click on IE javascript dialog when not in focus. My next task was to put it in ruby using win32 api. When doing this I came across guitest tool in ruby and one of the post by Bret mentioning this tool. He mentioned that guitest needed to compiled in cygwin. Nevertheless I gave it a try and to my surprise using nmake I can make the guitest.so libarary which works like charm. I have rewritten the javascript_test.rb using the *click_no_wait* and the guitest and it works like charm. With guitest library my IE window need not be focus when it needs to click on javascript dialog. While investigating I checked out watir code in more details and came across some things which I cant explain to myself. I would appreciate any clarification. 1. WinClicker has almost the code needed to do what I have done. But I could not find any test which does the clicking when IE window is not focused. Question : What was the basic purpose of writing winclicker? 2. Autoit is used to simulate key strokes? Why does Autoit poses the requirement that the windows that it works on needs to be focused. Can't autoit script work on window that it has handle of? 3. What are other features in watir that we can use guitest to enhance? 4. I could not exactly figure out the need for IEDialog as well. 5. My current implementation works by searching for the window with title "Microsoft Internet Explorer". Ideally I would like to search for child windows of IE, of which I have handle in ie.hwnd. However for some reason windows does not recognize the javascript dialog as the child window of IE. Surprisingly when I try to find the parent window of dialog it is shown correctly IE as the parent window of javascript dialog box? Any ideas? If anybody wants to checkout this code I can send out the instructions to build guitest.so (or can send the binary itself) and other test code that I have. Thanks and Regards, Manish _______________________________________________ Wtr-general mailing list [email protected] http://rubyforge.org/mailman/listinfo/wtr-general
