Any of the following works to click on the link: $ie.image(:id, "popupImage1").click $ie.image(:src, /button_arrows_round/).click $ie.link(:id, "ID_OPEN_POPUP1").click The result is the same, right button is flashed when used with .flash and they all open the right window - BUT! Second time, after you open it manually at least once. I even tried fireEvent(onClick) - same thing. Galina. -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Galina Maralina Sent: Sunday, November 26, 2006 4:38 PM To: [email protected] Subject: [Wtr-general] activeElement error. Hello, I encountered a difference between Watir behavior and manual clicking on the link that is a problem for automated testing of the hole application. Here is my button/link/image, clicking on it opens a popup window: <a id="ID_OPEN_POPUP1" href="#1" onclick="javascript:setDirtyFlag();activeElementGeneralizor(this);generi cPopupDelegator(1, 'POPUP_IDS1', 2, 'POPUP_IDS1', 'str_criteriaValuesInput1');return false;"><img id="popupImage1" src="/c2p/images/buttons/button_arrows_round15.gif" width="15" height="15" hspace="3" border="0" valign="absmiddle" /></a> When I try to open a popup window for the first time after the page loaded, I can do it manually, but Water does not open it, though no error is reported by Watir itself. There is an error in Javascript on the page that says: Member not found. If I open this popup manually first time, then I can use Watir to continue working with the page and it will open this same popup. When our developers tried to debug the error, they saw, that it is connected to using an activeElement in Javascript, they thought that, may be, Watir does not support some of it's methods. Here is the code that tested it: function activeElementGeneralizor(focusedElement){//TODO release this 'hack'! //test alert("activeElementGeneralizor("+focusedElement+")");//test var message = "originally supported"; // if(!document.activeElement){ try{ alert("activeElement:"+document.activeElement.toString()); document.activeElement=focusedElement;//TSU44 11192006: This may be the code that Watia can not execute... }catch(e){ alert("activeElement error:"+e.description); t alert("activeElement:"+document.activeElement.toString()); // Document.prototype.activeElement = new HTMLElement; // document.activeElement = focusedElement; } message = "modified"; // } //test alert(document.activeElement+"("+message+")"); } When running manually, the alert would point to url; when tested with Watir alert was activeElement:[object] and activeElement error: Member not found. I do need to open this popup in order to run tests, so if you know, what can be done, please, help me. Thank you, Galina Maralina.
_______________________________________________ Wtr-general mailing list [email protected] http://rubyforge.org/mailman/listinfo/wtr-general
