VirtualUserScript MembersC# API

The VirtualUserScript type exposes the following members.
Constructors

  NameDescription
Protected methodVirtualUserScript
Initializes a new instance of the VirtualUserScript class
Back to Top
Methods

  NameDescription
Public methodAcceptCancellation
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
Public methodAdd
Merges the specified IDataDictionary into this IDataDictionary.
Public methodClearProgressPoint
Clears the current progress point set for this Virtual User.
Public methodCreateBackgroundScript
Creates a new background script and starts it if requested.
Public methodEndRequest
For internal use only.
Public methodEndTiming(String)
Writes an end timing event to the VU event log.
Public methodEndTiming(String, Boolean)
Writes an end timing event to the VU event log, specifying whether the timing passed.
Public methodEndTransaction
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.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodError(Exception)
Writes an error message to the VU event log, which will consist of the details of the specified Exception.
Public methodError(String)
Writes an error message to the VU event log.
Public methodError(String, Exception)
Writes an error message to the VU event log, which will include the stack trace of the specified Exception.
Public methodError(String, String)
Writes an error message to the VU event log, specifying an identifier which appears in the ID column.
Public methodError(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.
Public methodExitVU 
Stops execution of this Virtual User.
Public methodExitVU(Boolean)
Stops execution of this Virtual User, specifying whether the script completed successfully.
Public methodExitVU(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.
Public methodFail
Writes a fail event to the VU event log.
Public methodFailTiming
Writes a fail timing event to the VU event log.
Public methodFailTransaction(String)
Writes a fail transaction event to the VU event log.
Public methodFailTransaction(String, String)
Writes a fail transaction event to the VU event log, specifying a tag which appears in the Info column.
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodFinalSequence
Stops execution of the current script and then executes the scripts in the final section of the current workflow.
Public methodFinishIterating
Prevents further iterations of the iterated sequence of scripts for this Virtual User.
Public methodFlushEventLog
Flushes the event log to disk.
Public methodStatic memberFormatDateTime
Converts a DateTime object to its equivalent string representation using the specified format.
Public methodGet(String)
Returns a reference to an object held in the dictionary.
Public methodGet(String, Object)
Returns an object value held in the dictionary, or the defaultValue if the key cannot be found.
Public methodGet T (String)
Returns a reference to an object held in the dictionary.
Public methodGet T (String, T)
Returns a reference to an object held in the dictionary.
Public methodGetBackgroundScriptStatus
Returns a status of the given background script
Public methodGetBoolean(String)
Returns a boolean value held in the dictionary.
Public methodGetBoolean(String, Boolean)
Returns a boolean value held in the dictionary, or the defaultValue if the key cannot be found.
Public methodGetDataDictionary
Gets the Data Dictionary named with the specified key and assigned to the Virtual User in eggPlant Performance Studio.
Public methodGetDataTable
Gets the specified Data Table.
Public methodGetDouble(String)
Returns a double value held in the dictionary.
Public methodGetDouble(String, Double)
Returns a double value held in the dictionary, or the defaultValue if the key cannot be found.
Public methodGetEnumerator
Gets an enumerator for iterating over the key/value pairs in this dictionary.
Public methodGetFloat(String)
Returns a float value held in the dictionary.
Public methodGetFloat(String, Single)
Returns a float value held in the dictionary, or the defaultValue if the key cannot be found.
Public methodGetGroupSize
Gets the number of Virtual Users in the specified Virtual User group.
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetInt(String)
Returns an int value held in the dictionary.
Public methodGetInt(String, Int32)
Returns an int value held in the dictionary, or the defaultValue if the key cannot be found.
Public methodGetList(String)
Returns an ArrayList value held in the dictionary.
Public methodGetList(String, ArrayList)
Returns an ArrayList value held in the dictionary, or the defaultList if the key cannot be found.
Public methodGetLong(String)
Returns a long value held in the dictionary.
Public methodGetLong(String, Int64)
Returns a long value held in the dictionary, or the defaultValue if the key cannot be found.
Public methodStatic memberGetMillisecondsSinceEpoch
Get the number of milliseconds since the epoch (1st Jan 1970), offset by the specified number of milliseconds
Public methodStatic memberGetSecondsSinceEpoch
Get the number of seconds since the epoch (1st Jan 1970), offset by the specified number of seconds
Public methodGetService T 
Get a Service object of the given type.
Public methodGetString(String)
Returns a string value held in the dictionary.
Public methodGetString(String, String)
Returns a string value held in the dictionary, or the defaultValue if the key cannot be found.
Public methodGetTimingElapsedTime
Gets the elapsed time of the current active timing.
Public methodGetTransactionData
Get data about the specified transaction.
Public methodGetTransactionElapsedTime
Gets the current elapsed time of the transaction with the specified id and tag.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodGetUniqueID
Gets a test-wide unique identifier for a specified Virtual User within a Virtual User group.
Public methodHasKey
Determines whether the specified key is contained within the dictionary.
Public methodLogCurrentDataValues
Write all of the current data values to the VU event log
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodNextIteration
Stops execution of the current script, and starts execution of the next iteration.
Public methodNextScript
Stops execution of the current script, and starts execution of the next script in the sequence.
Public methodNextSequence
Stops execution of the current script and any other scripts in the current sequence, and starts execution of the next sequence of scripts.
Protected methodOnBackgroundScriptCancellation
Called when the background script executing in a loop is cancelled
Public methodPause(Int32)
Pauses the execution of the script for a specified interval (modified by PauseFactor).
Public methodPause(VirtualUserScript)
Pauses the execution of the script.
Public methodPre
This method is called just before this script is executed for the first time.
Public methodRaiseAlert
Writes an alert of the specified severity to the Alerts table in Test Controller.
Public methodRecordMetric
Records a user metric.
Public methodRecordMetrics
Records multiple user metrics simultaneously.
Public methodRecordTransaction(String, DateTime, TimeSpan, Boolean)
Records a transaction in the VU event log, specifying whether the transaction passed.
Public methodRecordTransaction(String, Int32, Int32, Boolean)
Records a transaction in the VU event log, specifying whether the transaction passed.
Public methodRequestToStopBackgroundScript
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.
Public methodResume
Resumes the background script (which was previously suspended)
Public methodResumeBackgroundScript
Resumes currently suspended background script.
Public methodResumeTransaction
Resumes the timing of the specified transaction, identified by tag as well as id.
Public methodScript
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.
Public methodSelectRandomEntryFromList T 
Selects a random entry from a list stored in this Virtual User's data dictionary.
Public methodSet(String, Object)
Sets an object value in the dictionary.
Public methodSet T (String, T)
Sets an object value in the dictionary.
Public methodSetBoolean
Sets a boolean value in the dictionary.
Public methodSetDouble
Sets a double value in the dictionary.
Public methodSetFloat
Sets a float value in the dictionary.
Public methodSetInt
Sets an int value in the dictionary.
Public methodSetList
Sets an ArrayList value in the dictionary.
Public methodSetLong
Sets a long value in the dictionary.
Public methodSetProgressPoint(String)
Sets a progress point in the VU event log.
Public methodSetProgressPoint(String, Boolean)
Sets a progress point in the VU event log, specifying whether the progress point passed.
Public methodSetProgressPoint(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.
Public methodSetString
Sets a string value in the dictionary.
Public methodSetSynchronizationPoint
Set a named synchronization point.
Public methodStartBackgroundScript
Starts previously created and not started background script
Public methodStartRequest
For internal use only.
Public methodStartTiming
Writes a start timing event to the VU event log.
Public methodStartTransaction
Writes a start transaction event to the VU event log, specifying a tag which appears in the Info column.
Public methodStopBackgroundScriptImmediately
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.
Public methodSuspend
Asks the background script to suspend
Public methodSuspendBackgroundScript
Suspends currently executing background script.
Public methodSuspendTransaction
Suspends the timing of the specified transaction, identified by tag as well as id.
Public methodTimeToPause
Gets the length of time that this Virtual User would pause for if Pause(Int32) were called with the specified interval.
Public methodToString
Returns a string representation of the IDataDictionary belonging to this Virtual User
(Overrides Object ToString .)
Public methodTryToSuspend
Try to suspend a background script. It won't succeed if it is already locked by another script/VU.
Public methodUnsetSynchronizationPoint
Unset a named synchronization point.
Public methodVerify
Verifies that a boolean expression is true.
Public methodVerifyEQ(Int32, Int32, Boolean)
Verifies that two integers are equal.
Public methodVerifyEQ(Int64, Int64, Boolean)
Verifies that two longs are equal.
Public methodVerifyEQ(Double, Double, Double, Boolean)
Verifies that two doubles are equal.
Public methodVerifyEQ(String, String, Boolean, Boolean)
Verifies that two strings are equal.
Public methodVerifyLE(Int32, Int32, Boolean)
Verifies that one integer is less than or equal to another.
Public methodVerifyLE(Int64, Int64, Boolean)
Verifies that one long is less than or equal to another.
Public methodVerifyLE(Double, Double, Double, Boolean)
Verifies that one double is less than or equal to another.
Public methodVerifyLE(String, String, Boolean, Boolean)
Verifies that one string is less than or equal to another.
Public methodVerifyLT(Int32, Int32, Boolean)
Verifies that one integer is less than another.
Public methodVerifyLT(Int64, Int64, Boolean)
Verifies that one long is less than another.
Public methodVerifyLT(Double, Double, Double, Boolean)
Verifies that one double is less than another.
Public methodVerifyLT(String, String, Boolean, Boolean)
Verifies that one string is less than another.
Public methodWaitFor 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.
Public methodWaitForBackgroundScriptToFinish
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.
Public methodWaitForBoolean
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.
Public methodWaitForDouble
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.
Public methodWaitForFloat
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.
Public methodWaitForInt
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.
Public methodWaitForList
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.
Public methodWaitForLong
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.
Public methodWaitForString
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.
Public methodWaitForSynchronizationPoint(String, Int64)
Wait for a named synchronization point to be set.
Public methodWaitForSynchronizationPoint(String, TimeSpan)
Wait for a named synchronization point to be set.
Public methodWarn(Exception)
Writes a warning message to the VU event log, consisting of the specified exception
Public methodWarn(String)
Writes a warning message to the VU event log.
Public methodWarn(String, String)
Writes a warning message to the VU event log, specifying an identifier which appears in the ID column.
Public methodWarn(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.
Public methodWhereAmI
Returns a stack trace for this Virtual User.
Public methodWriteMessage(Exception)
Write an information message to the VU event log, consisting of the exception specified.
Public methodWriteMessage(String)
Writes an information message to the VU event log.
Public methodWriteMessage(String, String)
Writes an information message to the VU event log, specifying an identifier which appears in the ID column.
Public methodWriteMessage(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.
Public methodWriteSystemLog(String)
Writes an alert of Error severity to the Alerts table in Test Controller.
Public methodWriteSystemLog(String, String)
Writes an alert of Error severity to the Alerts table in Test Controller, specifying a heading to prefix to the message.
Back to Top
Fields

  NameDescription
Protected fieldct
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.
Protected fieldisMainScript
Internal use only.
Back to Top
Properties

  NameDescription
Public propertyBackgroundScriptID
Gets the script ID, which was provided when this script was started as a background script.
Public propertyBackgroundScriptIDs
Returns a list of currently registered wtih the VU background script IDs.
Public propertyCurrentIteration
Gets the number of the iteration that this Virtual User is currently executing (beginning at 1).
Public propertyCurrentTransaction
Gets the name of the transaction that is currently in progress.
Public propertyDataDictionary
Gets the Data Dictionary belonging to this VirtualUser.
Public propertyDataPath
Gets the path to the data folder.
Public propertyElapsedTime
Gets the elapsed time since the beginning of the test, in milliseconds.
Public propertyFilesDataPath
Gets the path of the data\Files folder.
Public propertyFinishIteratingRequested
Gets a value that indicates whether this Virtual User has been requested to finish iterating.
Public propertyGroupSize
Gets the number of Virtual Users in the group that this Virtual User belongs to.
Public propertyGroupSizes
Gets the number of Virtual Users in each Virtual User group.
Public propertyIndex
Gets the index number of this Virtual User within the Virtual User group that it belongs to.
Public propertyInitialDelay
Gets the initial delay for this Virtual User, between the start of the test and the start of the first script execution.
Public propertyInjectorFamilyName
Returns the injector family name
Public propertyInjectorName
Returns the injector machine name
Public propertyIsFinalScript
Gets a value that indicates whether the current executing script is within the final section of this Virtual User's workflow.
Public propertyIsFirstScript
Gets a value that indicates whether the current executing script is the first script to be executed.
Public propertyIsInitialScript
Gets a value that indicates whether the current executing script is within the initial section of this Virtual User's workflow.
Public propertyIsIteratedScript
Gets a value that indicates whether the current executing script is within the repeated section of this Virtual User's workflow.
Public propertyIsLastIteration
Gets a value that indicates whether more iterations will occur for the current Virtual User.
Public propertyIsPacing
Gets a value that indicates whether this Virtual User will adjust the delay between iterations to maintain a steady pace of iterations.
Public propertyIteration
Gets the number of the iteration that this Virtual User is currently executing (beginning at 0).
Public propertyIterationDelay
Gets the delay time in milliseconds between iterations of the repeated sequence of scripts.
Public propertyIterationForTime
Gets the time in milliseconds that the iterated sequence of scripts will iterate for.
Public propertyKeys
Gets an enumerator that can be used to iterate over the keys in this dictionary.
Public propertyLastError
Gets the most recent error encountered by this Virtual User.
Public propertyLastIterationDelay
Gets the delay time in milliseconds between the previous iteration and the current iteration.
Public propertyLastTransaction
Gets the name of the most recent transaction to have ended.
Public propertyMaxFailures
Gets the maximum number of failures allowed in the script before this Virtual User terminates.
Public propertyStatic memberMillisecondsSinceEpoch
Get the number of milliseconds since the epoch (1st Jan 1970)
Public propertyName
Gets or sets the name of this dictionary.
Public propertyNumberOfErrors
Gets the number of errors that have been reported for this Virtual User.
Public propertyNumberOfFailures
Gets the current number of script failures for this Virtual User.
Public propertyNumberOfIterations
Gets the total number of iterations that the repeated sequence of scripts will execute.
Public propertyNumberOfWarmupIterations
Gets or sets the number of warm-up iterations for this Virtual User.
Public propertyNumberOfWarnings
Gets the number of warnings that have been reported for this Virtual User.
Public propertyPauseFactor
Gets or sets the current percentage pause factor.
Public propertyProgressPoint
Gets the text of the most recent progress point that was set.
Public propertyReadOnly
Gets a value that indicates whether this dictionary is read-only.
Public propertyRunPath
Gets the path to the test run results.
Public propertySandboxPath
Gets the path to the sandbox location.
Public propertyScriptName
Gets the name of this Virtual User Script.
Public propertyStatic memberSecondsSinceEpoch
Get the number of seconds since the epoch (1st Jan 1970)
Public propertyTransactionLoggingOn
Gets or sets a value that indicates whether transactions should be logged for this VU.
Public propertyUniqueID
Gets a test-wide unique identifier for this Virtual User.
Public propertyVU
Gets the current VU instance, as the most specialised subclass of VirtualUser.
Public propertyVUName
Gets the name of the group that this Virtual User belongs to.
Back to Top
See Also