com.appperfect.devcommon.script
Interface IParameterHandler

All Known Subinterfaces:
IScriptEngine

public interface IParameterHandler

IParameterHandler is created to assist with fetching parameter values from TestParameter


Field Summary
static int Contains
  
static int EndsWith
  
static int Equals
  
static int GreaterThan
  
static int GreaterThanEqualTo
  
static int LessThan
  
static int LessThanEqualTo
  
static int Matches
  
static int NotContains
  
static int NotEndsWith
  
static int NotEquals
  
static int NotMatches
  
static int NotStartsWith
  
static int StartsWith
  
 
Method Summary
 boolean assertTestParameterValue(java.lang.String operand1, int compOperator, java.lang.String operand2)
 To compare the TestParameter value with other TestParameter value / constant
 java.lang.String getParameterValue(java.lang.String name, java.lang.String value, java.lang.String parameterName)
 To get Test Parameter value for parameterized Header or Task Parameter
 java.lang.String getParameterValue(java.lang.String name, java.lang.String value, java.lang.String parameterName, boolean forValidation)
 To get Test Parameter value for parameterized Header or Task Parameter
 java.lang.String[] getParameterValueByParsing(HtmlPage htmlPage, java.lang.String leftBoundary, java.lang.String rightBoundary)
 To get Parameter value by parsing the response and fetching the value between left and right boundary
 java.lang.String[] getParameterValueByParsing(java.lang.String htmlPage, java.lang.String leftBoundary, java.lang.String rightBoundary)
 To get Parameter value by parsing the response and fetching the value between left and right boundary
 java.lang.String[] getParameterValueForPattern(java.lang.String htmlPage, java.lang.String regexPattern, java.lang.String groupIndices)
 To get the Parameter values by applying the specified pattern on the response
 

Field Detail

Contains

static final int Contains
See Also:
Constant Field Values

EndsWith

static final int EndsWith
See Also:
Constant Field Values

Equals

static final int Equals
See Also:
Constant Field Values

GreaterThan

static final int GreaterThan
See Also:
Constant Field Values

GreaterThanEqualTo

static final int GreaterThanEqualTo
See Also:
Constant Field Values

LessThan

static final int LessThan
See Also:
Constant Field Values

LessThanEqualTo

static final int LessThanEqualTo
See Also:
Constant Field Values

Matches

static final int Matches
See Also:
Constant Field Values

NotContains

static final int NotContains
See Also:
Constant Field Values

NotEndsWith

static final int NotEndsWith
See Also:
Constant Field Values

NotEquals

static final int NotEquals
See Also:
Constant Field Values

NotMatches

static final int NotMatches
See Also:
Constant Field Values

NotStartsWith

static final int NotStartsWith
See Also:
Constant Field Values

StartsWith

static final int StartsWith
See Also:
Constant Field Values
Method Detail

assertTestParameterValue

boolean assertTestParameterValue(java.lang.String operand1,
                                 int compOperator,
                                 java.lang.String operand2)
To compare the TestParameter value with other TestParameter value / constant

Parameters:
operand1 - String containing TestParameter Name or constant, if its TestParameter enclose it in "@..@"
compOperator - could take any of the following values : engine.Equals engine.NotEquals engine.Contains engine.NotContains engine.StartsWith engine.NotStartsWith engine.EndsWith engine.NotEndsWith engine.GreaterThan engine.LessThan engine.GreaterThanEqualTo engine.LessThanEqualTo engine.Matches engine.NotMatches
operand2 - String containing TestParameter Name or constant, if its TestParameter enclose it in "@..@"
Returns:
true/false depending on operator evaluation on two operands

getParameterValue

java.lang.String getParameterValue(java.lang.String name,
                                   java.lang.String value,
                                   java.lang.String parameterName)
To get Test Parameter value for parameterized Header or Task Parameter

Parameters:
name - of the task parameter
value - recorded value of the parameter
parameterName - name of the test parameter
Returns:
value of the test parameter

getParameterValue

java.lang.String getParameterValue(java.lang.String name,
                                   java.lang.String value,
                                   java.lang.String parameterName,
                                   boolean forValidation)
To get Test Parameter value for parameterized Header or Task Parameter

Parameters:
name - of the task parameter
value - recorded value of the parameter
parameterName - name of the test parameter
forValidation - to indicate whether the test parameter is used in validation before the execution of the task
Returns:
value of the test parameter

getParameterValueByParsing

java.lang.String[] getParameterValueByParsing(HtmlPage htmlPage,
                                              java.lang.String leftBoundary,
                                              java.lang.String rightBoundary)
To get Parameter value by parsing the response and fetching the value between left and right boundary

Parameters:
htmlPage - html page, instance of com.gargoylesoftware.htmlunit.html.HtmlPage
leftBoundary - left boundary to look for while searching the enclosed value
rightBoundary - right boundary to look for while searching the enclosed value
Returns:
array of resolved values, null if not found

getParameterValueByParsing

java.lang.String[] getParameterValueByParsing(java.lang.String htmlPage,
                                              java.lang.String leftBoundary,
                                              java.lang.String rightBoundary)
To get Parameter value by parsing the response and fetching the value between left and right boundary

Parameters:
htmlPage - html source string
leftBoundary - left boundary to look for while searching the enclosed value
rightBoundary - right boundary to look for while searching the enclosed value
Returns:
array of resolved values, null if not found

getParameterValueForPattern

java.lang.String[] getParameterValueForPattern(java.lang.String htmlPage,
                                               java.lang.String regexPattern,
                                               java.lang.String groupIndices)
To get the Parameter values by applying the specified pattern on the response

Parameters:
htmlPage - html source string
regexPattern - should be a valid regular expression
groupIndices - its a comma separated list of group indices in the pattern. In case value is to be created using multiple groups in the pattern then comma separated indices for same should be provided here. In case there is a single group in the pattern then value specified should be 1. In case there are no groups in the pattern then specified value should be 0 in which case extracted value will be the one returned on applying pattern.
Returns:
array of resolved values, null if not found


Copyright © 2003-2016 AppPerfect Corporation. All Rights Reserved.