NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Missing UUT Report Operator

Solved!
Go to solution

I have a situation (mandated by the customer) where we do a double login.  What I mean is that when we bring up TestStand, the normal login popup appears.  Then, after loading a test sequence, and clicking TEST UUTs, another login needs to popup to register the Operator name.  So, in the bottom left, it may say Admin (original login) and in the UUT Report Header, it will say (i.e.) "Joe Operator" to the right of the "Operator:" field.  Incidentally, I added a sequence that allows us to add/edit users at runtime. 

 

With all that as a prefix, I've attached several images that show (0) the situation I'm trying to resolve, (1) the call I added to request another login prompt, (2) the contents of the User Identification sequence.

 

I'm wondering what variable(s) I need to set such that the login name provided in login#2 shows up as the Operator: ???

0 Kudos
Message 1 of 13
(2,527 Views)

Couple questions and thoughts:

 

First of all this seems like an odd thing for them to request.  Why do they need the user interface to show that an Administrator is logged in?  Why do they care if there are 2 levels of login?

 

TestStand can only have 1 user at a time.  Otherwise how do privileges get checked? 

 

Basically it feels like they need an edit-time user and an execution-time user.  But I don't understand why they need to be logged in at the same time.  Why couldn't you just have the user login when execution begins (like you are doing) and then when execution ends log the old user back in automatically?

 

The Operator field is populated by who is logged into TestStand.  Calling Engine.DisplayLoginDialog does not actually change the TestStand User.  It just returns a true if they clicked OK and the user object.  Are you passing Locals.UserRef to Login New User step?  What is Locals.UserRef set to after the dialog executes?  It's almost like Locals.UserRef is set to Null and the Login New User Step is logging in nobody.

 

Maybe you want to check the User Ref to make sure it is not Null before calling Logout and Login?

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 2 of 13
(2,514 Views)

I threw together an example.

 

You could encase it in looping to until the user is properly logged in or whatever.  But you can see how to check if the user is Null.

 

Hope this helps,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 3 of 13
(2,512 Views)

From the Test UUTs entry point, the only thing i pass into the sequence that ultimately calls the DisplayLoginDialog, is Locals.ContinueTesting.  I'm not really sure if i'm even using that just yet.

 

Within the sequence, the Locals.UserRef is set to "ATE_Technician" (in this case) after the dialog executes.  After I inserted your code snippet, the User (bottom left) also changed to ATE_Technician, but the Operator (in the report header) still shows "No Operator Logged In" when I complete the test.

0 Kudos
Message 4 of 13
(2,506 Views)

When you start the test what is shown in the bottom left of the UI?

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 5 of 13
(2,503 Views)

Admin.  I intentionally pick something different when I get to the second login.

0 Kudos
Message 6 of 13
(2,501 Views)

A couple thoughts:

Remove any Watch Expressions.  I've seen where someone has been testing stuff out and left a watch expression that would log the user back out.

 

Create a new sequence file and override ProcessSetup.  Place my code in there.  Run with the default process model.  What does the report say then?

 

Somehow the user is getting logged out or the plugin is getting no user logged in. It has to be something you are either doing in your sequence file, process model or watch expression causing this.

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
Message 7 of 13
(2,498 Views)

so I did what you suggested (created new seq, overrode the process setup and copied your code into it) and now I see something odd where the operator displayed is always the previous one I used.  The first time through I left all the watch variables on, then I removed them and restarted teststand, since things were pretty squirrely. After restarting, and no watches, the same odd behavior.

0 Kudos
Message 8 of 13
(2,487 Views)

My guess is that the plugin is getting the user before it gets to any of your callbacks or code.  If you make the User Login the very first thing in the Entry Point of your process model it will work.  I don't have time to try and track down where it is setting the user in the header right now.  All I know is that if you log in very first thing in the process model it will work.

 

Hope this helps,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 9 of 13
(2,481 Views)

I tried at the beginning of the entry point, and that didn't work either.  Just not sure what I'm doing wrong.  I tried searching for the string "No operator logged in" to see if that would offer a clue, but I couldn't find it.

0 Kudos
Message 10 of 13
(2,477 Views)