com.appperfect.devcommon.script.web
Interface IHTTPScript

All Superinterfaces:
IScript
All Known Subinterfaces:
IUrl

public interface IHTTPScript
extends IScript

A request object which can be executed by IScriptEngine.execute(request) method.

An object of this class is created using createGetRequest or createPostRequest method of IScriptEngine. Once the object is created, it should be populated as per the requirements of the HTTP protocol and then executed using IScriptEngine.


Method Summary
 boolean assertBrokenLinks(java.lang.String description)
 Once the IHTTPScript task is executed, the response page can be validated for broken links using this method
 boolean assertFormCount(java.lang.String description, int count)
 Once the task is executed, no of forms in the response can be validated using this method
 boolean assertImage(java.lang.String description, java.lang.String nodePath, java.lang.String recordedImagePath)
 Once the task is executed, text of the node in the DOM tree of the response data can be validated.
 boolean assertImageCount(java.lang.String description, int count)
 Once the task is executed, no of images in the response can be validated using this method
 boolean assertInDatabase(java.lang.String description, java.lang.String databaseId, java.lang.String query)
 Once the task is executed, database can be validated by firing the specified SELECT query
 boolean assertInputElementCount(java.lang.String description, int count)
 Once the task is executed, no of input elements in the response can be validated using this method
 boolean assertLinkCount(java.lang.String description, int count)
 Once the task is executed, no of links in the response can be validated using this method
 boolean assertNodeAttributeValue(java.lang.String description, java.lang.String nodePath, java.lang.String attributeName, java.lang.String attributeValue)
 Once the task is executed, attributes of the node in the DOM tree of the response data can be validated.
 boolean assertNodeText(java.lang.String description, java.lang.String nodePath, java.lang.String text)
 Once the task is executed, text of the node in the DOM tree of the response data can be validated.
 boolean assertPage(java.lang.String description)
 Once the IHTTPScript task is executed, the response page can be validated using this method
 boolean assertPageSize(java.lang.String description, long sizeInBytes)
 Once the task is executed, size of the response can be validated using this method
 boolean assertPageText(java.lang.String description)
 Once the IHTTPScript task is executed, the response page can be validated using this method
 boolean assertText(java.lang.String description, java.lang.String[] txt, boolean bCaseSensitive, boolean contains, boolean bAll, boolean checkForExistance, boolean regularExpression)
 Once the task is executed, response can be validated for presence/absence of some text along with other attributes for fine-tuning the search
 boolean assertText(java.lang.String description, java.lang.String[] txt, boolean bCaseSensitive, boolean contains, boolean bAll, boolean checkForExistance, boolean regularExpression, java.lang.String prefix, java.lang.String suffix)
 Once the task is executed, response can be validated for presence/absence of some text along with other attributes for fine-tuning the search
 boolean assertText(java.lang.String description, java.lang.String txt, boolean bCaseSensitive)
 Once the task is executed, response can be validated for presence/absence of some text along with other attributes for fine-tuning the search
 boolean assertText(java.lang.String description, java.lang.String txt, boolean bCaseSensitive, boolean checkForExistance, boolean regularExpression)
 Once the task is executed, response can be validated for presence/absence of some text along with other attributes for fine-tuning the search
 boolean assertText(java.lang.String description, java.lang.String txt, boolean bCaseSensitive, boolean checkForExistance, boolean regularExpression, java.lang.String prefix, java.lang.String suffix)
 Once the task is executed, response can be validated for presence/absence of some text along with other attributes for fine-tuning the search
 boolean assertTodaysDate(java.lang.String description, java.lang.String dateFormat)
 Once the task is executed, response can be validated to contain today's date in specified format
 boolean assertTodaysDate(java.lang.String description, java.lang.String dateFormat, java.lang.String prefix, java.lang.String suffix)
 Once the task is executed, response can be validated to contain today's date in specified format
 java.lang.String getResponse()
 After task execution the response page can be fetched using this method
 int getResponseCode()
 Get Response Code as a result of task execution
 long getResponseSize()
 After task execution the size of response can be fetched using this method
 long getResponseTime()
 Get the response time of executed task
 IValidationResult getValidationResult()
 Once the task is executed, detailed validation result can be fetched using this method.
 HtmlPage getWebResponse()
 After task execution the response page can be fetched using this method
 boolean isValidationSuccessful()
 Once the task is executed, this method returns the status of the validation carried out
 void setValidationSuccessful(boolean success)
 Once the task is executed, this method can be used to set the status of validation
 
Methods inherited from interface com.appperfect.devcommon.script.IScript
getReasonForFailure, isIgnored, isTaskSuccessful, isTaskTimedOut, setIgnored, setReasonForFailure, setTaskSuccessful, setTaskTimedout, setThinkTime, setTimeout
 

Method Detail

assertBrokenLinks

boolean assertBrokenLinks(java.lang.String description)
Once the IHTTPScript task is executed, the response page can be validated for broken links using this method

Parameters:
description - of validation
Returns:
true if there are no broken links on the page; false otherwise

assertFormCount

boolean assertFormCount(java.lang.String description,
                        int count)
Once the task is executed, no of forms in the response can be validated using this method

Parameters:
description - of validation
count - expected no of forms in the response
Returns:
true if the number of forms matches count; false otherwise

assertImage

boolean assertImage(java.lang.String description,
                    java.lang.String nodePath,
                    java.lang.String recordedImagePath)
Once the task is executed, text of the node in the DOM tree of the response data can be validated.

Parameters:
description - of validation
nodePath - path of the node in the DOM tree of the response data
recordedImagePath - recorded image path
Returns:
true if the response matches this validation; false otherwise

assertImageCount

boolean assertImageCount(java.lang.String description,
                         int count)
Once the task is executed, no of images in the response can be validated using this method

Parameters:
description - of validation
count - expected no of images in the response
Returns:
true if the number of images matches count; false otherwise

assertInDatabase

boolean assertInDatabase(java.lang.String description,
                         java.lang.String databaseId,
                         java.lang.String query)
Once the task is executed, database can be validated by firing the specified SELECT query

Parameters:
description - of validation
databaseId - database id configured with the application in Tools->Options
query - SQL query to be fired to the given database id
Returns:
true if the query return non-empty ResultSet; false otherwise

assertInputElementCount

boolean assertInputElementCount(java.lang.String description,
                                int count)
Once the task is executed, no of input elements in the response can be validated using this method

Parameters:
description - of validation
count - expected no of input elements in the response
Returns:
true if the number of input elements matches count; false otherwise

assertLinkCount

boolean assertLinkCount(java.lang.String description,
                        int count)
Once the task is executed, no of links in the response can be validated using this method

Parameters:
description - of validation
count - expected no of links in the response
Returns:
true if the number of links matches count; false otherwise

assertNodeAttributeValue

boolean assertNodeAttributeValue(java.lang.String description,
                                 java.lang.String nodePath,
                                 java.lang.String attributeName,
                                 java.lang.String attributeValue)
Once the task is executed, attributes of the node in the DOM tree of the response data can be validated.

Parameters:
description - of validation
nodePath - path of the node in the DOM tree of the response data
attributeName - name of the attribute
attributeValue - value of the attribute
Returns:
true if the response matches this validation; false otherwise

assertNodeText

boolean assertNodeText(java.lang.String description,
                       java.lang.String nodePath,
                       java.lang.String text)
Once the task is executed, text of the node in the DOM tree of the response data can be validated.

Parameters:
description - of validation
nodePath - path of the node in the DOM tree of the response data
text - visible text of the node
Returns:
true if the response matches this validation; false otherwise

assertPage

boolean assertPage(java.lang.String description)
Once the IHTTPScript task is executed, the response page can be validated using this method

Parameters:
description - of validation
Returns:
true if the response matches with the recorded page; false otherwise

assertPageSize

boolean assertPageSize(java.lang.String description,
                       long sizeInBytes)
Once the task is executed, size of the response can be validated using this method

Parameters:
description - of validation
sizeInBytes - expected size of the response in bytes
Returns:
true if the size of response matches sizeInBytes; false otherwise

assertPageText

boolean assertPageText(java.lang.String description)
Once the IHTTPScript task is executed, the response page can be validated using this method

Parameters:
description - of validation
Returns:
true if the response matches with the recorded page; false otherwise

assertText

boolean assertText(java.lang.String description,
                   java.lang.String[] txt,
                   boolean bCaseSensitive,
                   boolean contains,
                   boolean bAll,
                   boolean checkForExistance,
                   boolean regularExpression)
Once the task is executed, response can be validated for presence/absence of some text along with other attributes for fine-tuning the search

Parameters:
description - of validation
txt - list of text to look for in the response
bCaseSensitive - true if search should be case-sensitive; false otherwise
contains - true if search for existence of the text; false otherwise
bAll - true if search for all the elements of the list; false for any element of the list
regularExpression - true if text is a regular expression; false otherwise
Returns:
true if the response matches this validation; false otherwise

assertText

boolean assertText(java.lang.String description,
                   java.lang.String[] txt,
                   boolean bCaseSensitive,
                   boolean contains,
                   boolean bAll,
                   boolean checkForExistance,
                   boolean regularExpression,
                   java.lang.String prefix,
                   java.lang.String suffix)
Once the task is executed, response can be validated for presence/absence of some text along with other attributes for fine-tuning the search

Parameters:
description - of validation
txt - list of text to look for in the response
bCaseSensitive - true if search should be case-sensitive; false otherwise
contains - true if search for existence of the text; false otherwise
bAll - true if search for all the elements of the list; false for any element of the list
regularExpression - true if text is a regular expression; false otherwise
prefix - text present before the txt
suffix - text present after the txt
Returns:
true if the response matches this validation; false otherwise

assertText

boolean assertText(java.lang.String description,
                   java.lang.String txt,
                   boolean bCaseSensitive)
Once the task is executed, response can be validated for presence/absence of some text along with other attributes for fine-tuning the search

Parameters:
description - of validation
txt - text to look for in the response
bCaseSensitive - true if search should be case-sensitive; false otherwise
Returns:
true if the response matches this validation; false otherwise

assertText

boolean assertText(java.lang.String description,
                   java.lang.String txt,
                   boolean bCaseSensitive,
                   boolean checkForExistance,
                   boolean regularExpression)
Once the task is executed, response can be validated for presence/absence of some text along with other attributes for fine-tuning the search

Parameters:
description - of validation
txt - text to look for in the response
bCaseSensitive - true if search should be case-sensitive; false otherwise
checkForExistance - true if search for existence of the text; false otherwise
regularExpression - true if text is a regular expression; false otherwise
Returns:
true if the response matches this validation; false otherwise

assertText

boolean assertText(java.lang.String description,
                   java.lang.String txt,
                   boolean bCaseSensitive,
                   boolean checkForExistance,
                   boolean regularExpression,
                   java.lang.String prefix,
                   java.lang.String suffix)
Once the task is executed, response can be validated for presence/absence of some text along with other attributes for fine-tuning the search

Parameters:
description - of validation
txt - text to look for in the response
bCaseSensitive - true if search should be case-sensitive; false otherwise
checkForExistance - true if search for existence of the text; false otherwise
regularExpression - true if text is a regular expression; false otherwise
prefix - text present before the txt
suffix - text present after the txt
Returns:
true if the response matches this validation; false otherwise

assertTodaysDate

boolean assertTodaysDate(java.lang.String description,
                         java.lang.String dateFormat)
Once the task is executed, response can be validated to contain today's date in specified format

Parameters:
description - of validation
dateFormat - valid date format
Returns:
true if the response matches this validation; false otherwise

assertTodaysDate

boolean assertTodaysDate(java.lang.String description,
                         java.lang.String dateFormat,
                         java.lang.String prefix,
                         java.lang.String suffix)
Once the task is executed, response can be validated to contain today's date in specified format

Parameters:
description - of validation
dateFormat - valid date format
prefix - text present before the date
suffix - text present after the date
Returns:
true if the response matches this validation; false otherwise

getResponse

java.lang.String getResponse()
After task execution the response page can be fetched using this method

Returns:
response page in String form as a result of task execution.

getResponseCode

int getResponseCode()
Get Response Code as a result of task execution

Returns:
Response Code

getResponseSize

long getResponseSize()
After task execution the size of response can be fetched using this method

Returns:
response size in bytes as a result of task execution.

getResponseTime

long getResponseTime()
Get the response time of executed task

Returns:
the response time of executed task

getValidationResult

IValidationResult getValidationResult()
Once the task is executed, detailed validation result can be fetched using this method.

Returns:
validation result

getWebResponse

HtmlPage getWebResponse()
After task execution the response page can be fetched using this method

Returns:
HTMLPage instance as a result of task execution.

isValidationSuccessful

boolean isValidationSuccessful()
Once the task is executed, this method returns the status of the validation carried out

Returns:
true if the validation was successful; false otherwise

setValidationSuccessful

void setValidationSuccessful(boolean success)
Once the task is executed, this method can be used to set the status of validation

Parameters:
success - true if the validation is successful; false otherwise


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