|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface TransactionStep
Aggregate information about a particular step in the script. This object contains basic timing information, such as the start and end time, as well as the total number of bytes transferred during this step.
Method Summary | |
---|---|
long |
getBytes()
The total number of bytes received via HTTP requests while this step was active. |
java.util.Date |
getEnd()
Returns the time the step ended, or null if the step has not yet ended. |
TransactionStepObject |
getFirstObject()
Finds the first (chronologically ordered) object associated with this step, or null if there are no objects. |
TransactionStepObject |
getLastObject()
Finds the last (chronologically ordered) object associated with this step, or null if there are no objects. |
java.util.List<TransactionStepObject> |
getObjects()
Returns all objects associated with this step, or an empty list of no objects are. |
java.util.Date |
getStart()
Returns the time the step started. |
long |
getStepTimeout()
Returns the step timeout in milliseconds. |
long |
getTimeActive()
The time spent actively running the script, such as spent waiting for a page to finish loading. |
long |
getTimePaused()
The time spent actively paused due to an explicit call to pause() by the script author. |
java.lang.String |
put(java.lang.String name,
java.lang.String value)
Associates a generic name/value pair with this step. |
void |
setBytes(long bytes)
Set the total number of bytes received while this step was active. |
void |
setStepTimeout(long timeoutInMilliseconds)
Set the timeout, in milliseconds, that the step is allowed to run. |
void |
setTimeActive(long timeActive)
Sets the time you want recorded for the step. |
void |
setTimePaused(long timePaused)
Sets the time spent actively paused. |
void |
verifyItemDownload(java.lang.String url)
Verify that the given url matches a downloaded item. |
void |
verifyItemDownloadRegex(java.lang.String regex)
Verify that the given regex matches a downloaded item. |
Method Detail |
---|
java.lang.String put(java.lang.String name, java.lang.String value)
name
- the unique name of the name/value pairvalue
- the value to be stored
java.util.Date getStart()
java.util.Date getEnd()
long getBytes()
void setBytes(long bytes)
bytes
- the number of bytes received.long getTimePaused()
void setTimePaused(long timePaused)
timePaused
- the time, in milliseconds, that this step was paused.long getTimeActive()
TransactionStepObject getFirstObject()
getLastObject()
to determine the total time spent downloading objects for the step.
TransactionStepObject getLastObject()
getFirstObject()
to determine the total time spent downloading objects for the step.
java.util.List<TransactionStepObject> getObjects()
void setStepTimeout(long timeoutInMilliseconds)
timeoutInMilliseconds
- the maximum time, in milliseconds, that this step is allowed to run before the
transaction errors out.long getStepTimeout()
void setTimeActive(long timeActive)
timeActive
- the time, in milliseconds, that this step was actively running.void verifyItemDownload(java.lang.String url) throws java.lang.Exception
For example:
var driver = test.openBrowser(); test.beginTransaction(); var step = test.beginStep("verifyDownload"); driver.get("http://cdn.doubleverify.com/monitor/Webmetrics/BS_2.0_Mon-NonSSL.html"); test.waitForNetworkTrafficToStop(30000, 30000); step.verifyItemDownload("http://cdn.doubleverify.com/monitor/Webmetrics/BS_2.0_Mon-NonSSL.html") step.verifyItemDownload("http://cdn.doubleverify.com/monitor/Webmetrics/300x250.jpg") test.endStep(); test.endTransaction();
url
- the url to be verified
java.lang.Exception
- when url cannot be found from list of downloaded items.void verifyItemDownloadRegex(java.lang.String regex) throws java.lang.Exception
For example:
var driver = test.openBrowser(); test.beginTransaction(); var step = test.beginStep("verifyDownload"); driver.get("http://cdn.doubleverify.com/monitor/Webmetrics/BS_2.0_Mon-NonSSL.html"); test.waitForNetworkTrafficToStop(30000, 30000); step.verifyItemDownloadRegex("http://cdn\.doubleverify\.com/monitor/Web.*") step.verifyItemDownloadRegex("http://cdn\.doubleverify\.com/monitor/Webmetrics/300x250\..{3}") test.endStep(); test.endTransaction();Only a partial match is required. E.g. the following:
r.verifyItemDownloadRegex("http://www\.neu.*");will succeed for both "http://www.neustar.biz/index.htm" and "http://www.neumarkt.de/index.php"
regex
- the regular expression to be matched
java.lang.Exception
- when url cannot be found from list of downloaded items.
|
© 2023 Vercara, LLC. All Rights Reserved. | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |