NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Unknown variable or property name 'CurrentUser' when I try to disable User Management in TestStand

Solved!
Go to solution

I am using Teststand 3.0.

 

I tried to disable User Management in TestStand according to the NI support document (The first way in the following links):

 

http://digital.ni.com/public.nsf/allkb/4979F8FDB7ED698B8625712B000CFD14

 

After I put following expression into Statement

RunState.Engine.CurrentUser = RunState.Engine.GetUser("administrator")

 

Teststand popup following Run-Time error message:

 

Details:

The post-expression for the step 'Statement' could not be evaluated.
Unknown variable or property name 'CurrentUser'.

 

Error Code:

-17306; Unknown variable or property name.

 

Location:

Step 'Statement' of sequence 'LoginLogout' in 'FrontEndCallbacks.seq'

 

 

Does anybody know what cause this error?

 

Thanks,

 

Ben

0 Kudos
Message 1 of 3
(3,510 Views)
Solution
Accepted by Benw327

API in Expressions was not supported until TestStand 4.0.  You will have to use two ActiveX steps to do the same thing.  The first step will call the Engine.GetUser method and return a value that you can store in a local variable.  You can then use that local variable in a second ActiveX step using the Engine.CurrentUser property and set it to the value of the local variable you got from the first step.

0 Kudos
Message 2 of 3
(3,498 Views)

Thank you very much, this solved my problem.

 

Ben

0 Kudos
Message 3 of 3
(3,490 Views)