Package com.canoo.webtest.steps.request

Source Code of com.canoo.webtest.steps.request.CloseWindow

// Copyright � 2002-2005 Canoo Engineering AG, Switzerland.
package com.canoo.webtest.steps.request;

import com.canoo.webtest.engine.Context;
import com.canoo.webtest.steps.Step;
import com.gargoylesoftware.htmlunit.TopLevelWindow;

/**
* Closes the current top level window.<p>
*
* @author Marc Guillemot
* @webtest.step category="Extension"
* name="closeWindow"
* description="Closes the current top level window.
* The content of the last previously opened window will become the current response."
*/
public class CloseWindow extends Step {

    public void doExecute() throws Exception {
        final Context context = getContext();
       
        final TopLevelWindow window = (TopLevelWindow) context.getCurrentResponse().getEnclosingWindow().getTopWindow();
        window.close();
    }

    protected void verifyParameters() {
        super.verifyParameters();
    nullResponseCheck();
    }
}
TOP

Related Classes of com.canoo.webtest.steps.request.CloseWindow

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.