53
TestExec SL 7.1 .NET Actions .NET Hardware Handler .NET Operator UI TestExec SL Training .NET Actions 1

TestExec SL 7.1

Embed Size (px)

DESCRIPTION

.NET Action Library

Citation preview

Page 1: TestExec SL 7.1

TestExec SL 7.1

.NET Actions .NET Hardware Handler .NET Operator UI

TestExec SL Training .NET Actions

1

Page 2: TestExec SL 7.1

TestExec SL Training .NET Actions

2

.NET Action

Page 3: TestExec SL 7.1

.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

Page 4: TestExec SL 7.1

Create a .NET Action Library (I) C# Method (I)

TestExec SL Training .NET Actions

4

Page 5: TestExec SL 7.1

Create a .NET Action Library (I) C# Method (II)

TestExec SL Training .NET Actions

5

Constructor

Member Function

Page 6: TestExec SL 7.1

Create a .NET Action Library (I) VB Method (I)

TestExec SL Training .NET Actions

6

Page 7: TestExec SL 7.1

Create a .NET Action Library (I) VB Method (II)

TestExec SL Training .NET Actions

7

Member Function

Constructor

Page 8: TestExec SL 7.1

Create a .NET Action Library (II)

TestExec SL Training .NET Actions

8

1) File -> New 2) Select the .NET Action Style

Page 9: TestExec SL 7.1

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”

Page 10: TestExec SL 7.1

Create a .NET Action Library (IV)

TestExec SL Training .NET Actions

10

DLL Class Name

Choose the correct Member Function

Page 11: TestExec SL 7.1

Create a .NET Action Library (VI)

TestExec SL Training .NET Actions

11

If there is constructors for the selected class, it will appear here

Page 12: TestExec SL 7.1

Create a .NET Action Library (VII)

TestExec SL Training .NET Actions

12

At the Lifetime tab Instance Reference

Presenter
Presentation Notes
The Instance Reference parameter allows you to define the symbol table entry that will contain the reference to the class instance
Page 13: TestExec SL 7.1

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.

Page 14: TestExec SL 7.1

Running .NET Action (I)

TestExec SL Training .NET Actions

14

Reference/ pointer to object that will operated upon

Page 15: TestExec SL 7.1

TestExec SL Training .NET Actions

15

Lab 7: Understanding Instance Lifetime

Page 16: TestExec SL 7.1

Running .NET Action (II)

TestExec SL Training .NET Actions

16

Result

The “Advance” button is to fit initialize constructor into it.

Page 17: TestExec SL 7.1

Debugging .NET Actions Method 1 (I)

TestExec SL Training .NET Actions

17

1) Right click on project solution, select properties

Page 18: TestExec SL 7.1

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

Page 19: TestExec SL 7.1

Debugging for .NET Actions Method 2 (I) 1) Start TestExec SL application

2) Attached to process

TestExec SL Training .NET Actions

19

Page 20: TestExec SL 7.1

Debugging for .NET Actions Method 2 (II) 3) Select tstexcsl.exe and attached the process

TestExec SL Training .NET Actions

20

Page 21: TestExec SL 7.1

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

Page 22: TestExec SL 7.1

TestExec SL Training .NET Actions

22

Lab 8: Create a .NET Actions

Page 23: TestExec SL 7.1

TestExec SL Training .NET Actions

23

.NET Hardware Handler

Page 24: TestExec SL 7.1

.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

Page 25: TestExec SL 7.1

Creating .NET Hardware Handler (C#) (I)

TestExec SL Training .NET Actions

25

NOTE: Starting TestExec SL 7.1, .NET 4.0 is supported

Page 26: TestExec SL 7.1

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

Page 27: TestExec SL 7.1

Creating .NET Hardware Handler (C#) (III)

TestExec SL Training .NET Actions

27

IHanlder members are:- Init DeclareParms Close Reset

Page 28: TestExec SL 7.1

Creating .NET Hardware Handler (C#) (IV)

TestExec SL Training .NET Actions

28

IHandlerEx members are:- Unload Deactivate Load Activate

Page 29: TestExec SL 7.1

Creating .NET Hardware Handler (C#) (V)

TestExec SL Training .NET Actions

29

Add library files as reference

Page 30: TestExec SL 7.1

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.

Page 31: TestExec SL 7.1

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

Presenter
Presentation Notes
If Copy Local is enabled, this makes the DLL as a local copy at the debug or release folder. This will minimize some unwanted problems during debug. If Embed Interop Types is enabled, all the classes of the reference will be displayed at the “Class Name” section when creating .NET action with TestExec SL. This is because TestExec SL is using reflection method. Enabling this will confuse the user on which class name he/ she should select.
Page 32: TestExec SL 7.1

Creating .NET Hardware Handler C# (VIII)

TestExec SL Training .NET Actions

32

Page 33: TestExec SL 7.1

Creating .NET Hardware Handler C# (IX)

TestExec SL Training .NET Actions

33

Page 34: TestExec SL 7.1

Creating .NET Hardware Handler C# (X)

TestExec SL Training .NET Actions

34

Page 35: TestExec SL 7.1

Creating .NET Hardware Handler C# (XI)

TestExec SL Training .NET Actions

35

Page 36: TestExec SL 7.1

Creating .NET Hardware Handler C# (XII)

TestExec SL Training .NET Actions

36

Page 37: TestExec SL 7.1

Creating .NET Hardware Handler C# (XIII)

TestExec SL Training .NET Actions

37

Make sure this is checked

Presenter
Presentation Notes
Setting “Make Assembly COM-Visible” will make sure that hardware handler in .NET runs smoothly. Else, an error will be prompted whereby the instance is not found during execution of testplan.
Page 38: TestExec SL 7.1

Adding .NET Hardware Handler in system.ust (I)

TestExec SL Training .NET Actions

38

Make sure this is unchecked

Page 39: TestExec SL 7.1

Adding .NET Hardware Handler in system.ust (II)

TestExec SL Training .NET Actions

39

Page 40: TestExec SL 7.1

Creating the Handler Action

TestExec SL Training .NET Actions

40

Page 41: TestExec SL 7.1

In the Testplan

TestExec SL Training .NET Actions

41

Page 42: TestExec SL 7.1

TestExec SL Training .NET Actions

42

Lab 9: Create a .NET Hardware

Handler (C#)

Page 43: TestExec SL 7.1

Creating .NET Hardware Handler in VB.NET (I)

TestExec SL Training .NET Actions

43

Page 44: TestExec SL 7.1

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

Page 45: TestExec SL 7.1

Creating .NET Hardware Handler in VB.NET (III)

TestExec SL Training .NET Actions

45

IHanlder members are:- Init DeclareParms Close Reset

Page 46: TestExec SL 7.1

Creating .NET Hardware Handler in VB.NET (IV)

TestExec SL Training .NET Actions

46

IHandlerEx members are:- Unload Deactivate Load Activate

Page 47: TestExec SL 7.1

Creating .NET Hardware Handler in VB.NET (V)

TestExec SL Training .NET Actions

47

Page 48: TestExec SL 7.1

Creating .NET Hardware Handler in VB.NET (VI)

TestExec SL Training .NET Actions

48

Page 49: TestExec SL 7.1

TestExec SL Training .NET Actions

49

Demo 8: .NET Hardware Handler (VB)

Page 50: TestExec SL 7.1

TestExec SL Training .NET Actions

50

Operator Interface (.NET version)

Page 51: TestExec SL 7.1

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.

Page 52: TestExec SL 7.1

TestExec SL Training .NET Actions

52

Lab 10: Creating a Simple .NET Operator User Interface

Page 53: TestExec SL 7.1

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