TestAssistant


Outline
It is a tool for helping creation of the test using Friendly.
It will not create tests in magic like Wizard, and will help your creation of tests as an assistant.
Therefore, in order to master it, you needs to understand Friendly.
It's not so difficult to understand it because Cooder.Friendly is made of few and easy classes and methods.
     Thank you for your consideration.

Moreover, although script can be executed, it is not test environments.
The code created here should move to test platforms, such as NUnit, by copy and paste.
And the sample for getting an outline is also prepared.
Please check it if you not.




Features
1. Analysis of Window compositions
The specific method of a child element is troubled in the case of GUI test creation.
When running tests recurrently, it must be able to specify by the same method each time.
However, there are various windows in a world(it is generated dynamically, changed size or etc).
So "methods which is trustworthy to all the windows" does not exist easily.
Therefore, Friendly provides two or more window specific methods.
In this tool, the information for window specification is easily acquirable.

2. Acquisition of the model information which can be used
Friendly can call the public operations inside application as a powerful function of Friendly.
Although it is a class of .net to which many are used, and the class which created by yourself,
we think that there are no people who remember all.
In TestAssistant, you can easily acquire the information on the model which can be operated.

3. Assistant to create codes
You can generate the codes for operation from the information acquired by 1 or 2.
However, it is a code like the simple version of intellisense.
In order to use, the knowledge of the library of Friendly or C# is needed.
Moreover, you can create easily the simple template for running by NUnit.

4 Execution of script for checking
The created code can be executed.
We think that test environment is created by Visual Studio or NUnit,
and you can try codes once before moving them.
By administrator authority, when target application has special authority, it may be unable to connect.
Please restart by the authority that the target application for can be tested.

Platform target, .NetFramework version, and Authority
Firstly it is necessary to unite with the test target application.

- Platform target
Those who are using 32bitOS do not need to be conscious.
It is necessary to choose TestAssistant by whether target application of 64bitOS is the 32-bit applications which operate on Wow64 or 64-bit application.
Since both Codeer.TestAssistant_x86 and Codeer.TestAssistant_x64 are installed,
please use it which corresponds to the target application.


- CLR version
It is a version of CLR which is using the application for a test instead of a test process.
It uses 2.0-3.5 and 2.0 for native application.
It's not neccesary to specify a client profile here.
It supports 2.0 and 4.0 now.
(On a combo box, "2.0 (Non, 2.0-3.5)" or "4.0 (4.0, 4.5)" are chosen.)

- Authority
When an target application is administrator authority, it is necessary to start TestAssistant
by administrator authority.

Please select an application starting icon, right-click pushing the Shift button and choose execution
by administrator authority.



Main Screen
①Select test target process(Ctrl+N)
The processes of connection candidate are displayed.
You can select by pushing Enter key or a double click after sellecting.

②Target applications .NetFramework version
It's not test process. It's .Netframework version used by test target application.
2.0-3.5 or 2.0 in the case of Native applications are used.
It's not necessary to select client profile here.
It supports 2.0 and 4.0.
It also support 3.0 and 3.5 by selecting 2.0.
In a combo box, 「Non, 2.0-3.5」 or 「4.0」 should be selected.

③Analisis active window(Ctrl+Q)
An active window is analyzed in a target process.
A window analysis screen is displayed.
When there is no window in a proper position, a picture may be unable to be acquired correctly.
Moreover, also when a setup of screens, such as DPI, is not a default, it may be unable to acquire correctly.

An active window is analyzed in an object process now.
A window analysis screen is displayed.
When there is no window in a proper position, a picture may be unable to be acquired correctly.
Moreover, also when a setup of screens, such as DPI, is not a default, it may be unable to acquire correctly.


Analisis active window after 5 seconds(Shift+Ctrl+Q)
An active window is analyzed 5 seconds after pushing the button.
It is used at the time of the analysis of the window which will disappear if a focus is lost.
When there is no window in a proper position, a picture may be unable to be acquired correctly.
Moreover, also when a setup of screens, such as DPI, is not a default, it may be unable to acquire correctly.

⑤Type acquisition(Ctrl+T)
The type information which can be accessed now is displayed in an target process.
Since the assembly of .Net is a delay load, it is not displayed if target application is not loaded with the type originally used at the analysis time.

⑥Execute script行(F5)(Only compile is F6)
The script described to the operation code simple checking editor of ⑩ is run.
Please push F6 to check whether it can compile, without running a script.

⑦Generation of NUnit Template codes(F4)
The template code of NUnit is generated.
Please edit a namespace, a class name, and a method name freely.


⑧Imfomation(F1)

Version information is displayed.
(assembly version : file version) is displayed.
Since a picture is the assembly currently packed up by β9, it is 0.9.9.0.
And the function is due to add TestAssistant in plug-in form from now on.
In that case, the information on the assembly by which the present plug-in is carried out is also displayed.
Plug-in of a picture is a sample.

