com.canoo.webtest.steps.request
Class TargetHelper
java.lang.Object
com.canoo.webtest.steps.request.TargetHelper
- All Implemented Interfaces:
- Serializable
public class TargetHelper
- extends Object
- implements Serializable
This is a helper class for all test specification steps
that initiate a request.
It offers common functionality like:
preparing the request in case basic authentication is required,
handling http error scenarios,
reporting and saving away the response if successful.
- Author:
- Carsten Seibert, Marc Guillemot, Paul King
- See Also:
- Serialized Form
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CONNECTION_INITIALIZER_KEY
public static final String CONNECTION_INITIALIZER_KEY
- See Also:
- Constant Field Values
TargetHelper
public TargetHelper(AbstractBrowserAction step)
setUsername
public void setUsername(String userName)
setPassword
public void setPassword(String password)
getResponse
public com.gargoylesoftware.htmlunit.Page getResponse(Context context,
String strUrl)
throws IOException,
SAXException
- Hook for test stubs in order to avoid invocation of a real request
- Parameters:
context - The current test context.strUrl - The URL to invoke.
- Throws:
IOException
SAXException
getResponse
public com.gargoylesoftware.htmlunit.Page getResponse(Context context,
com.gargoylesoftware.htmlunit.WebRequest settings)
throws IOException,
SAXException
- Throws:
IOException
SAXException
prepareConversationIfNeeded
protected void prepareConversationIfNeeded(Context context)
- Prepare the specified WebConversation for a request by setting
user and password (if specified) and install a custom HostnameVerifier
if required by the currently used protocol.
- Parameters:
context - The current test context.
invokeCustomInitializer
protected void invokeCustomInitializer(Context context,
String customInitializerClassName)