|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.bitmechanic.maxq.generator.TemplateLogic
com.bitmechanic.maxq.generator.HttpUnitTemplateLogic
public class HttpUnitTemplateLogic
TemplateLogic
variation for generating smart HttpUnit tests.
Nested Class Summary | |
---|---|
static class |
HttpUnitTemplateLogic.InPlaceResponse
A subclass of WebResponse for parsing pages intercepted by MaxQ proxy. |
Constructor Summary | |
---|---|
HttpUnitTemplateLogic()
|
Method Summary | |
---|---|
com.meterware.httpunit.WebForm |
getFormByParameterNames(com.meterware.httpunit.HTMLSegment page,
java.util.Map requestParameters)
Guesses the submitted form using the names of the POST parameters in the next request. |
java.util.List |
getForms(com.meterware.httpunit.HTMLSegment page)
Returns all the forms contained in the given page. |
java.util.List |
getLinkIds(com.meterware.httpunit.HTMLSegment page,
java.lang.String url)
Returns list of IDs of the links that have hrefs containd in the specified URL. |
java.util.List |
getLinkTexts(com.meterware.httpunit.HTMLSegment page,
java.lang.String url)
Returns list of texts of the links that have hrefs containd in the specified URL. |
java.util.List |
getPostButtonId(com.meterware.httpunit.WebForm form)
Returns list of IDs of the buttons that can possibly submit a form using JavaScript. |
java.util.List |
getPostButtonIndices(com.meterware.httpunit.WebForm form)
Returns list of indices of the buttons that can possibly submit a form using JavaScript. |
java.util.List |
getPostLinkIds(com.meterware.httpunit.HTMLSegment page)
Returns IDs of all links in the page that execute JavaScript code. |
java.util.List |
getPostLinkTexts(com.meterware.httpunit.HTMLSegment page)
Returns texts of all links in the page that execute JavaScript code. |
com.meterware.httpunit.SubmitButton |
getPostSubmitButton(com.meterware.httpunit.WebForm form,
java.util.Map parameters)
Guesses the clicked submit button in a form, based on the POST parameters in the next request. |
java.util.List |
getPostSubmitButtonIndices(com.meterware.httpunit.WebForm form)
Returns the indices of submit buttons present in the form. |
com.meterware.httpunit.HTMLSegment |
parsePage(java.lang.String url,
java.lang.String content)
Parse a web page using HttpUnit. |
Methods inherited from class com.bitmechanic.maxq.generator.TemplateLogic |
---|
escapeParam, getBaseUrl, getConfig, getRelativeUrl |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HttpUnitTemplateLogic()
Method Detail |
---|
public com.meterware.httpunit.HTMLSegment parsePage(java.lang.String url, java.lang.String content) throws java.net.MalformedURLException
At the time of writing this requires patched HttpUnit to operate correctly
url
- the page URL, required for downloading scripts.content
- the the page content.
java.net.MalformedURLException
public java.util.List getLinkIds(com.meterware.httpunit.HTMLSegment page, java.lang.String url) throws org.xml.sax.SAXException
page
- the page.url
- the url.
org.xml.sax.SAXException
- if page traversal fails.public java.util.List getLinkTexts(com.meterware.httpunit.HTMLSegment page, java.lang.String url) throws org.xml.sax.SAXException
page
- the page.url
- the url.
org.xml.sax.SAXException
- if page traversal fails.public java.util.List getForms(com.meterware.httpunit.HTMLSegment page) throws org.xml.sax.SAXException
page
- the page.
org.xml.sax.SAXException
- if page traversal fails.public com.meterware.httpunit.WebForm getFormByParameterNames(com.meterware.httpunit.HTMLSegment page, java.util.Map requestParameters) throws org.xml.sax.SAXException
page
- the pagerequestParameters
- the POST parameters in the next request.
org.xml.sax.SAXException
- if page traversal fails.public com.meterware.httpunit.SubmitButton getPostSubmitButton(com.meterware.httpunit.WebForm form, java.util.Map parameters) throws org.xml.sax.SAXException
form
- the form.parameters
- the POST parameters in the next request.
org.xml.sax.SAXException
- if page traversal fails.public java.util.List getPostSubmitButtonIndices(com.meterware.httpunit.WebForm form)
At the time of writiting this method requires patched HttpUnit to compile
form
- the form.
public java.util.List getPostButtonId(com.meterware.httpunit.WebForm form)
form
- the form.
public java.util.List getPostButtonIndices(com.meterware.httpunit.WebForm form)
form
- the form.
public java.util.List getPostLinkIds(com.meterware.httpunit.HTMLSegment page) throws org.xml.sax.SAXException
page
- the page.
org.xml.sax.SAXException
- if page traversal fails.public java.util.List getPostLinkTexts(com.meterware.httpunit.HTMLSegment page) throws org.xml.sax.SAXException
page
- the page.
org.xml.sax.SAXException
- if page traversal fails.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |