Using System and Environment Variables in your scripts

Chris ColosimoChris Colosimo Posts: 98 admin
edited February 2017 in Virtualize

You can use system/ environment variables in your scripts. Here is a simple example

from com.parasoft.api import *
from java.lang import System

def systemVariables (input, context):
    #This is for Windows
    Application.showMessage("COMPUTERNAME = " + str(System.getenv("COMPUTERNAME")))

    #This is for Linux
    #Application.showMessage("COMPUTERNAME = " + str(System.getenv("HOSTNAME")))

Here are a few nice web pages that provide what variables are available



Sign In or Register to comment.