biz.neustar.wpm.api
Interface WebBot.Response

Enclosing interface:
WebBot

public static interface WebBot.Response

The list of responses made during an execute() request.


Method Summary
 void errorString(java.lang.String text)
          Verify that the given text is not present in the response body of any of the requests made.
 void errorStringRegex(java.lang.String regex)
          Verify that the given regex does not match the response body of any of the requests made.
 long getLoadTime()
          Get the overall load time in milliseconds for all the resources downloaded
 HttpResponse getResponse()
          The first HttpResponse received.
 HttpResponse[] getResponses()
          The list of all HttpResponse received.
 void searchString(java.lang.String text)
          Verify that the given string is present in the response body of any of the requests made.
 void searchStringRegex(java.lang.String regex)
          Verify that the given regex matches the response body of at least one of the requests made.
 

Method Detail

getResponse

HttpResponse getResponse()
The first HttpResponse received.

Returns:
the first http response received

getResponses

HttpResponse[] getResponses()
The list of all HttpResponse received.

Returns:
a list of all http responses received

getLoadTime

long getLoadTime()
Get the overall load time in milliseconds for all the resources downloaded

Returns:
the load time in milliseconds for all item resources

searchString

void searchString(java.lang.String text)
Verify that the given string is present in the response body of any of the requests made.

Parameters:
text - the text to verify

errorString

void errorString(java.lang.String text)
Verify that the given text is not present in the response body of any of the requests made.

Parameters:
text - the text to verify does not exist on the page

searchStringRegex

void searchStringRegex(java.lang.String regex)
Verify that the given regex matches the response body of at least one of the requests made.

Only a partial match is required. E.g. the following will succeed if the response has the text 'search' anywhere in the body:

     r.searchStringRegex("search");
 

Parameters:
regex - the regex to search for

errorStringRegex

void errorStringRegex(java.lang.String regex)
Verify that the given regex does not match the response body of any of the requests made.

Only a partial match is required. E.g. the following will succeed if the response does not have the text 'error' in the body:

     r.errorStringRegex("error");
 

Parameters:
regex - the regex to verify that it doesn't exist on the page

Copyright © 2020 Neustar, Inc. All Rights Reserved.