global variable

Define a global variable and (optionally) assign a value to it, or assign a value to an existing global variable.
NameDescriptionTypeModifier
name

Name of the global variable.

StringNone
value

(Optional) Value to assign to the variable.

StringNone
None
This action may be used within the following project items: test modules and user-defined actions.
The following settings are applicable to this action: remove double quotes from cells.
Action lines
        
        	name	value
global variable	i	5
        
    
        
        	name	value
local variable	x	1
&nbsp		
	condition to run	
while	#x<i	
&nbsp		
	name	value
local variable	y	#x * 2
&nbsp		
	text	
report	#"The value of the local variable y: " & y	
&nbsp		
	variable	value
set variable	x	#x + 1
&nbsp		
end while		
        
    
Result
  • A global variable, subsequent to its declaration, is visible throughout all test modules and invoked actions within one execution run.
  • For a given execution of global variable, if name specifies a global variable that already exists, the action merely assigns a new value (in the value argument) to the existing variable.
  • Restrictions on usage:
    • A variable may not be declared within a use data set block if it has the same name as any of the data set headers.
    • Same-named local and global variables may not be declared within the same local variable scope level.
  • Use variables within pound sign (#) expressions to access their contained values.

Copyright © 2024 LogiGear Corporation. All rights reserved. LogiGear is a registered trademark, and Action Based Testing and TestArchitect are trademarks of LogiGear Corporation. All other trademarks contained herein are the property of their respective owners.

LogiGear Corporation

1730 S. Amphlett Blvd. Suite 200, San Mateo, CA 94402

Tel: +1 (650) 572-1400