Web Test Recording - how to record another window

Hi,

I have an application that opens another browser window and all work happens from that window. When I try to record a web test, it records only what happens in the original window, nothing is recorded for that new window.

Any way to record communication from the new window?

Thanks!

Alex

[300 byte] By [AlexanderPodelko] at [2007-12-16]
# 1
Alexander,
We do record new windows that are opened via links with a target attribute specified and windows opened via javascript using window.open(). IE's event model does not allow us to record windows opened using window.showModalDialog() or window.showModelessDialog().
This is definitely going to be an area of improvement in our next release, but the best recommendation I can make right now would be to switch to one of the above methods even if just for recording. Since our engine operates at the HTTP level, you can change the calls back as soon as you're satisfied with the recording since it won't affect how the tests run.
One other option would be to use a tool like Fiddler (www.fiddlertool.com) to capture all the HTTP requests and then manually add them to your web test. We will be working with the author of that tool, Eric Lawrence, on the ability to directly export to web tests.
Josh
JoshChristieMSFT at 2007-9-9 > top of Msdn Tech,Visual Studio Team System,Visual Studio Team System - Web and Load Testing...
# 2
Josh,

I checked for one application - it opens the new window via javascript using window.open(). Still nothing is recorded from the new window.

Alex

AlexanderPodelko at 2007-9-9 > top of Msdn Tech,Visual Studio Team System,Visual Studio Team System - Web and Load Testing...
# 3
Wow, that is strange. Could you paste in the code (and the parameter values if they are all variables) that's doing the window.open()?

The simple answer is that our recorder can't record anything that IE doesn't raise the proper events for. That said, I thought window.open() always raised the events we need, but there must be cases where that is not true.

Thanks,
Josh

JoshChristieMSFT at 2007-9-9 > top of Msdn Tech,Visual Studio Team System,Visual Studio Team System - Web and Load Testing...
# 4
I guess it is here:

...

<script language="JavaScript">

<!--

function openWindow()

{

<%

// Assemble all context params (single values)

StringBuffer rsbRequestParams = new StringBuffer();

Enumeration reParams = request.getParameterNames();

while (reParams.hasMoreElements())

{

String rstParamName = (String)reParams.nextElement();

String[] rastParamValues = request.getParameterValues(rstParamName);

for (int iValueIndex = 0; iValueIndex < rastParamValues.length; iValueIndex++)

{

rsbRequestParams.append(rsbRequestParams.length() == 0 ? '?' : '&');

rsbRequestParams.append(rstParamName);

rsbRequestParams.append('=');

rsbRequestParams.append(java.net.URLEncoder.encode(rastParamValues[iValueIndex]));

}

}

%>

var url = 'http://<%=request.getServerName()%><%=request.getServerPort() != 80 ? ":" + request.getServerPort() : ""%><%=request.getContextPath()%>/index.jsp<%=rsbRequestParams.toString()%>';

var browser = '';

if (navigator.appName=='Netscape'){browser='NS';}

if (navigator.appName=='Microsoft Internet Explorer'){browser='MSIE';}

if (browser=='MSIE') {window.open(url,'avalancheLogon','toolbar=no,location=no,status=no,scrollbars=no,personalbar=no,menubar=no,resizable=yes');}

if (browser=='NS') {window.open(url,'avalancheLogon','toolbar=no,location=no,status=no,scrollbars=no,personalbar=no,menubar=no,resizable=yes');}

}

// -->

</script>

...

Alex

AlexanderPodelko at 2007-9-9 > top of Msdn Tech,Visual Studio Team System,Visual Studio Team System - Web and Load Testing...
# 5
I've been monitoring this thread with great interest...I'm seeing the same problem as Alexander, and am running v8.0.50727.26 with .NET 2.0.50727. Have you been able to verify a workaround to recording/examining IE 6.0 spawned windows from JScript's window.open()?

Thanks,

Terry

TerryAnderson at 2007-9-9 > top of Msdn Tech,Visual Studio Team System,Visual Studio Team System - Web and Load Testing...
# 6

Aside from manually inserting the popup request in your web test, you could try using Fiddler (www.fiddlertool.com) to record the popup window. Fiddler can also export the captured requests as a Visual Studio web test.

JoshChristieMS at 2007-9-9 > top of Msdn Tech,Visual Studio Team System,Visual Studio Team System - Web and Load Testing...

Visual Studio Team System

Site Classified