3. .NET Action Library
⢠Supported action routines
ď Execute
ď Cleanup
⢠Language supported
ď C#
ď VB.NET
⢠Compiled to .NET assemblies, typically dynamic link libraries (DLLs)
⢠Each assemblies can contain 1 or more action routines
TestExec SL Training
.NET Actions
3
4. Create a .NET Action Library (I)
C# Method (I)
TestExec SL Training
.NET Actions
4
5. Create a .NET Action Library (I)
C# Method (II)
TestExec SL Training
.NET Actions
5
Constructor
Member Function
6. Create a .NET Action Library (I)
VB Method (I)
TestExec SL Training
.NET Actions
6
7. Create a .NET Action Library (I)
VB Method (II)
TestExec SL Training
.NET Actions
7
Member Function
Constructor
8. Create a .NET Action Library (II)
TestExec SL Training
.NET Actions
8
1) File -> New
2) Select the .NET Action
Style
9. Create a .NET Action Library (III)
TestExec SL Training
.NET Actions
9
.NET DLL
1
2
3
1. Click on âFound in Search Pathsâ
If the DLL is Microsoft Common Runtime
Library, choose âCore .NET Librariesâ
2. Select the correct .NET DLL
3. Uncheck on âInclude directory
pathâ
10. Create a .NET Action Library (IV)
TestExec SL Training
.NET Actions
10
DLL Class Name
Choose the correct
Member Function
11. Create a .NET Action Library (VI)
TestExec SL Training
.NET Actions
11
If there is constructors
for the selected class, it
will appear here
12. Create a .NET Action Library (VII)
TestExec SL Training
.NET Actions
12
At the Lifetime tab
Instance
Reference
13. Create a .NET Action Library (VIII)
TestExec SL Training
.NET Actions
13
Instance lifetime allows one to specify
when an instance of the class should
be created and released.
Create New Instance:
Use the drop down arrow to select when
the new instance should be created:
Always at Testplan Prerun
If Doesn't Exist at Testplan Prerun
If Doesn't Exist at Action Setup
Always at Action Setup
Release Reference:
Use the drop down arrow to select when
the new instance should be released:
At Testplan Postrun
At Action Cleanup
Call Dispose on Release:
Use the drop down arrow to select
whether dispose should be called on
release:
Yes, If Exposed
No
Output Value
If this parameter/symbol will return values,
check the Action Output box.
14. Running .NET Action (I)
TestExec SL Training
.NET Actions
14
Reference/ pointer to object
that will operated upon
16. Running .NET Action (II)
TestExec SL Training
.NET Actions
16
Result
The âAdvanceâ button is to
fit initialize constructor into
it.
17. Debugging .NET Actions
Method 1 (I)
TestExec SL Training
.NET Actions
17
1) Right click on project solution, select properties
18. Debugging .NET Actions
Method 1 (II)
TestExec SL Training
.NET Actions
18
2) Select the
tstexcsl.exe from
$INSTDIRbin
3) Working directory
is $INSTDIRbin
$INSTDIR is TxSL
installation directory
19. Debugging for .NET Actions
Method 2 (I)
1) Start TestExec SL application
2) Attached to process
TestExec SL Training
.NET Actions
19
20. Debugging for .NET Actions
Method 2 (II)
3) Select tstexcsl.exe and attached the process
TestExec SL Training
.NET Actions
20
21. Debugging for .NET Actions
Method 3 (III)
4) Start testplan in TestExec SL containing the action
5) Start running
TestExec SL Training
.NET Actions
21
24. .NET Style of Hardware Handler
⢠Hardware Handler can be written in .NET Style as well.
⢠TestExec SL Dot Net Hardware Handler templates that are
installed when user installed TestExec SL:
ď C#
ď VB.NET
TestExec SL Training
.NET Actions
24
29. Creating .NET Hardware Handler (C#) (V)
TestExec SL Training
.NET Actions
29
Add library files as reference
30. Creating .NET Hardware Handler C# (VI)
TestExec SL Training
.NET Actions
30
The reference files that must
be included are as shown.
These are located in
$INSTDIR$bin
User can reference other
libraries if needed.
31. Creating .NET Hardware Handler C# (VII)
TestExec SL Training
.NET Actions
31
Recommendation:
The references properties are set:-
Copy Local : True
Embed Interop Type : False
51. Adding TestExec SL Control to Your Toolbox
TestExec SL Training
.NET Actions
51
Choose Toolbox | (right click) Choose Item | COM components in .Net
Choose the Browse button and locate the TestExec SL control, which is
in file âtxslctl.ocxâ in directory
âC:WindowsSysWOW64â ď Windows 7 64-bit
âC:Windowssystem32â ď Windows XP / 7 32-bit
Make sure the box next to âAgilent TestExecSL ActiveX Control Library
is checked.
Choose the OK button.
Once the TestExec SL control appears in Visual Basicâs Toolbox, you
can use the mouse to place it on a form as you would any other control.