Package com.meterware.httpunit
Class WebWindow
- java.lang.Object
-
- com.meterware.httpunit.WebWindow
-
public class WebWindow extends java.lang.ObjectA window managed by aWebClient.- Author:
- Russell Gold
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes this window.WebClientgetClient()Returns the web client associated with this window.WebResponsegetCurrentPage()Returns the response representing the main page in this window.WebResponsegetFrameContents(java.lang.String frameName)Returns the response associated with the specified frame name.java.lang.String[]getFrameNames()Returns the name of the currently active frames.java.lang.StringgetName()Returns the name of this window.WebResponsegetOpener()Returns the web response that contained the script which opened this window.WebResponsegetResource(WebRequest request)Returns the resource specified by the request.WebResponsegetResponse(WebRequest request)Submits a web request and returns a response, using all state developed so far as stored in cookies as requested by the server.WebResponsegetResponse(java.lang.String urlString)Submits a GET method request and returns a response.booleanhasFrame(java.lang.String frameName)Returns true if the specified frame name is defined in this window.booleanisClosed()Returns true if this window has been closed.WebResponsesendRequest(WebRequest request)Submits a web request and returns a response.
-
-
-
Method Detail
-
getClient
public WebClient getClient()
Returns the web client associated with this window.
-
isClosed
public boolean isClosed()
Returns true if this window has been closed.
-
close
public void close()
Closes this window.
-
getName
public java.lang.String getName()
Returns the name of this window. Windows created through normal HTML or browser commands have empty names, but JavaScript can set the name. A name may be used as a target for a request.
-
getOpener
public WebResponse getOpener()
Returns the web response that contained the script which opened this window.
-
getResponse
public WebResponse getResponse(java.lang.String urlString) throws java.io.IOException, org.xml.sax.SAXException
Submits a GET method request and returns a response.- Throws:
org.xml.sax.SAXException- thrown if there is an error parsing the retrieved pagejava.io.IOException
-
sendRequest
public WebResponse sendRequest(WebRequest request) throws java.io.IOException, org.xml.sax.SAXException
Submits a web request and returns a response. This is an alternate name for the getResponse method.- Returns:
- the WebResponse or null
- Throws:
java.io.IOExceptionorg.xml.sax.SAXException
-
getResponse
public WebResponse getResponse(WebRequest request) throws java.io.IOException, org.xml.sax.SAXException
Submits a web request and returns a response, using all state developed so far as stored in cookies as requested by the server. see patch [ 1155415 ] Handle redirect instructions which can lead to a loop- Returns:
- the WebResponse or null
- Throws:
org.xml.sax.SAXException- thrown if there is an error parsing the retrieved pagejava.io.IOException
-
getResource
public WebResponse getResource(WebRequest request) throws java.io.IOException
Returns the resource specified by the request. Does not update the window or load included framesets. May return null if the resource is a JavaScript URL which would normally leave the client unchanged.- Throws:
java.io.IOException
-
getFrameNames
public java.lang.String[] getFrameNames()
Returns the name of the currently active frames.
-
hasFrame
public boolean hasFrame(java.lang.String frameName)
Returns true if the specified frame name is defined in this window.
-
getFrameContents
public WebResponse getFrameContents(java.lang.String frameName)
Returns the response associated with the specified frame name. Throws a runtime exception if no matching frame is defined.
-
getCurrentPage
public WebResponse getCurrentPage()
Returns the response representing the main page in this window.
-
-