Printer FriendlyEmail Article Link

Spirent TestCenter - Automation: How to move to change workspace when using AION licensing?

Environment/Versions
STC Native API
Answer
The command you need is "TemevaSetWorkspace", following is the documentation for it.

Object: TemevaSetWorkspaceCommand
 Sets Temeva Workspace for current user.

 Writable Attributes:
   EnableForceExecution   - Indicates whether force execution of the command is enabled.
      Type      bool      Default   false
      Category  input
   Workspace   - Workspace name to use
      Type      string      Default   
      Category  input

 Read-Only Attributes:

Following is a sample script:
import json
from StcPython import StcPython
stc = StcPython()

stc.perform("TemevaSignIn", server="your_server_ip_or_name", username="your_username", password="your_password")
ret_json = json.loads(stc.perform("TemevaGetWorkspaceList")['WorkspaceInfoJson'])
print(f"Current workspace: {ret_json['current_workspace']['name']}")
stc.perform("TemevaSetWorkspaceCommand", workspace="Spirent") # insert the name of the new workspace
ret_json = json.loads(stc.perform("TemevaGetWorkspaceList")['WorkspaceInfoJson'])
print(f"Current workspace: {ret_json['current_workspace']['name']}")

Product : Automation,Spirent TestCenter