Hi Lisa,

your right, index="0" should select the oldest of your windows, what should be the main one.

Can you try following
<groovy>
def windows = step.context.webClient.webWindows
def index = 0
windows.each
{
println index + "-> name: " + it.name + ", url: " + it.enclosedPage.webResponse.url
}
</groovy>

and look at the output on the console.

Marc.

Lisa Crispin wrote:
Hello,
I had some time to kill while our test database was knocked out, so I went back and tried to refactor some old WebTest scripts where we couldn't get things to work right before and ended up having to do the tests in Watir.

This particular script opens a window (I'm still having to do it with invoke, I can't figure out why clickbutton on submit on the form brings up a blank window - that's another problem, but I can't figure out how to send in a working example of that) and then clicks a link within that window to bring up another page within the same window. <previousResponse/> of course just brings back the first page within that popup window.

I need to get back to the 'main' browser window to continue the test. I tried using selectWindow with the index parameter since our windows don't have names.
<selectWindow description="get back to main window"
    index="0" />

This 'passes', but I can't tell what window it thinks it's on. It's sure not on the main one. Does selectWindow have the ability to select the 'main' window? What index would that be? I assumed 0, and if I try another number it fails so apparently it thinks at this point there is only one window to choose from. It's not a huge deal since we have a Watir test for these features, but I would just like to know how to get this to work in WebTest in the future. Also, I can't believe that I'm the only person having this problem. Maybe everyone else solves it with a Groovy script.
thanks
Lisa

_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest

Reply via email to