Package com.meterware.httpunit
Class WebResponse
- java.lang.Object
-
- com.meterware.httpunit.WebResponse
-
- All Implemented Interfaces:
CookieSource,com.meterware.httpunit.dom.DomWindowProxy,HTMLSegment
public abstract class WebResponse extends java.lang.Object implements HTMLSegment, CookieSource, com.meterware.httpunit.dom.DomWindowProxy
A response to a web request from a web server.- Author:
- Russell Gold, Drew Varner, Dave Glowacki, Benoit Xhenseval, Wolfgang Fahl
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classWebResponse.Scriptable
-
Constructor Summary
Constructors Modifier Constructor Description protectedWebResponse(WebClient client, FrameSelector frame, java.net.URL url)Constructs a response object.protectedWebResponse(WebClient client, FrameSelector frame, java.net.URL url, java.lang.String text)Constructs a response object.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidalert(java.lang.String message)voidclose()booleanconfirm(java.lang.String message)ScriptingHandlercreateDomScriptingHandler()create a DOMScriptingHandlerScriptingHandlercreateJavascriptScriptingHandler()protected voiddefineRawInputStream(java.io.InputStream inputStream)WebApplet[]getApplets()Returns the applets found in the page in the order in which they appear.java.lang.StringgetCharacterSet()Returns the character set used in this response.WebClientgetClient()getter for the WebClientintgetContentLength()Returns the content length of this response.java.lang.StringgetContentType()Returns the content type of this response.org.w3c.dom.DocumentgetDOM()Returns a copy of the domain object model tree associated with this response.java.lang.String[]getElementNames()Returns a list of HTML element names contained in this HTML section.HTMLElement[]getElementsByTagName(java.lang.String tagName)return the HTMLElements with the specified tag nameHTMLElement[]getElementsWithAttribute(java.lang.String name, java.lang.String value)Returns the HTMLElements found with the specified attribute value.HTMLElement[]getElementsWithName(java.lang.String name)Returns the HTMLElements found in this segment with the specified name.HTMLElementgetElementWithID(java.lang.String id)Returns the HTMLElement with the specified ID.java.lang.StringgetExternalStyleSheet()Returns the stylesheet linked in the head of the page.WebFormgetFirstMatchingForm(HTMLElementPredicate predicate, java.lang.Object criteria)Returns the first form found in the page matching the specified criteria.WebLinkgetFirstMatchingLink(HTMLElementPredicate predicate, java.lang.Object criteria)Returns the first link found in the page matching the specified criteria.WebTablegetFirstMatchingTable(HTMLElementPredicate predicate, java.lang.Object criteria)Returns the first table in the response which matches the specified predicate and value.TextBlockgetFirstMatchingTextBlock(HTMLElementPredicate predicate, java.lang.Object criteria)Returns the first link found in the page matching the specified criteria.WebForm[]getForms()Returns the forms found in the page in the order in which they appear.WebFormgetFormWithID(java.lang.String ID)Returns the form found in the page with the specified ID.WebFormgetFormWithName(java.lang.String name)Returns the form found in the page with the specified name.java.lang.StringgetFrameName()Returns the name of the frame containing this page.java.lang.String[]getFrameNames()Returns the names of the frames found in the page in the order in which they appear.abstract java.lang.StringgetHeaderField(java.lang.String fieldName)Returns the value for the specified header field.abstract java.lang.String[]getHeaderFieldNames()Returns the names of the header fields found in the response.WebImage[]getImages()Returns the images found in the page in the order in which they appear.WebImagegetImageWithAltText(java.lang.String altText)Returns the first image found in the page with the specified alt attribute.WebImagegetImageWithName(java.lang.String source)Returns the image found in the page with the specified name attribute.WebImagegetImageWithSource(java.lang.String source)Returns the first image found in the page with the specified src attribute.java.io.InputStreamgetInputStream()Returns a buffered input stream for reading the contents of this reply.WebLink[]getLinks()Returns the links found in the page in the order in which they appear.WebLinkgetLinkWith(java.lang.String text)Returns the first link which contains the specified text.WebLinkgetLinkWithID(java.lang.String ID)Returns the link found in the page with the specified ID.WebLinkgetLinkWithImageText(java.lang.String text)Returns the first link which contains an image with the specified text as its 'alt' attribute.WebLinkgetLinkWithName(java.lang.String name)Returns the link found in the page with the specified name.WebForm[]getMatchingForms(HTMLElementPredicate predicate, java.lang.Object criteria)Returns all forms found in the page matching the specified criteria.WebLink[]getMatchingLinks(HTMLElementPredicate predicate, java.lang.Object criteria)Returns all links found in the page matching the specified criteria.WebTable[]getMatchingTables(HTMLElementPredicate predicate, java.lang.Object criteria)Returns all tables found in the page matching the specified criteria.java.lang.String[]getMetaTagContent(java.lang.String attribute, java.lang.String attributeValue)Retrieves the "content" of the meta tags for a key pair attribute-attributeValue.java.lang.String[]getNewCookieNames()Returns a list of new cookie names defined as part of this response.java.lang.StringgetNewCookieValue(java.lang.String name)Returns the new cookie value defined as part of this response.TextBlockgetNextTextBlock(TextBlock block)Returns the text block after the specified block, if any.intgetRefreshDelay()Returns the delay before normally following the request to refresh this page, if any.WebRequestgetRefreshRequest()Returns a request to refresh this page, if any.abstract intgetResponseCode()Returns the response code associated with this response.abstract java.lang.StringgetResponseMessage()Returns the response message associated with this response.WebResponse.ScriptablegetScriptableObject()get the scriptable object for this WebResponseScriptingHandlergetScriptingHandler()WebResponsegetSubframeContents(java.lang.String subFrameName)Returns the contents of the specified subframe of this frameset response.WebTable[]getTables()Returns the top-level tables found in this page in the order in which they appear.WebTablegetTableStartingWith(java.lang.String text)Returns the first table in the response which has the specified text as the full text of its first non-blank row and non-blank column.WebTablegetTableStartingWithPrefix(java.lang.String text)Returns the first table in the response which has the specified text as a prefix of the text of its first non-blank row and non-blank column.WebTablegetTableWithID(java.lang.String text)Returns the first table in the response which has the specified text as its ID attribute.WebTablegetTableWithSummary(java.lang.String text)Returns the first table in the response which has the specified text as its summary attribute.java.lang.StringgetText()Returns the text of the response (excluding headers) as a string.TextBlock[]getTextBlocks()Returns an array of text blocks found in the page.java.lang.StringgetTitle()Returns the title of the page.java.net.URLgetURL()Returns the URL which invoked this response.static java.lang.String[]getValidContentTypes()allow access to the valid content TypesbooleanisHTML()Returns true if the response is HTML.protected voidloadResponseText()static ScriptableDelegatenewDelegate(java.lang.String delegateClassName)static WebResponsenewResponse(java.net.URLConnection connection)Returns a web response built from a URL connection.com.meterware.httpunit.dom.DomWindowProxyopenNewWindow(java.lang.String name, java.lang.String relativeUrl)open a a new Window with the given name and relative URLjava.lang.Stringprompt(java.lang.String prompt, java.lang.String defaultResponse)booleanreplaceText(java.lang.String text, java.lang.String contentType)Replaces the text in the window with the specified text and content type.protected voidsetContentTypeHeader(java.lang.String value)Overwrites the current value (if any) of the content type header.voidsetScriptingHandler(ScriptingHandler scriptingHandler)protected static voidsetValidContentTypes(java.lang.String[] validContentTypes)allow modification of the valid content Types use with carecom.meterware.httpunit.dom.DomWindowProxysubmitRequest(com.meterware.httpunit.dom.HTMLElementImpl sourceElement, java.lang.String method, java.lang.String location, java.lang.String target, com.meterware.httpunit.protocol.MessageBody requestBody)abstract java.lang.StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.meterware.httpunit.cookies.CookieSource
getHeaderFields
-
-
-
-
Constructor Detail
-
WebResponse
protected WebResponse(WebClient client, FrameSelector frame, java.net.URL url)
Constructs a response object. see [ 1159858 ] patch for RFE 1159844 (parsing intercepted pages)- Parameters:
frame- the frame to hold the responseurl- the url from which the response was received
-
WebResponse
protected WebResponse(WebClient client, FrameSelector frame, java.net.URL url, java.lang.String text)
Constructs a response object.- Parameters:
frame- the frame to hold the responseurl- the url from which the response was received
-
-
Method Detail
-
newResponse
public static WebResponse newResponse(java.net.URLConnection connection) throws java.io.IOException
Returns a web response built from a URL connection. Provided to allow access to WebResponse parsing without using a WebClient.- Throws:
java.io.IOException
-
isHTML
public boolean isHTML()
Returns true if the response is HTML.- Returns:
- true if the contenType fits
-
getURL
public java.net.URL getURL()
Returns the URL which invoked this response.- Specified by:
getURLin interfaceCookieSource- Specified by:
getURLin interfacecom.meterware.httpunit.dom.DomWindowProxy- Returns:
- the URL associated with the window.
-
getTitle
public java.lang.String getTitle() throws org.xml.sax.SAXExceptionReturns the title of the page.- Throws:
org.xml.sax.SAXException- thrown if there is an error parsing this response
-
getExternalStyleSheet
public java.lang.String getExternalStyleSheet() throws org.xml.sax.SAXExceptionReturns the stylesheet linked in the head of the page.will return "/mystyle.css".- Throws:
org.xml.sax.SAXException- thrown if there is an error parsing this response
-
getMetaTagContent
public java.lang.String[] getMetaTagContent(java.lang.String attribute, java.lang.String attributeValue) throws org.xml.sax.SAXExceptionRetrieves the "content" of the meta tags for a key pair attribute-attributeValue.this can be used like thisgetMetaTagContent("name","robots") will return { "index","follow" } getMetaTagContent("http-equiv","Expires") will return { "now" }- Throws:
org.xml.sax.SAXException- thrown if there is an error parsing this response
-
getFrameName
public java.lang.String getFrameName()
Returns the name of the frame containing this page.
-
getRefreshRequest
public WebRequest getRefreshRequest()
Returns a request to refresh this page, if any. This request will be defined by a tag in the header. If no tag exists, will return null.
-
getRefreshDelay
public int getRefreshDelay()
Returns the delay before normally following the request to refresh this page, if any. This request will be defined by a tag in the header. If no tag exists, will return zero.
-
getResponseCode
public abstract int getResponseCode()
Returns the response code associated with this response.
-
getResponseMessage
public abstract java.lang.String getResponseMessage()
Returns the response message associated with this response.
-
getContentLength
public int getContentLength()
Returns the content length of this response.- Returns:
- the content length, if known, or -1.
-
getContentType
public java.lang.String getContentType()
Returns the content type of this response.
-
getCharacterSet
public java.lang.String getCharacterSet()
Returns the character set used in this response.
-
getNewCookieNames
public java.lang.String[] getNewCookieNames()
Returns a list of new cookie names defined as part of this response.
-
getNewCookieValue
public java.lang.String getNewCookieValue(java.lang.String name)
Returns the new cookie value defined as part of this response.
-
getHeaderFieldNames
public abstract java.lang.String[] getHeaderFieldNames()
Returns the names of the header fields found in the response.
-
getHeaderField
public abstract java.lang.String getHeaderField(java.lang.String fieldName)
Returns the value for the specified header field. If no such field is defined, will return null. If more than one header is defined for the specified name, returns only the first found.
-
getText
public java.lang.String getText() throws java.io.IOExceptionReturns the text of the response (excluding headers) as a string. Use this method in preference to 'toString' which may be used to represent internal state of this object.- Throws:
java.io.IOException
-
getInputStream
public java.io.InputStream getInputStream() throws java.io.IOExceptionReturns a buffered input stream for reading the contents of this reply.- Throws:
java.io.IOException
-
getFrameNames
public java.lang.String[] getFrameNames() throws org.xml.sax.SAXExceptionReturns the names of the frames found in the page in the order in which they appear.- Throws:
org.xml.sax.SAXException- thrown if there is an error parsing this response
-
getSubframeContents
public WebResponse getSubframeContents(java.lang.String subFrameName)
Returns the contents of the specified subframe of this frameset response.- Parameters:
subFrameName- the name of the desired frame as defined in the frameset.
-
getElementWithID
public HTMLElement getElementWithID(java.lang.String id) throws org.xml.sax.SAXException
Returns the HTMLElement with the specified ID.- Specified by:
getElementWithIDin interfaceHTMLSegment- Throws:
org.xml.sax.SAXException- thrown if there is an error parsing the response.
-
getElementsByTagName
public HTMLElement[] getElementsByTagName(java.lang.String tagName) throws org.xml.sax.SAXException
return the HTMLElements with the specified tag name- Parameters:
tagName- e.g. "div" or "table"- Returns:
- a list of all HTMLElements with that tag name
- Throws:
org.xml.sax.SAXException- Since:
- 1.7
-
getElementNames
public java.lang.String[] getElementNames() throws org.xml.sax.SAXExceptionReturns a list of HTML element names contained in this HTML section.- Specified by:
getElementNamesin interfaceHTMLSegment- Throws:
org.xml.sax.SAXException
-
getElementsWithName
public HTMLElement[] getElementsWithName(java.lang.String name) throws org.xml.sax.SAXException
Returns the HTMLElements found in this segment with the specified name.- Specified by:
getElementsWithNamein interfaceHTMLSegment- Throws:
org.xml.sax.SAXException
-
getElementsWithAttribute
public HTMLElement[] getElementsWithAttribute(java.lang.String name, java.lang.String value) throws org.xml.sax.SAXException
Returns the HTMLElements found with the specified attribute value.- Specified by:
getElementsWithAttributein interfaceHTMLSegment- Throws:
org.xml.sax.SAXException- Since:
- 1.6
-
getForms
public WebForm[] getForms() throws org.xml.sax.SAXException
Returns the forms found in the page in the order in which they appear.- Specified by:
getFormsin interfaceHTMLSegment- Throws:
org.xml.sax.SAXException- thrown if there is an error parsing the response.
-
getFormWithName
public WebForm getFormWithName(java.lang.String name) throws org.xml.sax.SAXException
Returns the form found in the page with the specified name.- Specified by:
getFormWithNamein interfaceHTMLSegment- Throws:
org.xml.sax.SAXException- thrown if there is an error parsing the response.
-
getFormWithID
public WebForm getFormWithID(java.lang.String ID) throws org.xml.sax.SAXException
Returns the form found in the page with the specified ID.- Specified by:
getFormWithIDin interfaceHTMLSegment- Throws:
org.xml.sax.SAXException- thrown if there is an error parsing the response.
-
getFirstMatchingForm
public WebForm getFirstMatchingForm(HTMLElementPredicate predicate, java.lang.Object criteria) throws org.xml.sax.SAXException
Returns the first form found in the page matching the specified criteria.- Specified by:
getFirstMatchingFormin interfaceHTMLSegment- Throws:
org.xml.sax.SAXException- thrown if there is an error parsing the response.
-
getMatchingForms
public WebForm[] getMatchingForms(HTMLElementPredicate predicate, java.lang.Object criteria) throws org.xml.sax.SAXException
Returns all forms found in the page matching the specified criteria.- Specified by:
getMatchingFormsin interfaceHTMLSegment- Throws:
org.xml.sax.SAXException- thrown if there is an error parsing the response.
-
getLinks
public WebLink[] getLinks() throws org.xml.sax.SAXException
Returns the links found in the page in the order in which they appear.- Specified by:
getLinksin interfaceHTMLSegment- Throws:
org.xml.sax.SAXException- thrown if there is an error parsing the response.
-
getLinkWith
public WebLink getLinkWith(java.lang.String text) throws org.xml.sax.SAXException
Returns the first link which contains the specified text.- Specified by:
getLinkWithin interfaceHTMLSegment- Throws:
org.xml.sax.SAXException- thrown if there is an error parsing the response.
-
getLinkWithImageText
public WebLink getLinkWithImageText(java.lang.String text) throws org.xml.sax.SAXException
Returns the first link which contains an image with the specified text as its 'alt' attribute.- Specified by:
getLinkWithImageTextin interfaceHTMLSegment- Throws:
org.xml.sax.SAXException- thrown if there is an error parsing the response.
-
getLinkWithName
public WebLink getLinkWithName(java.lang.String name) throws org.xml.sax.SAXException
Returns the link found in the page with the specified name.- Throws:
org.xml.sax.SAXException- thrown if there is an error parsing the response.
-
getLinkWithID
public WebLink getLinkWithID(java.lang.String ID) throws org.xml.sax.SAXException
Returns the link found in the page with the specified ID.- Throws:
org.xml.sax.SAXException- thrown if there is an error parsing the response.
-
getFirstMatchingLink
public WebLink getFirstMatchingLink(HTMLElementPredicate predicate, java.lang.Object criteria) throws org.xml.sax.SAXException
Returns the first link found in the page matching the specified criteria.- Specified by:
getFirstMatchingLinkin interfaceHTMLSegment- Throws:
org.xml.sax.SAXException- thrown if there is an error parsing the response.
-
getMatchingLinks
public WebLink[] getMatchingLinks(HTMLElementPredicate predicate, java.lang.Object criteria) throws org.xml.sax.SAXException
Returns all links found in the page matching the specified criteria.- Specified by:
getMatchingLinksin interfaceHTMLSegment- Throws:
org.xml.sax.SAXException- thrown if there is an error parsing the response.
-
getImages
public WebImage[] getImages() throws org.xml.sax.SAXException
Returns the images found in the page in the order in which they appear.- Specified by:
getImagesin interfaceHTMLSegment- Throws:
org.xml.sax.SAXException- thrown if there is an error parsing the response.
-
getImageWithName
public WebImage getImageWithName(java.lang.String source) throws org.xml.sax.SAXException
Returns the image found in the page with the specified name attribute.- Specified by:
getImageWithNamein interfaceHTMLSegment- Throws:
org.xml.sax.SAXException- thrown if there is an error parsing the response.
-
getImageWithSource
public WebImage getImageWithSource(java.lang.String source) throws org.xml.sax.SAXException
Returns the first image found in the page with the specified src attribute.- Specified by:
getImageWithSourcein interfaceHTMLSegment- Throws:
org.xml.sax.SAXException- thrown if there is an error parsing the response.
-
getImageWithAltText
public WebImage getImageWithAltText(java.lang.String altText) throws org.xml.sax.SAXException
Returns the first image found in the page with the specified alt attribute.- Specified by:
getImageWithAltTextin interfaceHTMLSegment- Throws:
org.xml.sax.SAXException- thrown if there is an error parsing the segment.
-
getApplets
public WebApplet[] getApplets() throws org.xml.sax.SAXException
Description copied from interface:HTMLSegmentReturns the applets found in the page in the order in which they appear.- Specified by:
getAppletsin interfaceHTMLSegment- Throws:
org.xml.sax.SAXException- thrown if there is an error parsing the segment.
-
getTextBlocks
public TextBlock[] getTextBlocks() throws org.xml.sax.SAXException
Returns an array of text blocks found in the page.- Specified by:
getTextBlocksin interfaceHTMLSegment- Throws:
org.xml.sax.SAXException- thrown if there is an error parsing the segment.- Since:
- 1.6
-
getNextTextBlock
public TextBlock getNextTextBlock(TextBlock block) throws org.xml.sax.SAXException
Returns the text block after the specified block, if any.- Throws:
org.xml.sax.SAXException- Since:
- 1.6
-
getFirstMatchingTextBlock
public TextBlock getFirstMatchingTextBlock(HTMLElementPredicate predicate, java.lang.Object criteria) throws org.xml.sax.SAXException
Returns the first link found in the page matching the specified criteria.- Throws:
org.xml.sax.SAXException- thrown if there is an error parsing the response.- Since:
- 1.6
-
getDOM
public org.w3c.dom.Document getDOM() throws org.xml.sax.SAXExceptionReturns a copy of the domain object model tree associated with this response. If the response is HTML, it will use a special parser which can transform HTML into an XML DOM.- Throws:
org.xml.sax.SAXException- thrown if there is an error parsing the response.
-
getTables
public WebTable[] getTables() throws org.xml.sax.SAXException
Returns the top-level tables found in this page in the order in which they appear.- Specified by:
getTablesin interfaceHTMLSegment- Throws:
org.xml.sax.SAXException- thrown if there is an error parsing the response.
-
getFirstMatchingTable
public WebTable getFirstMatchingTable(HTMLElementPredicate predicate, java.lang.Object criteria) throws org.xml.sax.SAXException
Returns the first table in the response which matches the specified predicate and value. Will recurse into any nested tables, as needed.- Specified by:
getFirstMatchingTablein interfaceHTMLSegment- Returns:
- the selected table, or null if none is found
- Throws:
org.xml.sax.SAXException
-
getMatchingTables
public WebTable[] getMatchingTables(HTMLElementPredicate predicate, java.lang.Object criteria) throws org.xml.sax.SAXException
Returns all tables found in the page matching the specified criteria.- Specified by:
getMatchingTablesin interfaceHTMLSegment- Throws:
org.xml.sax.SAXException- thrown if there is an error parsing the response.
-
getTableStartingWith
public WebTable getTableStartingWith(java.lang.String text) throws org.xml.sax.SAXException
Returns the first table in the response which has the specified text as the full text of its first non-blank row and non-blank column. Will recurse into any nested tables, as needed. Case is ignored.- Specified by:
getTableStartingWithin interfaceHTMLSegment- Returns:
- the selected table, or null if none is found
- Throws:
org.xml.sax.SAXException- thrown if there is an error parsing the response.
-
getTableStartingWithPrefix
public WebTable getTableStartingWithPrefix(java.lang.String text) throws org.xml.sax.SAXException
Returns the first table in the response which has the specified text as a prefix of the text of its first non-blank row and non-blank column. Will recurse into any nested tables, as needed. Case is ignored.- Specified by:
getTableStartingWithPrefixin interfaceHTMLSegment- Returns:
- the selected table, or null if none is found
- Throws:
org.xml.sax.SAXException- thrown if there is an error parsing the response.
-
getTableWithSummary
public WebTable getTableWithSummary(java.lang.String text) throws org.xml.sax.SAXException
Returns the first table in the response which has the specified text as its summary attribute. Will recurse into any nested tables, as needed. Case is ignored.- Specified by:
getTableWithSummaryin interfaceHTMLSegment- Returns:
- the selected table, or null if none is found
- Throws:
org.xml.sax.SAXException- thrown if there is an error parsing the response.
-
getTableWithID
public WebTable getTableWithID(java.lang.String text) throws org.xml.sax.SAXException
Returns the first table in the response which has the specified text as its ID attribute. Will recurse into any nested tables, as needed. Case is ignored.- Specified by:
getTableWithIDin interfaceHTMLSegment- Returns:
- the selected table, or null if none is found
- Throws:
org.xml.sax.SAXException- thrown if there is an error parsing the response.
-
getScriptableObject
public WebResponse.Scriptable getScriptableObject()
get the scriptable object for this WebResponse
-
setScriptingHandler
public void setScriptingHandler(ScriptingHandler scriptingHandler)
-
getScriptingHandler
public ScriptingHandler getScriptingHandler()
- Specified by:
getScriptingHandlerin interfacecom.meterware.httpunit.dom.DomWindowProxy
-
createJavascriptScriptingHandler
public ScriptingHandler createJavascriptScriptingHandler()
-
createDomScriptingHandler
public ScriptingHandler createDomScriptingHandler()
create a DOMScriptingHandler- Returns:
- the DOM scripting handler (the window)
-
newDelegate
public static ScriptableDelegate newDelegate(java.lang.String delegateClassName)
-
openNewWindow
public com.meterware.httpunit.dom.DomWindowProxy openNewWindow(java.lang.String name, java.lang.String relativeUrl) throws java.io.IOException, org.xml.sax.SAXExceptionopen a a new Window with the given name and relative URL- Specified by:
openNewWindowin interfacecom.meterware.httpunit.dom.DomWindowProxy- Parameters:
name- - the name of the windowrelativeUrl- - the relative URL to be used- Returns:
- the WebResponse as a DomWindowProxy
- Throws:
java.io.IOExceptionorg.xml.sax.SAXException
-
submitRequest
public com.meterware.httpunit.dom.DomWindowProxy submitRequest(com.meterware.httpunit.dom.HTMLElementImpl sourceElement, java.lang.String method, java.lang.String location, java.lang.String target, com.meterware.httpunit.protocol.MessageBody requestBody) throws java.io.IOException, org.xml.sax.SAXException- Specified by:
submitRequestin interfacecom.meterware.httpunit.dom.DomWindowProxy- Throws:
java.io.IOExceptionorg.xml.sax.SAXException
-
close
public void close()
- Specified by:
closein interfacecom.meterware.httpunit.dom.DomWindowProxy
-
alert
public void alert(java.lang.String message)
- Specified by:
alertin interfacecom.meterware.httpunit.dom.DomWindowProxy
-
confirm
public boolean confirm(java.lang.String message)
- Specified by:
confirmin interfacecom.meterware.httpunit.dom.DomWindowProxy
-
prompt
public java.lang.String prompt(java.lang.String prompt, java.lang.String defaultResponse)- Specified by:
promptin interfacecom.meterware.httpunit.dom.DomWindowProxy
-
toString
public abstract java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
defineRawInputStream
protected final void defineRawInputStream(java.io.InputStream inputStream) throws java.io.IOException- Throws:
java.io.IOException
-
setContentTypeHeader
protected void setContentTypeHeader(java.lang.String value)
Overwrites the current value (if any) of the content type header.
-
replaceText
public boolean replaceText(java.lang.String text, java.lang.String contentType)Description copied from interface:com.meterware.httpunit.dom.DomWindowProxyReplaces the text in the window with the specified text and content type. Returns false if unable to do the replacement.- Specified by:
replaceTextin interfacecom.meterware.httpunit.dom.DomWindowProxy
-
getClient
public WebClient getClient()
getter for the WebClient- Returns:
- the web client for this WebResponse (if any)
- Since:
- 1.7
-
loadResponseText
protected void loadResponseText() throws java.io.IOException- Throws:
java.io.IOException
-
getValidContentTypes
public static java.lang.String[] getValidContentTypes()
allow access to the valid content Types- Returns:
- the validContentTypes
- Since:
- 1.7
-
setValidContentTypes
protected static void setValidContentTypes(java.lang.String[] validContentTypes)
allow modification of the valid content Types use with care- Parameters:
validContentTypes- the validContentTypes to set- Since:
- 1.7
-
-