⑨region using
You can add using used with a script.
Moreover, reference can be added from the reference setup key of a using screen.
A picture is a capture in case sample plug-in is used.



⑩Simple test code checking editor
A test code can be described on a check.
It's described with C#.
This script itself corresponds only to .Net2.0.
However, the used dll can call to .Net3.5.
Moreover, if the method of explaining with "the modification method of script execution runtime" is used, it is possible to also call dll of 4.0 and 4.5.
And when bringing to environment, such as NUnit, naturally, it can compile by 2.0 or more .NetFramework.
There are the following right-click menus.


Asynchronous execution
   The asynchronous execution object, Async is generated.
   Please refer here about Async.

Waiting for the forefront window display of the following Z coordinate.
   WaitForNextZTop of WindowControl is called.
   Please refer here about WindowControl.

Compile checker (F6)
   The script is compiled and it is checked whether there is any compile error.

- The modification method of script execution runtime
      The execution runtime of a script can be changed by placing Codeer.TestAssistant.Script_x64.exe.config. and
   Codeer.TestAssistant.Script_x86.exe.config to the installation folder of TestAssistant.
   Moreover similarly,
the execution runtime of the TestAssistant itself can also be changed
   by
placing Codeer.TestAssistant.exe.config and Codeer.TestAssistant_x64.exe.config.
   That this is needed is a case where
dll created by 4.0 or 4.5 are called from a script. 
   Moreover, it is a case where the class which carries out plug-in is created by 4.0 or 4.5 about TestAssistant.
   Since we prepared the file, please download it from here and put it into an installation folder.
   Moreover, please refer the website of Microsoft about the content of a config file.
   When the version of runtime is changed, please rewrite it.


Window analysis screen

The window for test target is analyzed.
The specific method of a child element can be determined based on the information acquired here.
It is divided into the following parts.

Display capture of pictures
click
An emphasis indication of the window located in a click coordinate is displayed.
Moreover, a corresponding window will be in a selective state on a window tree.

double-click
Instructional information acquisition screen in corresponding coordinates is displayed.

Right-click
The following right-click menus are displayed.
Acquisition is divided with the selected GUI element.
The following pictures are (from left) a window of a top level, a window of .Net, a native window,
and a GUI element of WPF.

Acquisition
Acquisition of the window of a forefront side in order of Z.
It generates codes acquiring window b calling constructor of new WindowControl(app, WindowFind.ZTop).
Acquisition of active window
Codes acquiring windows is generated by calling constructor of new WindowControl(app, WindowFind.Active).
Acquisition of .Net field
Codes acquiring field is generated by using FrienndlyOperation from top window.
The acquired field is stored and returned at AppVar.
Acquisition from ZIndex
Codes acquiring window is generated by calling IdentifyFromZIndex of WindowControl.
Acquisition from dialog ID
Codes acquiring window is generated by calling IdentifyFromDialogId of WindowControlWindowControl.
Acquisition from WindowText
Codes acquiring window is generated by calling IdentifyFromWindowText of WindowControl.
Acquisition from Bounds
Codes acquiring window is generated by calling IdentifyFromBounds of WindowControl.
Acquisition from TypeFullName
Codes acquiring Appvar is generated by calling IdentifyFromTypeFullName of WindowControl.
Acquisition from WindowClass
Codes acquiring window is generated by calling IdentifyFromWindowClass of WindowControl.
Acquisition form logical tree index
Codes acquiring window is generated by calling IdentifyLogicalTreeIndex of WindowControl.

Operation
It displays operation screen.

WindowControl
Click(x, y)
The code which emulates a click for the right-clicked position using SequentialMessage of WindowControl is described.
The control this emulation is not effective also exists.
Double-click(x, y)
The code which emulates a click for the double-clicked position using SequentialMessage of WindowControl is described.
The control this emulation is not effective also exists.
Message trace
It displays message window.

Permission for selecting on the screen
When it clicks on a screen, it is set up whether an item can be chosen or not.
It is convenient, if this is turned OFF and you change selection only by a tree,
when two or more GUI items overlap.

Window Tree
Selection
The window corresponding to a selection it is indicated by emphasis on a screen capture display.

Double-click
Pushing Enter key
It displays operation acquisition information screen.

Click by selected situation
F2 key
variable name can be changed.

Right-click
The following rigiht-click menus are displayed.
Acquisition is devided into selected GUI elements.
The following pictures are (from left) toplevel window, .Net window、native window, GUI elements of WPF.


Acqusition
Acquisition of the window of a forefront side in order of Z.
It generates codes acquiring window b calling constructor of new WindowControl(app, WindowFind.ZTop).

Acquisition of active window.
Codes acquiring windows is generated by calling constructor of new WindowControl(app, WindowFind.Active).

Acquisition of
.Net field

Codes acquiring field is generated by using FrienndlyOperation from top window.
The acquired field is stored and returned at AppVar.

Acquisition from
ZIndex
Codes acquiring window is generated by calling IdentifyFromZIndex of
WindowControl.

