Reply
Member
venkatb
Posts: 5
Registered: 02-09-2010
0
Accepted Solution

Not able to use the variables stored from the response

Hi ,

 I am trying to find the average of two numbers.

 For this I used linux 'od -An  -N2 -i /dev/random %100' command.

 I run this commands twice and storing the returned response into $randvalue1 and $randvalue2.

 

 When I try to find the average of those to values by ' set z [expr [expr $randvalue1 + $randvalue2]/2]'

iTest is reporting error that $randvalue1 is not found.

 

I am attaching the test and the report here.

 

If anybody can pointme how to do this, that would be greatful.

 

Thanks,
Venkat

 

Community Leader
PaulD
Posts: 1,210
Registered: 09-02-2008

Re: Not able to use the variables stored from the response

The problem is that you checked the box that stored randvalue1 in a global variable.  But $randvalue1 will only find a local variable with that name.  If you need to fetch it from a global variable, then you need to use [gget randvalue1].

 

I suspect that you don't need to make this global anyway.  Right?

Member
venkatb
Posts: 5
Registered: 02-09-2010
0

Re: Not able to use the variables stored from the response

Thanks Paul.

It worked the way without global variable.