The VirtualUserScript type exposes the following members.
Back to Top
Back to Top
Back to Top
Back to Top
Constructors
Name | Description | |
---|---|---|
VirtualUserScript | Initializes a new instance of the VirtualUserScript class |
Methods
Name | Description | |
---|---|---|
AcceptCancellation |
Called to accept the script response to the requested cancellation. It means this script would have ScriptStatus.Canceleld when afterwards.
If this method is not called and the scipt is successefuly finished, then the status of the script is ScriptStatus.RanToCompletion
| |
Add |
Merges the specified IDataDictionary into this IDataDictionary.
| |
ClearProgressPoint |
Clears the current progress point set for this Virtual User.
| |
CreateBackgroundScript |
Creates a new background script and starts it if requested.
| |
EndRequest |
For internal use only.
| |
EndTiming(String) |
Writes an end timing event to the VU event log.
| |
EndTiming(String, Boolean) |
Writes an end timing event to the VU event log, specifying whether the timing passed.
| |
EndTransaction |
Writes an end transaction event to the VU event log, specifying whether the transaction passed,
and specifying a tag which appears in the Info column.
| |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
Error(Exception) |
Writes an error message to the VU event log, which will consist of the details of the specified Exception.
| |
Error(String) |
Writes an error message to the VU event log.
| |
Error(String, Exception) |
Writes an error message to the VU event log, which will include the stack trace of the specified Exception.
| |
Error(String, String) |
Writes an error message to the VU event log, specifying an identifier which appears in the ID column.
| |
Error(String, String, String) |
Writes an error message and an image link to the VU event log, specifying an identifier which appears in the ID column.
| |
ExitVU |
Stops execution of this Virtual User.
| |
ExitVU(Boolean) |
Stops execution of this Virtual User, specifying whether the script completed successfully.
| |
ExitVU(String, Boolean) |
Stops execution of this Virtual User, specifying whether the script completed successfully and a message to display at the end of the event log.
| |
Fail |
Writes a fail event to the VU event log.
| |
FailTiming |
Writes a fail timing event to the VU event log.
| |
FailTransaction(String) |
Writes a fail transaction event to the VU event log.
| |
FailTransaction(String, String) |
Writes a fail transaction event to the VU event log, specifying a tag which appears in the Info column.
| |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
FinalSequence |
Stops execution of the current script and then executes the scripts in the final section of the current workflow.
| |
FinishIterating |
Prevents further iterations of the iterated sequence of scripts for this Virtual User.
| |
FlushEventLog |
Flushes the event log to disk.
| |
FormatDateTime |
Converts a DateTime object to its equivalent string representation using the specified format.
| |
Get(String) |
Returns a reference to an object held in the dictionary.
| |
Get(String, Object) |
Returns an object value held in the dictionary, or the defaultValue if the key cannot be found.
| |
Get T (String) |
Returns a reference to an object held in the dictionary.
| |
Get T (String, T) |
Returns a reference to an object held in the dictionary.
| |
GetBackgroundScriptStatus |
Returns a status of the given background script
| |
GetBoolean(String) |
Returns a boolean value held in the dictionary.
| |
GetBoolean(String, Boolean) |
Returns a boolean value held in the dictionary, or the defaultValue if the key cannot be found.
| |
GetDataDictionary |
Gets the Data Dictionary named with the specified key and assigned to the Virtual User in eggPlant Performance Studio.
| |
GetDataTable |
Gets the specified Data Table.
| |
GetDouble(String) |
Returns a double value held in the dictionary.
| |
GetDouble(String, Double) |
Returns a double value held in the dictionary, or the defaultValue if the key cannot be found.
| |
GetEnumerator |
Gets an enumerator for iterating over the key/value pairs in this dictionary.
| |
GetFloat(String) |
Returns a float value held in the dictionary.
| |
GetFloat(String, Single) |
Returns a float value held in the dictionary, or the defaultValue if the key cannot be found.
| |
GetGroupSize |
Gets the number of Virtual Users in the specified Virtual User group.
| |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetInt(String) |
Returns an int value held in the dictionary.
| |
GetInt(String, Int32) |
Returns an int value held in the dictionary, or the defaultValue if the key cannot be found.
| |
GetList(String) |
Returns an ArrayList value held in the dictionary.
| |
GetList(String, ArrayList) |
Returns an ArrayList value held in the dictionary, or the defaultList if the key cannot be found.
| |
GetLong(String) |
Returns a long value held in the dictionary.
| |
GetLong(String, Int64) |
Returns a long value held in the dictionary, or the defaultValue if the key cannot be found.
| |
GetMillisecondsSinceEpoch |
Get the number of milliseconds since the epoch (1st Jan 1970), offset by the specified number of milliseconds
| |
GetSecondsSinceEpoch |
Get the number of seconds since the epoch (1st Jan 1970), offset by the specified number of seconds
| |
GetService T |
Get a Service object of the given type.
| |
GetString(String) |
Returns a string value held in the dictionary.
| |
GetString(String, String) |
Returns a string value held in the dictionary, or the defaultValue if the key cannot be found.
| |
GetTimingElapsedTime |
Gets the elapsed time of the current active timing.
| |
GetTransactionData |
Get data about the specified transaction.
| |
GetTransactionElapsedTime |
Gets the current elapsed time of the transaction with the specified id and tag.
| |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
GetUniqueID |
Gets a test-wide unique identifier for a specified Virtual User within a Virtual User group.
| |
HasKey |
Determines whether the specified key is contained within the dictionary.
| |
LogCurrentDataValues |
Write all of the current data values to the VU event log
| |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
NextIteration |
Stops execution of the current script, and starts execution of the next iteration.
| |
NextScript |
Stops execution of the current script, and starts execution of the next script in the sequence.
| |
NextSequence |
Stops execution of the current script and any other scripts in the current sequence, and starts execution of the next sequence of scripts.
| |
OnBackgroundScriptCancellation |
Called when the background script executing in a loop is cancelled
| |
Pause(Int32) |
Pauses the execution of the script for a specified interval (modified by PauseFactor).
| |
Pause(VirtualUserScript) |
Pauses the execution of the script.
| |
Pre |
This method is called just before this script is executed for the first time.
| |
RaiseAlert |
Writes an alert of the specified severity to the Alerts table in Test Controller.
| |
RecordMetric |
Records a user metric.
| |
RecordMetrics |
Records multiple user metrics simultaneously.
| |
RecordTransaction(String, DateTime, TimeSpan, Boolean) |
Records a transaction in the VU event log, specifying whether the transaction passed.
| |
RecordTransaction(String, Int32, Int32, Boolean) |
Records a transaction in the VU event log, specifying whether the transaction passed.
| |
RequestToStopBackgroundScript |
Requests currently running background script to stop.
Since it just requests it to stop, the background script must check periodically if it was asked to do so
and gracefully exit when detects it by checking this.ct.IsCancellationRequested flag.
| |
Resume |
Resumes the background script (which was previously suspended)
| |
ResumeBackgroundScript |
Resumes currently suspended background script.
| |
ResumeTransaction |
Resumes the timing of the specified transaction,
identified by tag as well as id.
| |
Script |
This is the method which will be run by the VirtualUser when it executes this script,
and is where you should write your test script code.
| |
SelectRandomEntryFromList T |
Selects a random entry from a list stored in this Virtual User's data dictionary.
| |
Set(String, Object) |
Sets an object value in the dictionary.
| |
Set T (String, T) |
Sets an object value in the dictionary.
| |
SetBoolean |
Sets a boolean value in the dictionary.
| |
SetDouble |
Sets a double value in the dictionary.
| |
SetFloat |
Sets a float value in the dictionary.
| |
SetInt |
Sets an int value in the dictionary.
| |
SetList |
Sets an ArrayList value in the dictionary.
| |
SetLong |
Sets a long value in the dictionary.
| |
SetProgressPoint(String) |
Sets a progress point in the VU event log.
| |
SetProgressPoint(String, Boolean) |
Sets a progress point in the VU event log, specifying whether the progress point passed.
| |
SetProgressPoint(String, String, Boolean) |
Sets a progress point in the VU event log, specifying whether the progress point passed,
and specifying extra information which appears in the Info column.
| |
SetString |
Sets a string value in the dictionary.
| |
SetSynchronizationPoint |
Set a named synchronization point.
| |
StartBackgroundScript |
Starts previously created and not started background script
| |
StartRequest |
For internal use only.
| |
StartTiming |
Writes a start timing event to the VU event log.
| |
StartTransaction |
Writes a start transaction event to the VU event log,
specifying a tag which appears in the Info column.
| |
StopBackgroundScriptImmediately |
Tells the script to stop immediately. It will result in the script terminating if it calls any
API or exits itself by checking this.ct.IsCancellationRequested flag.
Mind that if it does something in a tight loop or made a call to another library
it can take as much time as it needed to finish those operations.
| |
Suspend |
Asks the background script to suspend
| |
SuspendBackgroundScript |
Suspends currently executing background script.
| |
SuspendTransaction |
Suspends the timing of the specified transaction,
identified by tag as well as id.
| |
TimeToPause |
Gets the length of time that this Virtual User would pause for if Pause(Int32)
were called with the specified interval.
| |
ToString |
Returns a string representation of the IDataDictionary
belonging to this Virtual User
(Overrides Object ToString .) | |
TryToSuspend |
Try to suspend a background script. It won't succeed if it is already locked by another script/VU.
| |
UnsetSynchronizationPoint |
Unset a named synchronization point.
| |
Verify |
Verifies that a boolean expression is true.
| |
VerifyEQ(Int32, Int32, Boolean) |
Verifies that two integers are equal.
| |
VerifyEQ(Int64, Int64, Boolean) |
Verifies that two longs are equal.
| |
VerifyEQ(Double, Double, Double, Boolean) |
Verifies that two doubles are equal.
| |
VerifyEQ(String, String, Boolean, Boolean) |
Verifies that two strings are equal.
| |
VerifyLE(Int32, Int32, Boolean) |
Verifies that one integer is less than or equal to another.
| |
VerifyLE(Int64, Int64, Boolean) |
Verifies that one long is less than or equal to another.
| |
VerifyLE(Double, Double, Double, Boolean) |
Verifies that one double is less than or equal to another.
| |
VerifyLE(String, String, Boolean, Boolean) |
Verifies that one string is less than or equal to another.
| |
VerifyLT(Int32, Int32, Boolean) |
Verifies that one integer is less than another.
| |
VerifyLT(Int64, Int64, Boolean) |
Verifies that one long is less than another.
| |
VerifyLT(Double, Double, Double, Boolean) |
Verifies that one double is less than another.
| |
VerifyLT(String, String, Boolean, Boolean) |
Verifies that one string is less than another.
| |
WaitFor T |
Returns a reference to an object stored in the data dictionary. If the object is not yet in the data dictionary, then this method will wait for
up to the timeout for the object to be added. For example, a foreground script may need to wait for a background script to put an object into
the data dictionary before continuing.
| |
WaitForBackgroundScriptToFinish |
Waits for the background script to finish work in the given timeout,
if timeout is not provided or null it waits until the tasks finish (if at all),
if timeout is not null, then it returns false if it expired before the timeout reached.
| |
WaitForBoolean |
Returns a bool stored in the data dictionary. If the bool is not yet in the data dictionary, then this method will wait for
up to the timeout for the bool to be added. For example, a foreground script may need to wait for a background script to put a bool into
the data dictionary before continuing.
| |
WaitForDouble |
Returns a double stored in the data dictionary. If the double is not yet in the data dictionary, then this method will wait for
up to the timeout for the double to be added. For example, a foreground script may need to wait for a background script to put a double into
the data dictionary before continuing.
| |
WaitForFloat |
Returns a float stored in the data dictionary. If the float is not yet in the data dictionary, then this method will wait for
up to the timeout for the float to be added. For example, a foreground script may need to wait for a background script to put a float into
the data dictionary before continuing.
| |
WaitForInt |
Returns an integer stored in the data dictionary. If the integer is not yet in the data dictionary, then this method will wait for
up to the timeout for the integer to be added. For example, a foreground script may need to wait for a background script to put an integer into
the data dictionary before continuing.
| |
WaitForList |
Returns an ArrayList stored in the data dictionary. If the ArrayList is not yet in the data dictionary, then this method will wait for
up to the timeout for the ArrayList to be added. For example, a foreground script may need to wait for a background script to put an ArrayList into
the data dictionary before continuing.
| |
WaitForLong |
Returns a long stored in the data dictionary. If the long is not yet in the data dictionary, then this method will wait for
up to the timeout for the long to be added. For example, a foreground script may need to wait for a background script to put a long into
the data dictionary before continuing.
| |
WaitForString |
Returns a reference to a string stored in the data dictionary. If the string is not yet in the data dictionary, then this method will wait for
up to the timeout for the string to be added. For example, a foreground script may need to wait for a background script to put a string into
the data dictionary before continuing.
| |
WaitForSynchronizationPoint(String, Int64) |
Wait for a named synchronization point to be set.
| |
WaitForSynchronizationPoint(String, TimeSpan) |
Wait for a named synchronization point to be set.
| |
Warn(Exception) |
Writes a warning message to the VU event log, consisting of the specified exception
| |
Warn(String) |
Writes a warning message to the VU event log.
| |
Warn(String, String) |
Writes a warning message to the VU event log, specifying an identifier which appears in the ID column.
| |
Warn(String, String, String) |
Writes a warning message and an image link to the VU event log, specifying an identifier which appears in the ID column.
| |
WhereAmI |
Returns a stack trace for this Virtual User.
| |
WriteMessage(Exception) |
Write an information message to the VU event log, consisting of the exception specified.
| |
WriteMessage(String) |
Writes an information message to the VU event log.
| |
WriteMessage(String, String) |
Writes an information message to the VU event log, specifying an identifier which appears in the ID column.
| |
WriteMessage(String, String, String) |
Writes an information message to the VU event log and also a link to an image, specifying an identifier which appears in the ID column.
| |
WriteSystemLog(String) |
Writes an alert of Error severity to the Alerts table in Test Controller.
| |
WriteSystemLog(String, String) |
Writes an alert of Error severity to the Alerts table in Test Controller, specifying a heading to prefix to the message.
|
Fields
Name | Description | |
---|---|---|
ct |
A helper object used to communicate between main and foreground scripts. Background script is normally use it to check to see if it needs to exit.
| |
isMainScript |
Internal use only.
|
Properties
Name | Description | |
---|---|---|
BackgroundScriptID |
Gets the script ID, which was provided when this script was started as a background script.
| |
BackgroundScriptIDs |
Returns a list of currently registered wtih the VU background script IDs.
| |
CurrentIteration |
Gets the number of the iteration that this Virtual User is currently executing (beginning at 1).
| |
CurrentTransaction |
Gets the name of the transaction that is currently in progress.
| |
DataDictionary |
Gets the Data Dictionary belonging to this VirtualUser.
| |
DataPath |
Gets the path to the data folder.
| |
ElapsedTime |
Gets the elapsed time since the beginning of the test, in milliseconds.
| |
FilesDataPath |
Gets the path of the data\Files folder.
| |
FinishIteratingRequested |
Gets a value that indicates whether this Virtual User has been requested to finish iterating.
| |
GroupSize |
Gets the number of Virtual Users in the group that this Virtual User belongs to.
| |
GroupSizes |
Gets the number of Virtual Users in each Virtual User group.
| |
Index |
Gets the index number of this Virtual User within the Virtual User group that it belongs to.
| |
InitialDelay |
Gets the initial delay for this Virtual User, between the start of the test and the start of the first script execution.
| |
InjectorFamilyName |
Returns the injector family name
| |
InjectorName |
Returns the injector machine name
| |
IsFinalScript |
Gets a value that indicates whether the current executing script is within the final section of this Virtual User's workflow.
| |
IsFirstScript |
Gets a value that indicates whether the current executing script is the first script to be executed.
| |
IsInitialScript |
Gets a value that indicates whether the current executing script is within the initial section of this Virtual User's workflow.
| |
IsIteratedScript |
Gets a value that indicates whether the current executing script is within the repeated section of this Virtual User's workflow.
| |
IsLastIteration |
Gets a value that indicates whether more iterations will occur for the current Virtual User.
| |
IsPacing |
Gets a value that indicates whether this Virtual User will adjust the delay between iterations to maintain a steady pace of iterations.
| |
Iteration |
Gets the number of the iteration that this Virtual User is currently executing (beginning at 0).
| |
IterationDelay |
Gets the delay time in milliseconds between iterations of the repeated sequence of scripts.
| |
IterationForTime |
Gets the time in milliseconds that the iterated sequence of scripts will iterate for.
| |
Keys |
Gets an enumerator that can be used to iterate over the keys in this dictionary.
| |
LastError |
Gets the most recent error encountered by this Virtual User.
| |
LastIterationDelay |
Gets the delay time in milliseconds between the previous iteration and the current iteration.
| |
LastTransaction |
Gets the name of the most recent transaction to have ended.
| |
MaxFailures |
Gets the maximum number of failures allowed in the script before this Virtual User terminates.
| |
MillisecondsSinceEpoch |
Get the number of milliseconds since the epoch (1st Jan 1970)
| |
Name |
Gets or sets the name of this dictionary.
| |
NumberOfErrors |
Gets the number of errors that have been reported for this Virtual User.
| |
NumberOfFailures |
Gets the current number of script failures for this Virtual User.
| |
NumberOfIterations |
Gets the total number of iterations that the repeated sequence of scripts will execute.
| |
NumberOfWarmupIterations |
Gets or sets the number of warm-up iterations for this Virtual User.
| |
NumberOfWarnings |
Gets the number of warnings that have been reported for this Virtual User.
| |
PauseFactor |
Gets or sets the current percentage pause factor.
| |
ProgressPoint |
Gets the text of the most recent progress point that was set.
| |
ReadOnly |
Gets a value that indicates whether this dictionary is read-only.
| |
RunPath |
Gets the path to the test run results.
| |
SandboxPath |
Gets the path to the sandbox location.
| |
ScriptName |
Gets the name of this Virtual User Script.
| |
SecondsSinceEpoch |
Get the number of seconds since the epoch (1st Jan 1970)
| |
TransactionLoggingOn |
Gets or sets a value that indicates whether transactions should be logged for this VU.
| |
UniqueID |
Gets a test-wide unique identifier for this Virtual User.
| |
VU |
Gets the current VU instance, as the most specialised subclass of VirtualUser.
| |
VUName |
Gets the name of the group that this Virtual User belongs to.
|
See Also