Acquisition from dialog ID
Codes acquiring window is generated by calling IdentifyFromDialogId of WindowControlWindowControl.

Acquisition from WindowText
Codes acquiring window is generated by calling
IdentifyFromWindowText of WindowControl.


Acquisition from Bounds
Codes acquiring window is generated by calling
IdentifyFromBounds of WindowControl.


Acquisition from TypeFullName
Codes acquiring Appvar is generated by calling
IdentifyFromTypeFullName of WindowControl
.


Acquisition from WindowClass
Codes acquiring window is generated by calling
IdentifyFromWindowClass of WindowControl.


Acquisition form logical tree index
Codes acquiring window is generated by calling
IdentifyLogicalTreeIndex of WindowControl
.



===
Operation

    It displays operation screen.

WindowControl
    Click(x, y)
        The code which emulates a click for the right-clicked position using SequentialMessage of
        WindowControl is described.
        The control this emulation is not effective also exists.
    Double-click(x, y)  
        The code which emulates a click for the double-clicked position using SequentialMessage of            WindowControl is described.
        The control this emulation is not effective also exists.

    Message trace


Window Information display window
It displays window information.
This information is used for specifying window.
It's used for specifying window corespponding to WindowControl and arguments of acquisition method.
If you use window acqusition of TestAssistant, codes specifying windows can be generated.

Text
It's string acquired by GetWindowText of WindowsApi.
It's used by IdentifyFromWindowText, GetFromWindowText.
Bounds
It's clientpoints from top level window.
It's used by IdentifyFromBounds, GetFromBounds.
FieldPath
It's path for acquiring windows by chasing .Net form.
We recommend this one in case of .Net.
TypeFullName
It's full name of .Net form.
it's used by IdentifyFromTypeFullName, GetFromTypeFullName.
WindowClass
It's string of window class.
It's used by IdentifyeFromWindowClass, GetFromWindowClass.
DialogId
It's dialog ID.
It's used by IdentifyFromDialogId.
We recommend it in case of native dialog.
ZIndex
It's Z-Index.
It's used by IdentifyFromZIndex.
We also recommend it in case of native and .Net.
LogicalTreeIndex
It's logical tree index.
It's used in case of WPF window.
It's used by IdentifyFromLogicalTreeIndex.

Operation Screen

It's operation screen.
Instructional information can be acquired from target application and an operation code can be generated based on it.
Since communication with target application is internally carried out during use,
information may be unable to be acquired when target application has not carried out a normal performance.

All tree operations
Operation codes can be generated by double-click of tree operation node or pushing Enter key on selection.

①Input variables
Input variables name.
Output codes use this variables name.
②Window Acquisition
It displays methods for acquiring window.
③Methods which can be operated by FriendlyOperation
It displays object form methods, field and properties.
Methods which can be operated by FriendlyOperation(Inherited class)
     It displays inherited 
methods, field and properties.
⑤Operation of WindowControl
It displays operation of WindowCotnrol.
⑥Generated code preview
It displays the generated code preview of this operations when you select operation node of tree.


Window message screen

you can acquire window message.
Moreover, message sending codes can be generated by 「message generated code output」 of ⑥.
However according to message procedure, since prior conditions are important,
operation may be unreproducible only by transmission of a message.
Please use it in case of understanding of windows message.

①Start
It starts to acquire message.
②Stop
It stops to acquire message.
③Message filter
It decides acquisition message.
④Clear
It clears the contents displayed in message log screen(⑦).
⑤Variable name
It set the variables name in case of calling SequentialMessage.
⑥Output message generated codes
It generates message codes by contents displayed in message log screen.
However accroding to message procedure,
since prior conditions are important,
operation may be unreproducible only by transmission of a message.
Please use it in case of understanding of Window message.
⑦Messagr log screen
It displays acquired message.
*In advanced use
You can add message filter
Please add to MessageLog folder of installed TestAssistant.
(default path is :\Program Files\Codeer\TestAssistant\MessageLog.)
Please write filename to [Sort No]_[Display Name].txt, and
the contents are [Min Message],[Max Message] each line.
Please refer to the default installed file.

You can change message to string on message log.
Please add to MessageLog\Map folder of installed TestAssistant.
(default path is  C:\Program Files\Codeer\TestAssistant\MessageLog\Map).
Please write contents are [Message Value][Displayed String] each line.

Type information acquisition screen

Typetree
The type within target application which can be operated now is displayed.
The type information which can be accessed now is displayed in an target process.
Since the assembly of .Net is a delay load, it is not displayed if target application is not loaded
with the type originally used at the analysis time.
Selection of a type node will display the information on a type on an instructional information acquisition panel.
If a type node is double-clicked or the Enter key is pushed by a selective state, an instructional information acquisition screen will be separately displayed in pop-up.

Operation panel
It can operate same as operation screen.
Code is generated with vacant variable name when code is generated.