|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.canoo.webtest.engine.Context
public class Context
Represents context information for a webtest.
| Field Summary | |
|---|---|
static String |
KEY_DEFAULT_WEBCLIENTCONTEXT
The name identifiying the default WebClientContext that is the current one at test startup. |
| Constructor Summary | |
|---|---|
Context(WebtestTask webtest)
|
|
| Method Summary | |
|---|---|
boolean |
containsKey(String key)
|
WebClientContext |
defineCurrentWebClientContext(String name)
Defines the current WebClientContext creating it if none was previously registered
under this name. |
Object |
get(String key)
|
com.gargoylesoftware.htmlunit.ScriptException |
getBackgroundJSError()
Gets the last background JS exception (if any). |
Configuration |
getConfig()
Shortcut method to get the configuration of the |
com.gargoylesoftware.htmlunit.html.HtmlForm |
getCurrentForm()
Delegates to current WebClientContext |
com.gargoylesoftware.htmlunit.html.HtmlPage |
getCurrentHtmlResponse(Step step)
/** Delegates to current WebClientContext |
com.gargoylesoftware.htmlunit.Page |
getCurrentResponse()
Delegates to current WebClientContext |
String |
getCurrentResponseFile()
Delegates to current WebClientContext |
int |
getCurrentStepNumber()
|
WebClientContext |
getCurrentWebClientContext()
Gets the currently active WebClientContext. |
int |
getNumberOfSteps()
|
WebClientContext.StoredResponses |
getResponses()
Delegates to current WebClientContext |
ResetScriptRunner |
getRunner()
|
String |
getSavedPassword()
Delegates to current WebClientContext |
String |
getSavedUserName()
Delegates to current WebClientContext |
com.gargoylesoftware.htmlunit.WebClient |
getWebClient()
Delegates to current WebClientContext |
Map<String,WebClientContext> |
getWebClientContexts()
Gets the currently available WebClientContext |
WebtestTask |
getWebtest()
Gets the <webtest> for this context. |
XPathHelper |
getXPathHelper()
Gets the XPath helper used for this test. |
void |
increaseStepNumber()
|
boolean |
isPrepared()
|
void |
put(String key,
Object value)
|
void |
remove(String key)
|
void |
restorePreviousResponse()
Delegates to current WebClientContext |
void |
restoreResponses(WebClientContext.StoredResponses savedResponses)
Delegates to current WebClientContext |
void |
restoreWindowListener()
Delegates to current WebClientContext |
void |
saveResponseAsCurrent(com.gargoylesoftware.htmlunit.Page page)
Delegates to current WebClientContext |
void |
setBackgroundJSError(com.gargoylesoftware.htmlunit.ScriptException e)
Sets the last background JS exception. |
void |
setCurrentForm(com.gargoylesoftware.htmlunit.html.HtmlForm form)
Delegates to current WebClientContext |
void |
setPrepared(boolean prepared)
|
void |
setRunner(ResetScriptRunner sr)
|
void |
setSavedPassword(String password)
Delegates to current WebClientContext |
void |
setSavedUserName(String userName)
Delegates to current WebClientContext |
void |
setWebClient(com.gargoylesoftware.htmlunit.WebClient webClient)
Delegates to current WebClientContext |
void |
suspendWindowListener()
Delegates to current WebClientContext |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String KEY_DEFAULT_WEBCLIENTCONTEXT
WebClientContext that is the current one at test startup.
| Constructor Detail |
|---|
public Context(WebtestTask webtest)
| Method Detail |
|---|
public boolean containsKey(String key)
public Object get(String key)
public Configuration getConfig()
WebtestTaskpublic com.gargoylesoftware.htmlunit.html.HtmlForm getCurrentForm()
WebClientContext
getCurrentWebClientContext(),
WebClientContext.getCurrentForm()public com.gargoylesoftware.htmlunit.html.HtmlPage getCurrentHtmlResponse(Step step)
WebClientContext
getCurrentWebClientContext(),
WebClientContext.getCurrentHtmlResponse(Step)public com.gargoylesoftware.htmlunit.Page getCurrentResponse()
WebClientContext
getCurrentWebClientContext(),
WebClientContext.getCurrentResponse()public String getCurrentResponseFile()
WebClientContext
getCurrentResponseFile(),
WebClientContext.getCurrentResponseFile()public int getCurrentStepNumber()
public WebClientContext getCurrentWebClientContext()
WebClientContext.
public int getNumberOfSteps()
public Map<String,WebClientContext> getWebClientContexts()
WebClientContext
WebClientContext)public WebClientContext defineCurrentWebClientContext(String name)
WebClientContext creating it if none was previously registered
under this name.
name - the name of the WebClientContext to activate.
The default WebClientContext is registered under the key KEY_DEFAULT_WEBCLIENTCONTEXT.
public WebClientContext.StoredResponses getResponses()
WebClientContext
getCurrentWebClientContext(),
WebClientContext.getResponses()public ResetScriptRunner getRunner()
public String getSavedPassword()
WebClientContext
getCurrentWebClientContext(),
WebClientContext.getSavedPassword()public String getSavedUserName()
WebClientContext
getCurrentWebClientContext(),
WebClientContext.getSavedUserName()public com.gargoylesoftware.htmlunit.WebClient getWebClient()
WebClientContext
getCurrentWebClientContext(),
WebClientContext.getWebClient()public WebtestTask getWebtest()
public XPathHelper getXPathHelper()
public void increaseStepNumber()
public boolean isPrepared()
public void put(String key,
Object value)
public void remove(String key)
public void restorePreviousResponse()
WebClientContext
getCurrentWebClientContext(),
WebClientContext.restorePreviousResponse()public void restoreResponses(WebClientContext.StoredResponses savedResponses)
WebClientContext
getCurrentWebClientContext(),
WebClientContext.restoreResponses(com.canoo.webtest.engine.WebClientContext.StoredResponses)public void restoreWindowListener()
WebClientContext
getCurrentWebClientContext(),
WebClientContext.restoreWindowListener()public void saveResponseAsCurrent(com.gargoylesoftware.htmlunit.Page page)
WebClientContext
getCurrentWebClientContext(),
WebClientContext.saveResponseAsCurrent(Page)public void setCurrentForm(com.gargoylesoftware.htmlunit.html.HtmlForm form)
WebClientContext
getCurrentWebClientContext(),
WebClientContext.setCurrentForm(HtmlForm)public void setPrepared(boolean prepared)
public void setRunner(ResetScriptRunner sr)
public void setSavedPassword(String password)
WebClientContext
getCurrentWebClientContext(),
WebClientContext.setSavedPassword(String)public void setSavedUserName(String userName)
WebClientContext
getCurrentWebClientContext(),
WebClientContext.setSavedUserName(String)public void setWebClient(com.gargoylesoftware.htmlunit.WebClient webClient)
WebClientContext
getCurrentWebClientContext(),
WebClientContext.setWebClient(WebClient)public void suspendWindowListener()
WebClientContext
getCurrentWebClientContext(),
WebClientContext.suspendWindowListener()public com.gargoylesoftware.htmlunit.ScriptException getBackgroundJSError()
null (unless a new error occurs)
public void setBackgroundJSError(com.gargoylesoftware.htmlunit.ScriptException e)
|
Copyright © 2001-2007 Canoo Engineering AG, Basel. All rights reserved. | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||