TruClient Coded Functions

The following table displays the methods and step arguments (categorized by Browser, Object, Utils, Transactions, Log, Argument, Parameters) that can be used as values in TruClient coded steps. All arguments can accept JavaScript code as values.

Note: All steps in browser and object functions can have values for "End Events", "Step Timeout", "Object Timeout", and "Step Min Time". If no value is set, the default value is used.

For details about End Events, see Understanding End Events. For the list of End Event functions, see TCS.endEvent.<end event type>.

For details about Step Timeout, Object Timeout, and Step Min Time, see Step section user interface elements.

Browser
Object

TCS.object namespace contains the following object types:

  • tcManaged - TruClient managed objects.

  • userManaged - User-defined objects. The following are constructors used in used-defined objects:

    • create - Constructor to create a new user-defined object.

    • Descriptors - Constructor to create a descriptor object.

    • Descriptor - Definition of each descriptor.

tcManaged/userManaged objects:

TruClient managed objects are in the format:
TCS.object.tcManaged.<object name>.operation(arguments)

User managed objects are generated in the format:
TCS.object.userManaged.<object name>.operation(arguments)

Note: Autocomplete displays the list of possible actions for coded objects only after the object name has been manually inserted (for example, TCS.object.userManaged.aDDTOCARTObject).

Create

Descriptors

Descriptor

Utils
Transactions
Log
Argument
Parameters

TCS.browser.activate

