Cancel Token Source

Verb: cancelToken

Cancels the continuous action of a command associated to a cancel token.

Syntax

cancelToken --token(CancellationTokenSource)

Inputs

Script Designer Required AcceptedTypes Description
--token Cancel token source Required Cancellation Token Source Cancel Token, returned by continuous execution commands, used to manage which command should be canceled.

Example

Wait for a Notepad window identified by regular expression. Each time the Launch and Attach Window command opens a Notepad window, the Watch and Close Window command closes the window automatically. Using the cancel token stored in the token parameter, the Cancel Token Source command cancels the continuous action and the Notepad window is no longer closed automatically.

defVar --name windowNotepad --type Window
defVar --name token --type CancellationTokenSource
watchAndCloseWindow --useregex  --regexPattern Notepad --regexOptions "IgnoreCase" --processname notepad --recursive  token=value
launchWindow --executablepath "C:\\Windows\\notepad.exe" windowNotepad=value
launchWindow --executablepath "C:\\Windows\\notepad.exe" windowNotepad=value
cancelToken --token ${token}
launchWindow --executablepath "C:\\Windows\\notepad.exe" windowNotepad=value
//watchAndCloseWindow automatically closes new Notepad windows.
//After canceling the continuous action with the Cancel Token Source command, new Notepad windows are no longer closed.

Remarks

Some continuous execution commands, such as Watch and Close Window and Watch and Set Credentials in Browser, return a cancellation token, which can be used by the Cancel Token Source command to cancel such continuous action in the process in which it is set.

See Also

  • Attach Window
  • Clear Cache
  • Click
  • Click on Cell
  • Click on Menu
  • Click on Value
  • Close Window
  • Control Screenshot
  • Count Windows
  • Expand Tree
  • Find Window
  • Find Windows
  • Focus
  • Focus Window
  • Get Barcode
  • Get Bounds
  • Get Cell Value
  • Get Control
  • Get Image Grid
  • Get Interval
  • Get Options
  • Get Table
  • Get Table Information
  • Get Tree Nodes
  • Get Value
  • Handle Open File Dialog
  • Handle Save File Dialog
  • Launch and Attach Window
  • Launch or Attach Window
  • Map Image Grid
  • Maximize or Minimize Window
  • Offset Value
  • Screenshot Window
  • Select Row
  • Select Tab
  • Set Execution Throttling
  • Set Grid Value
  • Set Value
  • Update Window
  • Verify Enabled
  • Verify If Visible
  • Wait and Close Security Window
  • Wait Busy Window
  • Wait Control
  • Wait for Control to Enable
  • Wait for Window to Appear
  • Watch and Close Window