Package com.meterware.httpunit
Class WebWindow
java.lang.Object
com.meterware.httpunit.WebWindow
A window managed by a
WebClient
.- Author:
- Russell Gold
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Closes this window.Returns the web client associated with this window.Returns the response representing the main page in this window.getFrameContents
(String frameName) Returns the response associated with the specified frame name.String[]
Returns the name of the currently active frames.getName()
Returns the name of this window.Returns the web response that contained the script which opened this window.getResource
(WebRequest request) Returns the resource specified by the request.getResponse
(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.getResponse
(String urlString) Submits a GET method request and returns a response.boolean
Returns true if the specified frame name is defined in this window.boolean
isClosed()
Returns true if this window has been closed.sendRequest
(WebRequest request) Submits a web request and returns a response.
-
Method Details
-
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
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
Returns the web response that contained the script which opened this window. -
getResponse
Submits a GET method request and returns a response.- Throws:
SAXException
- thrown if there is an error parsing the retrieved pageIOException
-
sendRequest
Submits a web request and returns a response. This is an alternate name for the getResponse method.- Returns:
- the WebResponse or null
- Throws:
IOException
SAXException
-
getResponse
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:
SAXException
- thrown if there is an error parsing the retrieved pageIOException
-
getResource
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:
IOException
-
getFrameNames
Returns the name of the currently active frames. -
hasFrame
Returns true if the specified frame name is defined in this window. -
getFrameContents
Returns the response associated with the specified frame name. Throws a runtime exception if no matching frame is defined. -
getCurrentPage
Returns the response representing the main page in this window.
-