History | Log In     View a printable version of the current page. Get help!  
Issue Details (XML | Word)

Key: WT-54
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Assignee: Paul King
Reporter: Lisa Crispin
Votes: 0
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
WebTest

window.close support?

Created: 27/Jun/05 17:35:26   Updated: 19/Dec/05 23:14:04
Affects Version/s: 2.0
Fix Version/s: 2.0

Environment: build 832, windows 2000 client, SUT on Linux server


 Description   
Not sure if this is a bug, but no response on mailing list so assuming maybe a bug.

When I have a step to click a close button that does a window.close, there is no error (so it finds the button) but the popup window doesn't close. Is this supported? Here's an example of the main window, the popup window and the WebTest steps. (Hey, I'm getting pretty good with HTML! ;-> )
Thanks,
Lisa
 
1. The main window html:
<HTML>
<HEAD>
<TITLE>Test Popup</TITLE>
</HEAD>
<BODY>
<FORM>
<SCRIPT language="javascript" defer> window.open('/testPopup1.html', "popupwindow"); </SCRIPT>
<P>There should be a popup above this page.</P>
</FORM>
</BODY>
</HTML>
 
2. The popup window html:
<HTML>
<HEAD>
<TITLE>Popup Page</TITLE>
</HEAD>
<BODY>
<FORM>
<P>This is the popup page.</P>
This is some text
<INPUT name="closeButton" id="closeButton" type="button" value="Close" class="wideButton" onclick="javascript: window.close();">
</FORM>
</BODY>
</HTML>
 
3. The WebTest steps:
 <invoke stepid="try the popup" url="/testPopup.html"/>
 <selectWindow stepid="get the popup window"
         name="popupwindow"/>
 <verifytext stepid="verify window"
  text="This is the popup"/>
  <clickButton stepid="close the window"
  htmlid="closeButton"/>
 

 All   Comments   Change History      Sort Order:
Comment by Marc Guillemot [12/Jul/05 13:30:45]
The problem is that webtest still holds a reference to the closed window instead of to the "active one". For some monthes, I've proposed to change the concept of the "current response" but didn't find time to investigate it until now.

Comment by Paul King [30/Jul/05 16:10:00]
The particular error noticed by Lisa is now "fixed". I have changed the behaviour so that when a closed event is detected webtest now does the equivalent of <previousResponse>. This may break some tests which workaround the current limitation by doing a previousResponse manually. In any case, this is only meant to be a partial solution giving us more time to consider (and implement) a better window management approach as per Marc's earlier suggestion(s).

Comment by Paul King [19/Dec/05 23:14:04]
Appears fixed (Marc's recent changes seem to work better)