Upload
interlatintest-division
View
243
Download
13
Embed Size (px)
DESCRIPTION
.NET Action Library
Citation preview
TestExec SL 7.1
.NET Actions .NET Hardware Handler .NET Operator UI
TestExec SL Training .NET Actions
1
TestExec SL Training .NET Actions
2
.NET Action
.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
Create a .NET Action Library (I) C# Method (I)
TestExec SL Training .NET Actions
4
Create a .NET Action Library (I) C# Method (II)
TestExec SL Training .NET Actions
5
Constructor
Member Function
Create a .NET Action Library (I) VB Method (I)
TestExec SL Training .NET Actions
6
Create a .NET Action Library (I) VB Method (II)
TestExec SL Training .NET Actions
7
Member Function
Constructor
Create a .NET Action Library (II)
TestExec SL Training .NET Actions
8
1) File -> New 2) Select the .NET Action Style
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”
Create a .NET Action Library (IV)
TestExec SL Training .NET Actions
10
DLL Class Name
Choose the correct Member Function
Create a .NET Action Library (VI)
TestExec SL Training .NET Actions
11
If there is constructors for the selected class, it will appear here
Create a .NET Action Library (VII)
TestExec SL Training .NET Actions
12
At the Lifetime tab Instance Reference
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.
Running .NET Action (I)
TestExec SL Training .NET Actions
14
Reference/ pointer to object that will operated upon
TestExec SL Training .NET Actions
15
Lab 7: Understanding Instance Lifetime
Running .NET Action (II)
TestExec SL Training .NET Actions
16
Result
The “Advance” button is to fit initialize constructor into it.
Debugging .NET Actions Method 1 (I)
TestExec SL Training .NET Actions
17
1) Right click on project solution, select properties
Debugging .NET Actions Method 1 (II)
TestExec SL Training .NET Actions
18
2) Select the tstexcsl.exe from $INSTDIR\bin
3) Working directory is $INSTDIR\bin
$INSTDIR is TxSL installation directory
Debugging for .NET Actions Method 2 (I) 1) Start TestExec SL application
2) Attached to process
TestExec SL Training .NET Actions
19
Debugging for .NET Actions Method 2 (II) 3) Select tstexcsl.exe and attached the process
TestExec SL Training .NET Actions
20
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
TestExec SL Training .NET Actions
22
Lab 8: Create a .NET Actions
TestExec SL Training .NET Actions
23
.NET Hardware Handler
.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
Creating .NET Hardware Handler (C#) (I)
TestExec SL Training .NET Actions
25
NOTE: Starting TestExec SL 7.1, .NET 4.0 is supported
Creating .NET Hardware Handler (C#) (II)
TestExec SL Training .NET Actions
26
2 predefinded interfaces in TestExec SL Hardware Hanlder are:- IHandlder Members
Init DeclareParms Close Reset
IHandlerEx Members Unload Deactivate Load Activate
Creating .NET Hardware Handler (C#) (III)
TestExec SL Training .NET Actions
27
IHanlder members are:- Init DeclareParms Close Reset
Creating .NET Hardware Handler (C#) (IV)
TestExec SL Training .NET Actions
28
IHandlerEx members are:- Unload Deactivate Load Activate
Creating .NET Hardware Handler (C#) (V)
TestExec SL Training .NET Actions
29
Add library files as reference
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.
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
Creating .NET Hardware Handler C# (VIII)
TestExec SL Training .NET Actions
32
Creating .NET Hardware Handler C# (IX)
TestExec SL Training .NET Actions
33
Creating .NET Hardware Handler C# (X)
TestExec SL Training .NET Actions
34
Creating .NET Hardware Handler C# (XI)
TestExec SL Training .NET Actions
35
Creating .NET Hardware Handler C# (XII)
TestExec SL Training .NET Actions
36
Creating .NET Hardware Handler C# (XIII)
TestExec SL Training .NET Actions
37
Make sure this is checked
Adding .NET Hardware Handler in system.ust (I)
TestExec SL Training .NET Actions
38
Make sure this is unchecked
Adding .NET Hardware Handler in system.ust (II)
TestExec SL Training .NET Actions
39
Creating the Handler Action
TestExec SL Training .NET Actions
40
In the Testplan
TestExec SL Training .NET Actions
41
TestExec SL Training .NET Actions
42
Lab 9: Create a .NET Hardware
Handler (C#)
Creating .NET Hardware Handler in VB.NET (I)
TestExec SL Training .NET Actions
43
Creating .NET Hardware Handler in VB.NET (II)
TestExec SL Training .NET Actions
44
2 predefnied interfaces in TestExec SL Hardware Handler are:- IHanlder Members
Init DeclareParms Close Reset
IHandlerEx Members Unload Deactivate Load Activate
Creating .NET Hardware Handler in VB.NET (III)
TestExec SL Training .NET Actions
45
IHanlder members are:- Init DeclareParms Close Reset
Creating .NET Hardware Handler in VB.NET (IV)
TestExec SL Training .NET Actions
46
IHandlerEx members are:- Unload Deactivate Load Activate
Creating .NET Hardware Handler in VB.NET (V)
TestExec SL Training .NET Actions
47
Creating .NET Hardware Handler in VB.NET (VI)
TestExec SL Training .NET Actions
48
TestExec SL Training .NET Actions
49
Demo 8: .NET Hardware Handler (VB)
TestExec SL Training .NET Actions
50
Operator Interface (.NET version)
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:\Windows\SysWOW64” Windows 7 64-bit “C:\Windows\system32” 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.
TestExec SL Training .NET Actions
52
Lab 10: Creating a Simple .NET Operator User Interface
TestExec SL Op UI Example
VB6 SimpleOpUI • C:\Program Files\Agilent\TestExec SL x.x\SimpleOpUI • Get started with TxSL
TypicalOpUI • C:\Program Files\Agilent\TestExec SL x.x\TypicalOpUI • Default Operator User Interface • Source code provided for modification
MultipleOpUI • C:\Program Files\Agilent\TestExec SL x.x\MultipleOpUI • Targets throughput multiplier applications • Source code provided for modification
.NET TypicalOpUI.NET • C:\Program Files\Agilent\TestExec SL x.x\TypicalOpUI.NET • Default Operator User Interface • Source code provided for modification
MultipleOpUI.NET • C:\Program Files\Agilent\TestExec SL x.x\MultipleOpUI.NET • Targets throughput multiplier applications • Source code provided for modification
TestExec SL Training .NET Actions
53