[Webtest] new window

Dierk Koenig webtest@lists.canoo.com
Thu, 13 May 2004 10:05:22 +0200

This is a multi-part message in MIME format.

Content-Type: text/plain;
Content-Transfer-Encoding: 7bit


I just got a similar bug report and investigated the issue.

The behaviour comes with links that bear the attribute

After a "click()" on such a link, HttpUnit opens those pages in a new
"WebWindow" and adds this
window to the open windows list. However, the
does not return this page, but still the previous one.

I'm not absolutely sure, but it seems this behaviour was introduced
with the JavaScript support for clicklink.
Marc: could you please verify this?

We failed to include a test for target attributes into our suite of
Now I created some and will include them in the distribution as soon as the
issue is solved. Here it is: (html files attached)
    <target name="testClickLinkWithTarget">
        <testSpec name="Clicklink with Target">
                <invoke stepid="start"
                <clicklink label="Link to some other Window"/>
				<verifytext text="new almost empty page"/>
                <clicklink label="Link to top Window"/>
				<verifytext text="new almost empty page"/>
                <clicklink label="Link to new Window"/>
				<verifytext text="new almost empty page"/>

This is an HttpUnit test to expose the handling there:
    public void testBlankTarget() throws IOException, SAXException,
MalformedURLException {
        WebConversation wc = new WebConversation();
        WebResponse resp =
        WebLink blankLink = resp.getLinkWith("Link to new Window");
        assertEquals("_blank", blankLink.getTarget());
        WebWindow[] windows = wc.getOpenWindows();
        String newPage =
        assertTrue(newPage, newPage.indexOf("new almost empty page") > -1);

It would be fairly easy to solve the issue in "clicklink" for the special
of "_blank". I suspect that "_top" etc. may also cause problems (e.g. with
Marc, all: do you have any idea how we can do this cleanly?


> -----Original Message-----
> From: webtest-admin@lists.canoo.com
> [mailto:webtest-admin@lists.canoo.com]On Behalf Of Jeannie Graham
> Sent: Mittwoch, 5. Mai 2004 23:12
> To: 'webtest@lists.canoo.com'
> Subject: [Webtest] new window
> Hello group,
> 	I've noticed past emails where people have had problems with
> accessing new pop-up windows with Canoo Webtest - and responses that Canoo
> can't do it.
> Well, I don't know how, but Canoo Webtest actually performs a verify title
> and the setting of selectfields on a new window for me, but when that new
> window refreshes with a new page, Canoo goes back to the main (first)
> window.   Not sure why or how Canoo can see that second window, nor why it
> leaves it when it refreshes it's page.
> I am very interested to see if anyone has had similiar experience and if
> anyone has come up with some trick.
> Thanks for any ideas,
> Jeannie
> _______________________________________________
> WebTest mailing list
> WebTest@lists.canoo.com
> http://lists.canoo.com/mailman/listinfo/webtest

Content-Type: text/html;
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;

<title>For clicklink tests</title>

<h1>new almost empty page</h1>


Content-Type: text/html;
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;

<title>For clicklink tests</title>

<h1>Some links to test the &lt;clicklink...&gt; step...</h1>

<a href="newPage.html" target="_blank">Link to new Window</a>
<a href="newPage.html" target="_top">Link to top Window</a>
<a href="newPage.html" target="some">Link to some other Window</a>