Activates the browser window (by ordinal or tab's title). Moves the specified browser window to the foreground.

Note: The title is automatically updated during recording and can be set as an alternative step.

Arguments

  • Ordinal - Which window (integer) to activate.
  • Title - Defined as a string.

JavaScript Language

TCS.browser.activate({
	"Ordinal": integer /*default:1, optional*/ ,
	"Title": string /*optional*/ ,
	"Step Timeout": integer /*default:180, optional*/ ,
	"Step Min Time": integer /*default:0, optional*/ ,
	"Object Timeout": integer /*default:20, optional*/
   });		

Example

TCS.browser.activate({
	"Ordinal": 1,	
   });	

Back to top

TCS.browser.activateTab

Activates the browser tab (by ordinal or tab's title).

Arguments

  • Ordinal - Which tab (integer) to activate.
  • Title - Defined as a string.

JavaScript Language

TCS.browser.activateTab({
	"Ordinal": integer /*default:1, optional*/ ,
	"Title": string /*optional*/ ,
	"Step Timeout": integer /*default:180, optional*/ ,
	"Step Min Time": integer /*default:0, optional*/ ,
	"Object Timeout": integer /*default:20, optional*/
   });	

Example

TCS.browser.activateTab({
	"Ordinal": 1
   });

Back to top

TCS.browser.addTab

Adds an empty tab and navigates to the location.

Arguments

  • Location - The URL to navigate to in the newly opened tab.

JavaScript Language

TCS.browser.addTab({
	"Location": string /*optional*/ ,
	"Step Timeout": integer /*default:180, optional*/ ,
	"Step Min Time": integer /*default:0, optional*/ ,
	"Object Timeout": integer /*default:20, optional*/
   });							

Example

TCS.browser.addTab({
	"Location": argType.JSArg("\"http://mywebsite.com/#/\"")	
   });							

Back to top

TCS.browser.close

Closes the active browser window (by ordinal or tab's title).

Arguments

  • Ordinal - Which window (integer) to close.
  • Title - Defined as a string.

JavaScript Language

TCS.browser.close({
	"Ordinal": integer /optional*/ ,
	"Title": string /*optional*/ ,
	"Step Timeout": integer /*default:180, optional*/ ,
	"Step Min Time": integer /*default:0, optional*/ ,
	"Object Timeout": integer /*default:20, optional*/
  });	

Example

TCS.browser.close({
	"Ordinal": 1
   });	

Back to top

TCS.browser.closeHTMLDialog

Closes HTML dialog.

Arguments

None

JavaScript Language

TCS.browser.closeHTMLDialog({
	"Step Timeout": integer /*default:180, optional*/ ,
	"Step Min Time": integer /*default:0, optional*/ ,
	"Object Timeout": integer /*default:20, optional*/
   });	

Back to top

TCS.browser.closeTab

Closes the active browser tab (by ordinal or tab's title).

Arguments

  • Ordinal - Which tab (integer) to close.
  • Title - Defined as a string.

JavaScript Language

TCS.browser.closeTab({
	"Ordinal": integer /*default:1, optional*/ ,
	"Title": string /*optional*/ ,
	"Step Timeout": integer /*default:180, optional*/ ,
	"Step Min Time": integer /*default:0, optional*/ ,
	"Object Timeout": integer /*default:20, optional*/
   });	

Example

TCS.browser.closeTab({
	"Ordinal": 1
   });	

Back to top

TCS.browser.dialogAlert

Presses OK in alert dialog.

Arguments

None

JavaScript Language

TCS.browser.dialogAlert({
});	

Back to top

TCS.browser.dialogAuthenticate

Presses OK in authenticate dialog.

Arguments

  • Username -The username (string) to enter.
  • Password - The password (string) to enter.
  • Domain - The domain (string) to enter.
  • Button - Ok or Cancel.

JavaScript Language

TCS.browser.dialogAuthenticate({
	"Username": string /*optional*/ ,
	"Password": string /*optional*/ ,
	"Domain": string /*optional*/ ,
	"Button": ["OK", "Cancel"] /*default:"OK", optional*/ ,
	"Step Timeout": integer /*default:180, optional*/ ,
	"Step Min Time": integer /*default:0, optional*/ ,
	"Object Timeout": integer /*default:20, optional*/
   });   

Example

TCS.browser.dialogAuthenticate({
	"Username": "MyUser",
	"Password": "MyPassword",
	"Domain": "MyDomain"
   });

Back to top

TCS.browser.dialogConfirm

Presses OK in confirmation dialog.

Arguments

  • Button - Ok or Cancel.

JavaScript Language

 TCS.browser.dialogConfirm({
	"Button": ["OK", "Cancel"] /*default:"OK", optional*/ ,
	"Step Timeout": integer /*default:180, optional*/ ,
	"Step Min Time": integer /*default:0, optional*/ ,
	"Object Timeout": integer /*default:20, optional*/
   });

Example

TCS.browser.dialogConfirm({
	"Button": "OK"
   });	

Back to top

TCS.browser.dialogPrompt

Presses OK prompt dialog.

Arguments

  • Value - The string to enter.
  • Button - Ok or Cancel.

JavaScript Language

 TCS.browser.dialogPrompt({
	"Value": string /*optional*/ ,
	"Button": ["OK", "Cancel"] /*default:"OK", optional*/ ,
	"Step Timeout": integer /*default:180, optional*/ ,
	"Step Min Time": integer /*default:0, optional*/ ,
	"Object Timeout": integer /*default:20, optional*/
   });

Example

TCS.browser.dialogPrompt({
	"Button": "OK",
	"Value": "Do you want to continue?"
   });	

Back to top

TCS.browser.dialogPromptPassword

Presses OK in prompt password dialog.

Arguments

  • Value - The string to enter.
  • Button - Ok or Cancel.

JavaScript Language

 TCS.browser.dialogPromptPassword({
	"Password": string /*optional*/ ,
	"Button": ["OK", "Cancel"] /*default:"OK", optional*/ ,
	"Step Timeout": integer /*default:180, optional*/ ,
	"Step Min Time": integer /*default:0, optional*/ ,
	"Object Timeout": integer /*default:20, optional*/
   });

Example

TCS.browser.dialogPromptPassword({
	"Password": "MyPassword",
	"Button": "OK"
   });	

Back to top

TCS.browser.getProperty

Gets the property from the browser.

Arguments

  • Property - The property to verify. You can verify the following properties of a browser object:

    • Title - The title of the browser window.

    • Location - The location of the browser window.

    • Variable - The string to enter.

JavaScript Language

TCS.browser.getProperty({
	"Property": ["Title", "Location"],
	"Variable": string,
	"Step Timeout": integer /*default:180, optional*/ ,
	"Step Min Time": integer /*default:0, optional*/ ,
	"Object Timeout": integer /*default:20, optional*/
   });	

Example

TCS.browser.getProperty({
	"Property": "Title",
	"Variable": "My Demo Website"
   });

Back to top

TCS.browser.goBack

Goes back the specified number of pages.

Arguments

  • Count - The number of pages to go back.

JavaScript Language

TCS.browser.goBack({
	"Count": integer /*default:1, optional*/ ,
	"Step Timeout": integer /*default:180, optional*/ ,
	"Step Min Time": integer /*default:0, optional*/ ,
	"Object Timeout": integer /*default:20, optional*/
   });	

Example

TCS.browser.goBack({
	"Count": 2
   });

Back to top

TCS.browser.goForward

Goes forward the specified number of pages.

Arguments

  • Count - The number of pages to go forward.

JavaScript Language

TCS.browser.goForward({
	"Count": integer /*default:1, optional*/ ,
	"Step Timeout": integer /*default:180, optional*/ ,
	"Step Min Time": integer /*default:0, optional*/ ,
	"Object Timeout": integer /*default:20, optional*/
   });	

Example

TCS.browser.goForward({
	"Count": 2
   });

Back to top

TCS.browser.navigate

Navigates to the specified location.

Arguments

  • Location - The URL to navigate to.

JavaScript Language

TCS.browser.navigate({
	"Location": string /*optional*/ ,
	"Step Timeout": integer /*default:180, optional*/ ,
	"Step Min Time": integer /*default:0, optional*/ ,
	"Object Timeout": integer /*default:20, optional*/
   });							

Example

TCS.browser.navigate({
	"Location": argType.JSArg("\"http://mywebsite.com/#/\""	
   });							

Back to top

TCS.browser.reload

Reloads the current page.

Arguments

None

JavaScript Language

TCS.browser.reload({
	"Step Timeout": integer /*default:180, optional*/ ,
	"Step Min Time": integer /*default:0, optional*/ ,
	"Object Timeout": integer /*default:20, optional*/
   });							

Back to top

TCS.browser.resize

Resizes the browser window to the specified size.

Arguments

  • Width - The new width. Leaving this blank means do not resize the width.
  • Height - The new height. Leaving this blank means do not resize the height.

JavaScript Language

TCS.browser.resize({
	"Width": integer,
	"Height": integer,
	"Step Timeout": integer /*default:180, optional*/ ,
	"Step Min Time": integer /*default:0, optional*/ ,
	"Object Timeout": integer /*default:20, optional*/
   });	

Example

TCS.browser.resize({
	"Width": 800,
	"Height": 600
   });		

Back to top

TCS.browser.scroll

Scrolls the browser window to the specified coordinates.

Arguments

  • X Coordinate - The new x coordinate. Leaving this blank means do not scroll along the x axis.
  • Y Coordinate - The new y coordinate. Leaving this blank means do not scroll along the y axis.

JavaScript Language

TCS.browser.scroll({
	"X Coordinate": integer,
	"Y Coordinate": integer,
	"Step Timeout": integer /*default:180, optional*/ ,
	"Step Min Time": integer /*default:0, optional*/ ,
	"Object Timeout": integer /*default:20, optional*/
   });	

Example

TCS.browser.scroll({
	"X Coordinate": 134,
	"Y Coordinate": 155
   });		

Back to top

TCS.browser.stop

Stops loading the current page.

Arguments

None

JavaScript Language

TCS.browser.stop({
	"Step Timeout": integer /*default:180, optional*/ ,
	"Step Min Time": integer /*default:0, optional*/ ,
	"Object Timeout": integer /*default:20, optional*/
   });	

Back to top

TCS.browser.verify

Verifies the current page's title contains the specified value.

Arguments

  • Value - The value of the property to verify.

  • Property - The property to verify. You can verify the following properties of a browser object:

    • Title - The title of the browser window.

    • Location - The location of the browser window.

  • Condition - The relationship between the value and property arguments.

JavaScript Language

TCS.browser.verify({
	"Value": string,
	"Property": ["Title", "Location"] /*default:"Title", optional*/ ,
	"Condition": ["Contain", "Not Contain", "Equal", "Not Equal", "Less Than", "Greater Than", "Less Than Or Equal", "Greater Than Or Equal", "Regular Expression"] /*default:"Contain", optional*/ ,
	"Step Timeout": integer /*default:180, optional*/ ,
	"Step Min Time": integer /*default:0, optional*/ ,
	"Object Timeout": integer /*default:20, optional*/
   });	

Example

TCS.browser.verify({
	"Value": "Demo",
	"Property": "Location",
	"Condition": "Contain"
	"End Event": TCS.argType.endEvent.actionCompleted
   });		

Back to top

TCS.object.[tc/userManaged].<object name>.click

Mouse click on the object.

Arguments

  • Button - The mouse button that is clicked.
  • X Coordinate - The offset location of the action relative to the upper left corner of the object. This number must be positive. If not specified, the default is the center of the object.
  • Y Coordinate - The offset location of the action relative to the upper left corner of the object. If not specified, the default is the center of the object.
  • Ctrl Key - Whether or not this key is pressed during the action.
  • Alt Key - Whether or not this key is pressed during the action.
  • Shift Key - Whether or not this key is pressed during the action.

JavaScript Language

 TCS.object.tcManaged.<object name>.click({
	"Button": ["Left", "Middle", "Right"] /*default:"Left", optional*/ ,
	"X Coordinate": integer /*optional*/ ,
	"Y Coordinate": integer /*optional*/ ,
	"Ctrl Key": boolean /*default:false, optional*/ ,
	"Alt Key": boolean /*default:false, optional*/ ,
	"Shift Key": boolean /*default:false, optional*/ ,
	"Step Timeout": integer /*default:180, optional*/ ,
	"Step Min Time": integer /*default:0, optional*/ ,
	"Object Timeout": integer /*default:20, optional*/
   });	

Example

TCS.object.tcManaged.sPEAKERSObject.click({
	"X Coordinate": 60,
	"Y Coordinate": 18
   });		

Back to top

TCS.object.[tc/userManaged].<object name>.doubleClick

Mouse double-click on the object.

Arguments

  • Button - The mouse button that is clicked.
  • X Coordinate - The offset location of the action relative to the upper left corner of the object. This number must be positive. If not specified, the default is the center of the object.
  • Y Coordinate - The offset location of the action relative to the upper left corner of the object. If not specified, the default is the center of the object.
  • Ctrl Key - Whether or not this key is pressed during the action.
  • Alt Key - Whether or not this key is pressed during the action.
  • Shift Key - Whether or not this key is pressed during the action.

JavaScript Language

 TCS.object.tcManaged.<object name>.doubleClick({
	"Button": ["Left", "Middle", "Right"] /*default:"Left", optional*/ ,
	"X Coordinate": integer /*optional*/ ,
	"Y Coordinate": integer /*optional*/ ,
	"Ctrl Key": boolean /*default:false, optional*/ ,
	"Alt Key": boolean /*default:false, optional*/ ,
	"Shift Key": boolean /*default:false, optional*/ ,
	"Step Timeout": integer /*default:180, optional*/ ,
	"Step Min Time": integer /*default:0, optional*/ ,
	"Object Timeout": integer /*default:20, optional*/
   });	

Example

TCS.object.tcManaged.sPEAKERSObject.doubleClick({
	"Button": "Left",
	"X Coordinate": 60,
	"Y Coordinate": 18
   });	

Back to top

TCS.object.[tc/userManaged].<object name>.drag

Drags an object.

Arguments

  • Button - The mouse button that is clicked.
  • X Offset - The amount of pixels to drag the object on the x axis. A positive number indicates a drag to the right.
  • Y Offset - The amount of pixels to drag the object on the y axis. A positive number indicates a drag down.
  • Path - List of coordinates representing user drag path. Do not modify this argument.

JavaScript Language

 TCS.object.tcManaged.<object name>.drag({
	"Button": ["Left", "Middle", "Right"] /*default:"Left", optional*/ ,
	"X Offset": integer /*default:0, optional*/ ,
	"Y Offset": integer /*default:0, optional*/ ,
	"path": Array /*optional*/ ,
	"Ctrl Key": boolean /*default:false, optional*/ ,
	"Alt Key": boolean /*default:false, optional*/ ,
	"Shift Key": boolean /*default:false, optional*/ ,
	"Step Timeout": integer /*default:180, optional*/ ,
	"Step Min Time": integer /*default:0, optional*/ ,
	"Object Timeout": integer /*default:20, optional*/
   });

Example

TCS.object.tcManaged.sPEAKERSObject.drag({
	"Button": "Left",
	"X Offset": 30,
	"Y Offset": 20
   });	

Back to top

TCS.object.[tc/userManaged].<object name>.dragTo

Drags an object to a target object.

Arguments

  • Target Object - The step object is dragged to this target object.
  • X Offset - The offset from the top left of the target object in the x axis. This number must be positive.
  • Y Offset - The offset from the top left of the target object in the y axis. This number must be positive.

JavaScript Language

TCS.object.tcManaged.<object name>.dragTo({
	"Target Object": Object /*optional*/ ,
	"HTML5": boolean /*default:false, optional*/ ,
	"Button": ["Left", "Middle", "Right"] /*default:"Left", optional*/ ,
	"X Offset": integer /*default:0, optional*/ ,
	"Y Offset": integer /*default:0, optional*/ ,
	"Ctrl Key": boolean /*default:false, optional*/ ,
	"Alt Key": boolean /*default:false, optional*/ ,
	"Shift Key": boolean /*default:false, optional*/ ,
	"Step Timeout": integer /*default:180, optional*/ ,
	"Step Min Time": integer /*default:0, optional*/ ,
	"Object Timeout": integer /*default:20, optional*/
   });

Example

// Drag SPEAKERS to image (2) 
TCS.object.tcManaged.sPEAKERSObject.dragTo({
	"Target Object": "testObj:{566ca5fb-711d-47a2-946f-94e30cb1fb05}",
	"X Offset": 10,
	"Y Offset": 0
   });

Back to top

TCS.object.[tc/userManaged].<object name>.evaluateJavaScript

Evaluates the JavaScript code on an object.

Arguments

  • Code - JavaScript code.

JavaScript Language

  TCS.object.tcManaged.<object name>.evaluateJavaScript({
	"Code": string,
	"Step Timeout": integer /*default:180, optional*/ ,
	"Step Min Time": integer /*default:0, optional*/ ,
	"Object Timeout": integer /*default:20, optional*/
   });

Examples

Example 1:

TCS.object.tcManaged.allkindofCGIsObject.evaluateJavaScript({
	"Code": TCS.argType.JSArg("if (object.id === \"myDiv\") {\n\tobject.click();\n}")   
});

Example 2

function foo() {
	if (object.id === "myDiv") {
	  object.click();
	}
    }
        
    var myStr = "(".concat(foo.toString(), ")();");
        
			TCS.object.tcManaged.allkindofCGIsObject.evaluateJavaScript({
     "Code": TCS.argType.JSArg(myStr);
		});		

Back to top

TCS.object.[tc/userManaged].<object name>.getProperty

Gets a property from an object.

Arguments

  • Property - The property whose value will be stored in the specified variable. The list of properties available depends on all the roles of the object.

    The following are the default properties available for all objects:

    • Visible text - The visible text of the item, corresponding to the DOM textContent property.

    • All text - The entire text of the item, corresponding to the DOM textContent property.

    • Inner HTML - The inner html markup of the object, corresponding to the DOM innerHTML property.

    • Variable - The name of the variable in which to store the specified property value.

JavaScript Language

TCS.object.tcManaged.<object name>.getProperty({
	"Property": ["Visible Text", "All Text", "Inner HTML", "Has Focus"],
	"Variable": string,
	"Step Timeout": integer /*default:180, optional*/ ,
	"Step Min Time": integer /*default:0, optional*/ ,
	"Object Timeout": integer /*default:20, optional*/
   });	

Example

// Get Visible Text from SPEAKERS 
TCS.object.tcManaged.sPEAKERSObject.getProperty({
	"Property": "Visible Text",
	"Variable": "bluetooth speaker",
	"End Event": TCS.argType.endEvent.actionCompleted
   });		

Back to top

TCS.object.[tc/userManaged].<object name>.isExist

Search the object and return true/false.

This is a conversion of the If exist step, and follows the if(localVariable) expression.

Arguments

  • ObjectTimeout - The amount of time to search for an object before a timeout.

JavaScript Language

TCS.object.tcManaged.<object name>.isExist({
	"Object Timeout": integer /*default:20, optional*/
   });	

Back to top

TCS.object.[tc/userManaged].<object name>.isVerified

Verify the value on the object and return true\false.

This is a conversion of the If exist step, and follows the if(localVariable) expression.

Arguments

  • Value - The value of the specified property that the step will verify.

  • Property - The object property whose value the script will verify. The list of properties available for which to verify, depends on all the roles of the object.

    The following are the default properties available for all objects:

    • Visible text - Items that are visible in the application.

    • All text - Items that are in the application but are not necessarily visible. Items in this category are contained in DOM property textContent.

    • Inner HTML - Items contained in the DOM property innerHTML.

    • Has Focus - Items that are in focus in the application.

    • Condition - The relationship between the value and property arguments.

JavaScript Language

TCS.object.tcManaged.<object name>.isVerified({
	"Value": string,
	"Property": ["Visible Text", "All Text", "Inner HTML", "Has Focus"] /*default:"Visible Text", optional*/ ,
	"Condition": ["Contain", "Not Contain", "Equal", "Not Equal", "Less Than", "Greater Than", "Less Than Or Equal", "Greater Than Or Equal", "Regular Expression"] /*default:"Contain", optional*/ ,
	"Object Timeout": integer /*default:20, optional*/
   });		

Example

TCS.object.tcManaged.oURPRODUCTSObject.isVerified({
	"Value": "Headset",
	"Property": ["Visible Text",
	"Condition": ["Contain"
   });		

Back to top

TCS.object.[tc/userManaged].<object name>.mouseDown

Mouse down on an object.

Arguments

  • Button - The mouse button that is clicked.
  • X Coordinate - The offset location of the action relative to the upper left corner of the object. This number must be positive. If not specified, the default is the center of the object.
  • Y Coordinate - The offset location of the action relative to the upper left corner of the object. If not specified, the default is the center of the object.
  • Ctrl Key - Whether or not this key is pressed during the action.
  • Alt Key - Whether or not this key is pressed during the action.
  • Shift Key - Whether or not this key is pressed during the action.

JavaScript Language

 TCS.object.tcManaged.<object name>.mouseDown({
	"Button": ["Left", "Middle", "Right"] /*default:"Left", optional*/ ,
	"X Coordinate": integer /*optional*/ ,
	"Y Coordinate": integer /*optional*/ ,
	"Ctrl Key": boolean /*default:false, optional*/ ,
	"Alt Key": boolean /*default:false, optional*/ ,
	"Shift Key": boolean /*default:false, optional*/ ,
	"Step Timeout": integer /*default:180, optional*/ ,
	"Step Min Time": integer /*default:0, optional*/ ,
	"Object Timeout": integer /*default:20, optional*/
   });	

Example

TCS.object.tcManaged.sPEAKERSObject.mouseDown({
	"Button": "Left",
	"X Coordinate": 60,
	"Y Coordinate": 18
   });		

Back to top

TCS.object.[tc/userManaged].<object name>.mouseOver

Mouse over on an object.

Arguments

  • Button - The mouse button that is clicked.
  • Ctrl Key - Whether or not this key is pressed during the action.
  • Alt Key - Whether or not this key is pressed during the action.
  • Shift Key - Whether or not this key is pressed during the action.

JavaScript Language

 TCS.object.tcManaged.<object name>.mouseOver({
	"Button": ["Left", "Middle", "Right"] /*default:"Left", optional*/ ,
	"Ctrl Key": boolean /*default:false, optional*/ ,
	"Alt Key": boolean /*default:false, optional*/ ,
	"Shift Key": boolean /*default:false, optional*/ ,
	"Step Timeout": integer /*default:180, optional*/ ,
	"Step Min Time": integer /*default:0, optional*/ ,
	"Object Timeout": integer /*default:20, optional*/
   });	

Example

TCS.object.tcManaged.sPEAKERSObject.mouseOver({
	"Button": "Left"
   });		

Back to top

TCS.object.[tc/userManaged].<object name>.mouseUp

Mouse up on an object.

Arguments

  • Button - The mouse button that is clicked.
  • X Coordinate - The offset location of the action relative to the upper left corner of the object. This number must be positive. If not specified, the default is the center of the object.
  • Y Coordinate - The offset location of the action relative to the upper left corner of the object. If not specified, the default is the center of the object.
  • Ctrl Key - Whether or not this key is pressed during the action.
  • Alt Key - Whether or not this key is pressed during the action.
  • Shift Key - Whether or not this key is pressed during the action.

JavaScript Language

 TCS.object.tcManaged.<object name>.mouseUp({
	"Button": ["Left", "Middle", "Right"] /*default:"Left", optional*/ ,
	"X Coordinate": integer /*optional*/ ,
	"Y Coordinate": integer /*optional*/ ,
	"Ctrl Key": boolean /*default:false, optional*/ ,
	"Alt Key": boolean /*default:false, optional*/ ,
	"Shift Key": boolean /*default:false, optional*/ ,
	"Step Timeout": integer /*default:180, optional*/ ,
	"Step Min Time": integer /*default:0, optional*/ ,
	"Object Timeout": integer /*default:20, optional*/
   });	

Example

TCS.object.tcManaged.sPEAKERSObject.mouseUp({
	"Button": "Left",
	"X Coordinate": 60,
	"Y Coordinate": 18
   });		

Back to top

TCS.object.[tc/userManaged].<object name>.multiSelect

Select multiple options in a list box.

Arguments

  • Text - The selected string.
  • By Ordinal - True/false.
  • Delimiter - Defined as a string.

JavaScript Language

TCS.object.tcManaged.<object name>.multiSelect({
	"Text": string,
	"By Ordinal": boolean /*default:false, optional*/ ,
	"Delimiter": string /*default:",", optional*/ ,
	"Step Timeout": integer /*default:180, optional*/ ,
	"Step Min Time": integer /*default:0, optional*/ ,
	"Object Timeout": integer /*default:20, optional*/
   });		

Back to top

TCS.object.[tc/userManaged].<object name>.pause

Pause the playing of this object (video or audio).

Arguments

None

JavaScript Language

 TCS.object.tcManaged.<object name>.pause({
   });	

Back to top

TCS.object.[tc/userManaged].<object name>.pressKey

Press key on the object.

Arguments

  • Key name - Enter, Space, Backspace, Tab, Escape, Delete, Up, Down, Left. or Right.
  • Ctrl Key - Whether or not this key is pressed during the action.
  • Alt Key - Whether or not this key is pressed during the action.
  • Shift Key - Whether or not this key is pressed during the action.

JavaScript Language

TCS.object.tcManaged.<object name>.pressKey({
	"Key Name": ["Enter", "Space", "Backspace", "Tab", "Escape", "Delete", "Up", "Down", "left", "Right"],
	"Ctrl Key": boolean /*default:false, optional*/ ,
	"Alt Key": boolean /*default:false, optional*/ ,
	"Shift Key": boolean /*default:false, optional*/ ,
	"Step Timeout": integer /*default:180, optional*/ ,
	"Step Min Time": integer /*default:0, optional*/ ,
	"Object Timeout": integer /*default:20, optional*/
   });
		

Example

// Press Enter key on ADD TO CART button
	TCS.object.tcManaged.aDDTOCARTObject.pressKey({
	"Key Name": "Enter"
   });

Back to top

TCS.object.[tc/userManaged].<object name>.scroll

Scroll.

Arguments

  • Horizontally - Scroll horizontally (integer).
  • Vertically - Scroll vertically (integer).

JavaScript Language

TCS.object.tcManaged.<object name>.scroll({
	"Horizontally": integer /*default:0, optional*/ ,
	"Vertically": integer /*default:0, optional*/ ,
	"Step Timeout": integer /*default:180, optional*/ ,
	"Step Min Time": integer /*default:0, optional*/ ,
	"Object Timeout": integer /*default:20, optional*/
   });		

Example

TCS.object.tcManaged.sPEAKERSObject.scroll({
	"Horizontally": 10
   });	

Back to top

TCS.object.[tc/userManaged].<object name>.scrollintoView

Scrolls the view to the object.

Arguments

None

JavaScript Language

TCS.object.tcManaged.<object name>.scrollintoView({
   });		

Back to top

TCS.object.[tc/userManaged].<object name>.seek

Seek a place in the object (video or audio).

Arguments

  • Time - Defined as a string.

JavaScript Language

TCS.object.tcManaged.<object name>.seek({
	"Time": string,
	"Step Timeout": integer /*default:180, optional*/ ,
	"Step Min Time": integer /*default:0, optional*/ ,
	"Object Timeout": integer /*default:20, optional*/
   });		

Back to top

TCS.object.[tc/userManaged].<object name>.select

Selects an option from a list box.

Arguments

  • Text - The selected string or use a regular expression.
  • Ordinal - The order of the selected item in the list. If the text argument is also specified, then this argument refers to the instance of the specified text value in the list box. An ordinal of 0 generates a random value.
  • Inner object - The inner html markup of the object, corresponding to the DOM innerHTML property.

JavaScript Language

TCS.object.tcManaged.<object name>.select({
	"Text": string,
	"Ordinal": integer /*default:1, optional*/ ,
	"Inner Object": Object /*optional*/ ,
	"Step Timeout": integer /*default:180, optional*/ ,
	"Step Min Time": integer /*default:0, optional*/ ,
	"Object Timeout": integer /*default:20, optional*/
   });		

Example

// Select web from MainSearchSelectType listbox
TCS.object.tcManaged.mainSearchSelectTypeObject.select({
	"Text": "web",
	"Ordinal": 1
   });		

Back to top

TCS.object.[tc/userManaged].<object name>.type

Types in the object (must be a text box).

Arguments

  • Value - What is typed.
  • Clear - Clear the text box before typing. The default is true.
  • Typing Interval - The average time in milliseconds between keystrokes.

JavaScript Language

TCS.object.tcManaged.<object name>.type({
	"Value": string,
	"Clear": boolean /*default:true, optional*/ ,
	"Typing Interval": integer /*default:350, optional*/ ,
	"Step Timeout": integer /*default:180, optional*/ ,
	"Step Min Time": integer /*default:0, optional*/ ,
	"Object Timeout": integer /*default:20, optional*/
   });		

Example

// Type speakers in Search textbox
TCS.object.tcManaged.object.type({
	"Value": "speakers",
	"Typing Interval": 300
   });		

Back to top

TCS.object.[tc/userManaged].<object name>.verify

Verifies value on an object.

Arguments

  • Value - The string or number to verify.

  • Property - The object property whose value will be verified. The list of properties available to verify depends on all the roles of the object.

    The following are the default properties available for verification on all objects:

    • Visible text - Items that are visible in the application.

    • All text - Items that are in the application but are not necessarily visible. Items in this category are contained in DOM property textContent.

    • Inner HTML - Items contained in the DOM property innerHTML.

    • Condition - The relationship between the value and property arguments.

JavaScript Language

TCS.object.tcManaged.<object name>.verify({
	"Value": string,
	"Property": ["Visible Text", "All Text", "Inner HTML", "Has Focus"] /*default:"Visible Text", optional*/ ,
	"Condition": ["Contain", "Not Contain", "Equal", "Not Equal", "Less Than", "Greater Than", "Less Than Or Equal", "Greater Than Or Equal", "Regular Expression"] /*default:"Contain", optional*/ ,
	"Step Timeout": integer /*default:180, optional*/ ,
	"Step Min Time": integer /*default:0, optional*/ ,
	"Object Timeout": integer /*default:20, optional*/
   });		

Example

// Verify  HEADPHONES Shop Now's Visible Text contains Headphones
	TCS.object.tcManaged.hEADPHONESShopNowObject.verify({
	"Value": "Headphones",
	"Property": "Visible Text",
	"Condition": "Contain"
	"End Event": TCS.argType.endEvent.actionCompleted
});		

Back to top

TCS.object.[tc/userManaged].<object name>.wait

Waits for object to appear.

Arguments

None

JavaScript Language

TCS.object.tcManaged.<object name>.wait({
   });		

Back to top

TCS.object.[tc/userManaged].<object name>.waitFor

Waits until the visible text in an object contains a specified value.

Arguments

  • Value - The value of the specified property that the step will wait for, before the step passes.

  • Property - The object property whose value the script will wait for. The list of properties available for which to wait, depends on all the roles of the object.

    The following are the default properties available for all objects:

    • Visible text - Items that are visible in the application.

    • All text - Items that are in the application but are not necessarily visible. Items in this category are contained in DOM property textContent.

    • Inner HTML - Items contained in the DOM property innerHTML.

    • Condition - The relationship between the value and property arguments.

JavaScript Language

TCS.object.tcManaged.<object name>.waitforProperty({
	"Value": string,
	"Property": ["Visible Text", "All Text", "Inner HTML", "Has Focus"],
	"Condition": ["Contain", "Not Contain", "Equal", "Not Equal", "Less Than", "Greater Than", "Less Than Or Equal", "Greater Than Or Equal", "Regular Expression"] /*default:"Contain", optional*/ ,
	"Step Timeout": integer /*default:180, optional*/ ,
	"Step Min Time": integer /*default:0, optional*/ ,
	"Object Timeout": integer /*default:20, optional*/ 
   });		

Example

// Wait until HEADPHONES Shop Now's Visible Text contains Headset
  TCS.object.tcManaged.hEADPHONESShopNowObject.waitforProperty({
	"Value": "Headset",
	"Property": "Visible Text",
	"Condition": "Contain"
	"End Event": TCS.argType.endEvent.actionCompleted
   });		

Back to top

TCS.utils.breakpoint

Adds a user-defined breakpoint (it is ignored when running load).

JavaScript Language

TCS.utils.breakpoint();	

Back to top

TCS.utils.catchError

Catch error in the previous step.

Arguments

  • exception - Exception object.
  • errorType - Error type (see Error Types:).

JavaScript Language

TCS.utils.catchError(exception, errorType)	

Example

try {
		// Click on A Missing Object link
   TCS.object.tcManaged.AMissingObject.click({});
	    } catch (ex) {
   // Catch Object Identification error on the previous step
		     TCS.utils.catchError(ex, TCS.argType.errorType.objectIdentification);
	    };		

Back to top

TCS.argType.errorType.all

Indicates which type of errors.

JavaScript Language

TCS.argType.errorType.all	

Example

try {
	// Mouse up on Advantage Shopping 
	TCS.object.tcManaged.advantageShoppingObject.mouseUp({
		"X Coordinate": 738,
		"Y Coordinate": 1133,
		"End Event": TCS.argType.endEvent.actionCompleted
	});
	// Catch "Any" error on the previous step
   } catch (ex) {
		TCS.utils.catchError(ex, TCS.argType.errorType.all);
   };	

Back to top

TCS.argType.errorType.objectIdentification

Catches object identification errors in the previous step.

JavaScript Language

TCS.argType.errorType.objectIdentification

Example

try {
	// Mouse up on Advantage Shopping 
	TCS.object.tcManaged.advantageShoppingObject.mouseUp({
		"X Coordinate": 738,
		"Y Coordinate": 1133,
		"End Event": TCS.argType.endEvent.actionCompleted
	});
	// Catch Object Identification error on the previous step
   } catch (ex) {
		TCS.utils.catchError(ex, TCS.argType.errorType.objectIdentification);
   };		

Back to top

TCS.argType.errorType.stepAction

Catches step action errors in the previous step.

JavaScript Language

TCS.argType.errorType.stepAction

Example

try {
	// Mouse up on Advantage Shopping 
	TCS.object.tcManaged.advantageShoppingObject.mouseUp({
		"X Coordinate": 738,
		"Y Coordinate": 1133,
		"End Event": TCS.argType.endEvent.actionCompleted
	});
	// Catch Step Action error on the previous step
   } catch (ex) {
		TCS.utils.catchError(ex, TCS.argType.errorType.stepAction);
   };		

Back to top

TCS.argType.errorType.stepArguments

Catches step argument errors in the previous step.

JavaScript Language

TCS.argType.errorType.stepArguments

Example

try {
	// Mouse up on Advantage Shopping 
	TCS.object.tcManaged.advantageShoppingObject.mouseUp({
		"X Coordinate": 738,
		"Y Coordinate": 1133,
		"End Event": TCS.argType.endEvent.actionCompleted
	});
	// Catch Step Arguments error on the previous step
   } catch (ex) {
		TCS.utils.catchError(ex, TCS.argType.errorType.stepArguments);
   };		

Back to top

TCS.argType.errorType.stepTimeout

Catches step timeout errors in the previous step.

JavaScript Language

TCS.argType.errorType.stepTimeout

Example

try {
	// Mouse up on Advantage Shopping 
	TCS.object.tcManaged.advantageShoppingObject.mouseUp({
		"X Coordinate": 738,
		"Y Coordinate": 1133,
		"End Event": TCS.argType.endEvent.actionCompleted
	});
	// Catch Step Timeout error on the previous step
   } catch (ex) {
		TCS.utils.catchError(ex, TCS.argType.errorType.stepTimeout);
   };		

Back to top

TCS.utils.wait

Waits for an object to appear.

Arguments

  • Interval - The amount of time to wait.
  • Unit - The unit of time (seconds or milliseconds).
  • Think Time - Amount of think time.

JavaScript Language

TCS.utils.wait({
	"Interval": integer /*default:3, optional*/ ,
	"Unit": ["Seconds", "Milliseconds"] /*default:"Seconds", optional*/ ,
	"Think Time": boolean /*default:true, optional*/
   });		

Example

TCS.utils.wait({
	"Interval": 10
   });		

Back to top

TCS.utils.startHandler

Activate the handler by name.

JavaScript Language

TCS.utils.startHandler(handlerName[string])		

Example

TCS.utils.startHandler(handler5)	

Back to top

TCS.utils.endHandler

Deactivate the handler.

JavaScript Language

TCS.utils.endHandler(handlerName[string])		

Example

TCS.utils.endHandler(handler32)		

Back to top

TCS.utils.exit

The exit point in the script.

Arguments

  • target - Iteration, Action, or Vuser.
  • status - Pass/Fail

JavaScript Language

TCS.utils.exit({
	"target": ["Iteration", "Action", "Vuser"] /*default:"Action", optional*/ ,
	"status": ["Pass", "Fail"] /*default:"Pass", optional*/
   });		

Example

TCS.utils.exit({
	"target": "Vuser",
	"status":  "Fail",
   });		

Back to top

TCS.utils.rendezvous

The rendezvous point.

Arguments

  • rendezvousName - The rendezvous name defined as a string.

JavaScript Language

TCS.utils.rendezvous(rendezvousName[string])	

Example

TCS.utils.rendezvous(rendezvous1);	

Back to top

TCS.utils.evaluateC

Evaluate C code. The function name is mandatory.

JavaScript Language

 TCS.utils.evaluateC ({
	"Function Name": { desc : "StepSchemasDesc.CFunctionName", type :	"string" },
	"Function Timeout" : { desc : "StepSchemasDesc.CFunctionTimeout", type : "integer", minimum : 30, default: 60 }
   });		

Example

TCS.utils.evaluateC ({
	"Function Name": "\"Cfoo\"",
	"Function Timeout": 100
   });		

Back to top

TCS.utils.verifyPDFContent

Verify content in the pdf file.

The Path and Value are mandatory.

JavaScript Language

TCS.utils.verifyPDFContent ({
	"Path": { desc : "StepSchemasDesc.PDFPath",type :"string" },
	"Value": { desc : "StepSchemasDesc.PDFValue", type : "string" },
	"Condition": { enum : [ "Contain", "Not Contain", "Regular Expression" ],default : "Contain",type : "string"}
   });		

Example

 TCS.utils.verifyPDFContent({
	"Path": "\"blabla.pdf\"",
	"Value": "\"Hello world\""
	"Condition": "Contain"
   })			

Back to top

TCS.utils.evalInBrowser

Evaluates JavaScript code in browser context.

JavaScript Language

TCS.utils.evalInBrowser(code)

Example

TCS.utils.evalInBrowser("var x = 2*3*4*5;");	

Back to top

TCS.utils.snapshot

Generates a snapshot during replay.

Arguments

  • Snapshot name - Name of snapshot (string).

Example

TCS.utils.snapshot({
	"Snapshot name": "ContactUs",
   });		

Back to top

TCS.utils.callTcFunction(arguments)

Calls function in library with the given arguments.

Arguments

  • Library Name - Name of library.
  • Function Name - Name of function.
  • argName1 - List of functions.

JavaScript Language

TCS.utils.callTcFunction({
	"Library Name": string,
	"Function Name": string,
	"argName1": argValue1 /*optional -list of arguments- */
 });		

Example

 TCS.utils.callTcFunction({
	"Library Name": "MyLib",
	"Function Name": "Foo"
   });		

Back to top

TCS.utils.callJSFile

Call to add external file to load more JavaScript code to be used in TruClient coded.

Arguments

  • File Name - Name of the JavaScript file to call.
  • Full Path - Path to JavaScript file required.
  • Encoding - Encoding type.

JavaScript Language

TCS.utils.callJSFile({
	"File Name": string,	
	"Full Path": boolean /*default:false, optional*/ ,
	"Encoding": string /*default:utf8, optional*/
  });

Example

 TCS.utils.callJSFile({
	"File Name": "code.js",
   });	

Back to top

TCS.transaction.start(transName)

Start point of the transaction.

Arguments

  • transName - The name of the transaction to start.

Example

TCS.transaction.start("Login");	

Back to top

TCS.transaction.end(transName, status)

End point of a transaction.

Arguments

  • transName - The name of the transaction to end.
  • status - One of the following values: “Pass”, “Fail”, “Auto”.

JavaScript Language

TCS.transaction.end(transName[string], status["Pass", "Fail", "Auto"])

Example

TCS.transaction.end("Login", "Auto");	

Back to top

TCS.log.info(message)

Logs an informational level message.

Arguments

  • message - The log message (string).

JavaScript Language

TCS.log.info(message[string])

Example

TCS.log.info("This is an informative message")

Back to top

TCS.log.warning(message)

Logs a warning level message.

Arguments

  • message - The log message (string).

Example

TCS.log.warning("This is a warning message");

Back to top

TCS.log.error(message)

Logs an error level message.

Arguments

  • Message - The log message (string).

Example

TCS.log.error("This is an error message")

Back to top

TCS.log.extended(message)

Logs a message where log level is set to extended.

Arguments

  • message - The log message (string).

Example

TCS.log.extended("Message for extended log");

Back to top

TCS.object.Descriptors

Computes description of a DOM object that corresponds with the Descriptors identification method.

JavaScript Language

TCS.object.Descriptors(tagName, descriptorObject, descriptorObject, ...)

Parameters

  • tagName - the tag name of the DOM object (string).
  • descriptorObject – an object that contains a description of one descriptor.

Examples

Using parameters in descriptors:

TCS.object.Descriptors("A",
			TCS.object.Descriptor.text.equals(TCS.argType.JSArg("ArgsContext.TC.getParam(\"myParam");")))		

Creating a full object with descriptors:

function initRepository() {
	TCS.object.userManaged.allkindofCGIsObject = TCS.object.create({
		"Descriptors": TCS.object.Descriptors("A",
			TCS.object.Descriptor.text.equals(TCS.argType.JSArg("ArgsContext.TC.getParam(\"myParam");")))
				}
                                             
			);
			TCS.object.userManaged.example1Object = TCS.object.create({
				"Descriptors": TCS.object.Descriptors("A",
					TCS.object.Descriptor.text.equals("Example 1"))
				}
                                             
			);
		}		

Back to top

TCS.object.Descriptor

Container object used by the coded object descriptors.

All descriptor objects are defined in the TCS.Descriptor context.

Each descriptor supports several methods that enable a comparison with the real DOM value of the object that you search for.

For example, input_type descriptor has the equals and equalsIgnoreCase methods.

The table below lists each descriptor and the methods it supports. For a description of each descriptor, see List of object properties. For a description of each method, see List of operators.

  Methods
Descriptors Equals equals
Ignore
Digits
equals
Ignore
Case
starts
With
ends
With
is
Substring
equals
Ignore
Chars
isReg
ExpMatch
contains contained equals
Ignore
Deviation
role      
id      
name      
class                
text      
label      
labelledby      
title      
input_type                  
input_text_value      
input_button_value      
alt      
img_src      
url      
protocol      
host      
pathname      
search      
form_action      
form_method                  
tr_cols                  
isNumber                    
isCurrency                    
isDate                    
isTime                    
isLeaf                    
customAttribute      
customProperty      

Back to top

TCS.object.Descriptor.ordinal(value)

The ordinal method computes description of the DOM object ordinal that corresponds to Descriptors ordinal.

JavaScript Language

TCS.object.Descriptor.ordinal(param)

Parameters

  • Param - This is either “random” or a number.

Examples

Example 1: John computes descriptor identification where tagName is “A”, text is equal to "All kind of CGI's.", and ordinal is random.

TCS.object.Descriptors("A",
TCS.object.Descriptor.text.equals("All kind of CGI's."),
TCS.object.Descriptor.ordinal("random"))

Example 2: John computes descriptor identification where tagName is “INPUT”, name is ‘gender’, ‘label’ equals ‘aa,,,,bb’ ignoring the ‘,’ character, the input type is text, and value is ‘male’.

TCS.object.Descriptors("INPUT",
TCS.object.Descriptor.name.equalsIgnoreDigits("gender"),
TCS.object.Descriptor.label.equalsIgnoreChars("aa,,,,bb", "0123456789,.+-"),
TCS.object.Descriptor.input_type.equals("text"),
TCS.object.Descriptor.input_text_value.equals("male"))

Example 3: John computes descriptor identification where tagName is “INPUT”, the input type is text and the id matches the /myid/i RegExp.

TCS.object.Descriptors("INPUT",
TCS.Descriptor.input_type.equals("text"),
TCS.Descriptor.id.isRegExpMatch(TCS.argType.JSArg("/myid/i")))

Back to top

XPATH identification method

TCS.object.create API gets an XPath that defines the object.

Examples:

TCS.object.create ({"XPath": "/html/body/form/input"});

TCS.object.create ({"XPath": "//input[@type=\"submit\" and @value=\"Submit Query\"]"});

TCS.object.create ({"XPath": "//a[text()=\"Back to example 1\"]"});

Back to top

JavaScript identification method

TCS.object.create API gets a JavaScript code that defines the object.

Examples:

TCS.object.create ("JavaScript": "document.getElementById(\"htmlTags\");");

TCS.object.create ("JavaScript": "evalXPath(\"/html/body/form/p[1]/input\");");

Back to top

TCS.argType.browserType

Browser type can be Firefox, Chromium, or Internet Explorer (IE). The code for each differs depending on which browser the script is running.

Example

// If Browser	
switch (TCS.argType.browserType) {
	// Chromium
	case "Chromium":
		{

// Do something specific for Chrome
break;
		}
		// Firefox
	case "Firefox":
		{
// Do something specific for Firefox
break;
		}
		// IE
	case "IE":
		{
// Do something specific for IE
break;
		}
}		

Back to top

TCS.argType.endEvent.actionCompleted

Next step can start when the action to be performed has completed.

JavaScript Language

TCS.argType.endEvent.actionCompleted

Example

// Navigate to "advantageonlineshopping.com"
	TCS.browser.navigate({
		"Location": TCS.argType.JSArg("\"advantageonlineshopping.com\""),
		"End Event": TCS.argType.endEvent.actionCompleted
   });		

Back to top

TCS.argType.endEvent.dialogOpened

Next step can start when a dialog is opened.

JavaScript Language

TCS.argType.endEvent.dialogOpened

Example

// Click on SPECIAL OFFER
	TCS.object.tcManaged.sPECIALOFFERObject.click({
		"X Coordinate": 57,
		"Y Coordinate": 23,
		"End Event": TCS.argType.endEvent.dialogOpened
   });		

Back to top

TCS.argType.endEvent.documentLoaded

Next step can start when the process of loading a document is completed.

JavaScript Language

TCS.argType.endEvent.documentLoaded

Example

// Click on SPECIAL OFFER
	TCS.object.tcManaged.pOPULARITEMSObject.click({
		"X Coordinate": 61,
		"Y Coordinate": 20,
		"End Event": TCS.argType.endEvent.documentLoaded
   });		

Back to top

TCS.argType.endEvent.objectExist(object)

Next step can start after verification that the object (managed or coded) exists.

JavaScript Language

TCS.argType.endEvent.objectExist(object[Object])

Example

// Click on View Details label
	TCS.object.tcManaged.viewDetailsObject.click({
		"X Coordinate": 40,
		"Y Coordinate": 9,
		"End Event": TCS.argType.endEvent.objectExist(TCS.object.tcManaged.image1Object)
   });		

Back to top

TCS.argType.endEvent.stepNetworkCompleted

Next step can start when all HTTP requests have completed including requests initiated by XMLHttpRequest.

JavaScript Language

TCS.argType.endEvent.stepNetworkCompleted

Example

// Click on ADD TO CART button
	TCS.object.tcManaged.aDDTOCARTObject.click({
		"X Coordinate": 105,
		"Y Coordinate": 37,
		"End Event": TCS.argType.endEvent.stepNetworkCompleted
   });		

Back to top

TCS.argType.endEvent.syncNetworkCompleted

Next step can start when all HTTP requests have been completed excluding requests that originated in XMLHttpRequest.

JavaScript Language

TCS.argType.endEvent.syncNetworkCompleted

Example

// Click on CHECKOUT ($1,009.00) button
	TCS.object.tcManaged.cHECKOUT100900Object.click({
		"X Coordinate": 117,
		"Y Coordinate": 41,
		"End Event": TCS.argType.endEvent.syncNetworkCompleted
   });		

Back to top

TCS.argType.JSArg(argValue)

Signals the JavaScript argument should be evaluated inside the browser context.

Arguments

  • argValue - The argument value should be evaluated inside the JavaScript context.

Example

// Type Math.floor((Math.random() * 1000) ) in entry textbox
	TCS.object.tcManaged.entryObject.type({
		"Value": TCS.argType.JSArg("Math.floor((Math.random() * 1000) )"),
		"End Event": TCS.argType.endEvent.actionCompleted
   	});

Back to top

TCS.argType.ParamArg(argValue)

Signals the parameter argument should be evaluated inside the browser context.

Arguments

  • argValue - The parameter name.

Example

// Type EditField1Param in entry textbox
	TCS.object.tcManaged.entryObject.type({
			"Value": TCS.argType.ParamArg("EditField1Param")
	});

Back to top

TCS.parameters.advance

Advances the specified parameter to the next available parameter value.

Arguments

  • paramName - The name of the parameter.

JavaScript Language

TCS.parameters.advance(paramName[string])

Example

TCS.parameters.advance("param1")

Back to top

TCS.parameters.get(paramName)

Returns the value of the specified parameter.

Arguments

  • paramName - The parameter name.

JavaScript Language

TCS.parameters.get(paramName[string])

Example

Var paramVal = TCS.parameters.get("paramName2")		

Back to top

TCS.parameters.set(paramName, paramValue)

Saves a string to a parameter, creating the parameter if it does not exist.

Arguments

  • paramName - The name of the parameter in which to save the value.
  • paramValue - The value.

JavaScript Language

TCS.parameters.set(paramName, paramValue)

Example

TCS.parameters.set("MyParam", "paramValue")

Back to top

TCS.parameters.vts.addCell(colName, value, vtsName)

Sets the last field of a column to a value.

Arguments

  • colName - The name of the column.
  • value - The value as a string.
  • vtsName - The alias of the VTS server.

Example

TCS.parameters.vts.addCell("MyColumn","myValue","MyVts")

Back to top

TCS.parameters.vts.addCells(colNames, values, option, vtsName)

Sets the data in multiple columns. If option selected is 2, returns a value of 0 if value inserted. Returns a value of 1 if the value already exists.

Arguments

  • colName - The column names delimited by a semi-colon.

  • value - The values as a string delimited by a semi-colon.

    • option - Define how the values are added:

    • 0 - Add as same row in all columns based on the column with the highest row count. The created row will be n+1 for all columns.

    • 1 - Add as stack - last row in every column.

    • 2 - Add as unique stack - last row in every column only if the value is unique in the column.

  • vtsName - The alias of the VTS server.

Remarks

If the columns specified in the argument do not exist, the columns will be created and the cell contents are set to the argument values.

Example

TCS.parameters.vts.addCells("MyColumn1;MyColumn2;MyColumn2", "MyValue1;MyValue2;MyValue3", 0, "MyVts")

Back to top

TCS.parameters.vts.addUniqueCell(colName, value, vtsName)

Sets the last field of a column to a value if the value does not exist in the column. Returns a value of 0 if a value is inserted. Returns a value of 1 if the value already exists.

Arguments

  • colName - The name of the column.
  • value - The value as a string.
  • vtsName - The alias of the VTS server.

Remarks

If the column specified in the argument does not exist, the column will be created and the cell content is set to the argument value.

Example

TCS.parameters.vts.addUniqueCell("MyColumn",1,"MyVTS")

Back to top

TCS.parameters.vts.clearCell(colName, rowIndex, vtsName)

Clears the data in a field.

Arguments

  • colName - The name of the column.
  • rowIndex - The index number of the field as an integer. 1 is the first field in the column.
  • vtsName - The alias of the VTS server.

Remarks

If the column or the row index specified in the argument does not exist, the step will run without returning an error and no data in the VTS will be changed.

Example

TCS.parameters.vts.clearCell("MyColumn",1,"MyVts")

Back to top

TCS.parameters.vts.clearColumn(colName, vtsName)

Clears all data in a column.

Arguments

  • colName - The name of the column.
  • vtsName - The alias of the VTS server.

Remarks

If the column specified in the argument does not exist, the step will run without returning an error and no data in the VTS is changed.

Example

TCS.parameters.vts.clearColumn("MyColumn","MyVts")

Back to top

TCS.parameters.vts.clearRow(rowIndex, vtsName)

Clears all data in a row.

Arguments

  • rowIndex - The index number of the field as an integer. 1 is the first field in the column.
  • vtsName - The alias of the VTS server.

Remarks

If the row specified in the argument does not exist, the step will run without returning an error and no data in the VTS is changed.

Example

TCS.parameters.vts.clearRow(1,"MyVts")

Back to top

TCS.parameters.vts.columnSize(colName, vtsName)

Returns the number of fields that contain data in a column.

Arguments

  • colName - The name of the column.
  • vtsName - The alias of the VTS server.

Remarks

If the column specified in the argument does not exist, the step will run without returning an error and the return value is 0.

Example

TCS.parameters.vts.ColumnSize("MyColumn","MyVts")

Back to top

TCS.parameters.vts.connect(serverName, port, vtsName)

Creates a connection to the server.

Arguments

  • serverName - Either the IP or server name.
  • port - The port number.
  • vtsName - The alias of the VTS server.

Example

TCS.parameters.vts.ColumnSize("MyServer", 8888, "MyVts")

Back to top

TCS.parameters.vts.createColumn(colName, vtsName)

Creates a column.

Arguments

  • colName - The name of the column.
  • vtsName - The alias of the VTS server.

Example

TCS.parameters.vts.createColumn("NewColumn","MyVts")

Back to top

TCS.parameters.vts.disconnect(vtsName)

Disconnects from the server.

Arguments

  • vtsName - The alias of the VTS server.

Example

TCS.parameters.vts.disconnect("MyVts")

Back to top

TCS.parameters.vts.dropIndex(colName, vtsName)

Deletes the index on a column.

Arguments

  • colName - The column name.
  • vtsName - The alias of the VTS server.

Remarks

If the column specified in the argument does not exist, the step will run without returning an error.

In addition, if the index has already been dropped on the column, the step will run without returning and error.

Example

TCS.parameters.vts.dropIndex("MyColumn", "MyVts")

Back to top

TCS.parameters.vts.ensureIndex(colName, vtsName)

Creates an index on a column.

Arguments

  • colName - The column name.
  • vtsName - The alias of the VTS server.

Remarks

If the column specified in the argument does not exist, the step will run without returning an error.

In addition, if the index has already been created on the column, the step will run without returning and error.

Example

TCS.parameters.vts.ensureIndex("MyColumn", "MyVts")

Back to top

TCS.parameters.vts.getCell(colName, rowIndex, vtsName)

Returns the data in a field.

Arguments

  • colName - The column name.
  • rowIndex - The index number of the field as an integer. 1 is the first field in the column.
  • vtsName - The alias of the VTS server.

Remarks

If the column name or index name specified in the argument does not exist, a null value will be returned.

Example

TCS.parameters.vts.getCell("MyColumn", 1, "MyVts")

Back to top

TCS.parameters.vts.getRowCells(rowIndex, vtsName)

Returns the data in a row as a javascript object. The properties of the object will be set to the column names.

Arguments

  • rowIndex - The index number of the field as an integer. 1 is the first field in the column.
  • vtsName - The alias of the VTS server.

Remarks

If the column specified in the argument does not exist, a null value will be returned for every column.

Example

TCS.parameters.vts.getRowCells(1, "MyVts")

Back to top

TCS.parameters.vts.increment(colName, rowIndex, value, vtsName)

Increments a counter stored in a field.

Arguments

  • colName - The name of the column.
  • rowIndex - The index number of the field as an integer. 1 is the first field in the column.
  • value - The value as a string.
  • vtsName - The alias of the VTS server.

Remarks

If the column name specified in the argument does not exist, the column will be created and the cell referenced by the index will be set to the argument value.

If the index specified in the argument exceeds the column size, the cell is created by the specified index and the cell contents is set to the argument value.

If the column referenced by the index contains a string, the cell contents are replaced with the value argument.

Example

TCS.parameters.vts.increment("MyColumn",1,1,"MyVTS")

Back to top

TCS.parameters.vts.popCell(colName, vtsName)

Pops the first field from a column.

Arguments

  • colName - The name of the column.
  • vtsName - The alias of the VTS server.

Example

TCS.parameters.vts.popCell("MyColumn","MyVts")

Back to top

TCS.parameters.vts.popCells(vtsName)

Pops the first field from a column.

Arguments

  • colName - The name of the column.
  • vtsName - The alias of the VTS server.

Remarks

None

Example

TCS.parameters.vts.popCells("MyVts")

Back to top

TCS.parameters.vts.popMultipleCells(vtsName)

Pops the first fields from specified columns. Returned as a javascript object. The properties of the object will be set to the column names.

Arguments

  • colName - The name of the column.
  • vtsName - The alias of the VTS server.

Remarks

If the column name specified in the argument does not exist, a null value will be returned.

Example

TCS.parameters.vts.popMultipleCells("MyColumn","MyVts")

Back to top

TCS.parameters.vts.rotateCell(colName, option, vtsName)

Retrieves the value from the first cell in the specified column and moves it to the bottom of the column.

Arguments

  • colName - The name of the column.

  • option - Define how the values are added:

    • 0 - Add as same row in all columns based on the column with the highest row count. The created row will be n+1 for all columns.

    • 1 - Add as stack - last row in every column.

    • 2 - Add as unique stack - last row in every column only if the value is unique in the column.

  • vtsName - The alias of the VTS server.

Remarks

None

Example

TCS.parameters.vts.rotateCell("MyColumn",1,"MyVts")

Back to top

TCS.parameters.vts.rotateCells(option, vtsName)

Retrieves the specific row and moves it to the last row in every column.

Arguments

  • option - Define how the values are added

    • 0 - Add as same row in all columns based on the column with the highest row count. The created row will be n+1 for all columns.

    • 1 - Add as stack - last row in every column.

    • 2 - Add as unique stack - last row in every column only if the value is unique in the column.

  • vtsName - The alias of the VTS server.

Remarks

None

Example

TCS.parameters.vts.rotateCells(0,"MyVts")

Back to top

TCS.parameters.vts.rotateMultipleCells(colNames, option, vtsName)

Retrieves values from specified columns and moves it to the last row in every column.

Arguments

colNames - The column names delimited by a semi-colon.

option - Define how the values are added:

  • 0 - Add as same row in all columns based on the column with the highest row count. The created row will be n+1 for all columns.

  • 1 - Add as stack - last row in every column.

  • 2 - Add as unique stack - last row in every column only if the value is unique in the column.

vtsName - The alias of the VTS server.

Remarks

None

Example

TCS.parameters.vts.rotateMultipleCells("MyColumn1;MyColumn2;MyColumn2", 0, "MyVts")

Back to top

TCS.parameters.vts.updateCell(colName, rowIndex, value, vtsName)

Replaces the data in a field.

Arguments

  • colName - The name of the column.
  • rowIndex - The index number of the field as an integer. 1 is the first field in the column.
  • value - The value as a string.
  • vtsName - The alias of the VTS server.

Remarks

If the column name or index does not exist, the column and/or the cell referenced by the index will be created and the cell contents set to the argument value.

Example

TCS.parameters.vts.updateCell("MyColumn",1,"MyValue","MyVTS")

Back to top

TCS.parameters.vts.updateEqualsCell(colName, rowIndex, value, comparedValue, vtsName)

Replaces the data in a field if the current data equals a given value. Returns a value of 0 if the value is updated. Returns a value of 1 if the value does not match the compare value.

Arguments

  • colName - The name of the column.
  • rowIndex - The index number of the field as an integer. 1 is the first field in the column.
  • value - The value as a string.
  • comparedValue - If the current cell contents are the same as the comparedValue, the cell contents are replaced with value.
  • vtsName - The alias of the VTS server.

Remarks

None

Example

TCS.parameters.vts.updateEqualsCell("MyColumn",1,"MyValue","MyCompareValue","MyVTS")

Back to top

TCS.parameters.vts.updateRowCells(colNames, rowIndex, values, vtsName)

Sets the values of the fields specified by columnNames in the row specified by rowIndex.

Arguments

  • colNames - The list of the columns to write to delimited by a semi-colon.
  • rowIndex - The index number of the field as an integer. 1 is the first field in the column.
  • values - The values as a string delimited by a semi-colon.
  • vtsName - The alias of the VTS server.

Remarks

None

Example

TCS.parameters.vts.updateRowCells("MyColumn1;MyColumn2;MyColumn2",1,1,"MyVTS")

Back to top

See also: