First Steps

Aus ExpeccoWiki

Wechseln zu: Navigation, Suche

Inhaltsverzeichnis

Introduction

The First Steps are aimed at everyone who wants to use expecco for the first time and will be a support to the user in the beginning.
We want to provide you an overview of expecco, using a simple example.
It is recommended to also start the demo tutorial in parallel to the first steps in order to understand and follow everything.

Creating a new testsuite

A testsuite is the term used for a packaged test project. It manages a collection of elements like testplans, blocks and datatypes as well as resources or attachments and documentation.

To create a new testsuite, click on the menu FileNew Test Suite.

Bild:FS_Picture_03_en.jpg

expecco version 1.7 and higher

The Standard Library is automatically imported after creation of the new testsuite .

expecco up to version 1.6.x

The Standard Library has to be imported manually. To import the library click on the menu FileImport/ExportImport Library....

Bild:FS_Picture_26_en.jpg

A file browser opens. Click on the button Bild:Icon_expecco_Home.jpg to change to the library folder and select the Standard Library (StandardLibrary.ets). Press OK.

Bild:FS_Picture_14.jpg

Blocks in libraries

Libraries are collections of functional blocks. Libraries are located in the project tree (Navigator) under the category "Imports". All elements within an imported library are read-only. For each block, there is a description and, where appropriate, an example that you can execute immediately.

Select the Standard Library in the project tree. This library provides basic blocks for different areas.

Bild:FS_Picture_35_en.jpg

Select in the category "String Processing" the block "String [ AsUppercase ]".
Editors regarding the selected item are displayed on the right in a number of tabs. In the tab "Documentation" you will find a brief description about the functionality.

Bild:FS_Picture_21_en.jpg

Select the tab "Test". The shown Testeditor allows the immediate execution of the block by pressing the button Bild:Icon_Run.png.



The result of the execution is displayed in the lower part. In the tab "Pins" you can see the input and output values.

Creating your first (compound) block

A block is the definition of an activity. We distinguish between elementary blocks and compound blocks.
An elementary block defines a basic action, for example built-in functions, DLL-calls and JavaScript functions.
The behaviour of a compound block is represented by an activity diagram. The elements of an activity diagram are steps which are connected through data and/or control flows.

To create a new compound block click the button Bild:Icon_New_Compound.jpg on the toolbar Bild:Icon_Toolbar_Create.jpg.

Bild:FS_Picture_15_en.jpg

Click the button Bild:Icon_Open_External_Tree.jpg to open an additional project tree which allows you to drag elements into the network editor.

Bild:FS_Picture_31_en.jpg

In the external tree change to the category "Arithmetic" and select the block "Arith [ Sum ]". Keep the mouse pressed and drag the selected element into the network of the new block. Release the mouse button and a new step will be created.

Bild:FS_Picture_28_en.jpg

Since this step requires input values, it can not be executed (showing a red exclamation mark ). Inputs and outputs are termed as pins (connectors). In the first step we allocate the inputs with fixed values. You can do this by double clicking on the input pin or via the corresponding entry in the context menu:

Bild:FS_Picture_08_en.jpg

Enter any number in the box:

Bild:FS_Picture_12.jpg

Allocate the second input pin. The step now has all the required input values to be executed.

Bild:FS_Picture_03.jpg

Execute your newly created block in the tab Test.

Bild:FS_Picture_29_en.jpg

In the tab "Pins" you see the input values and the expected output value.

To take over the changes to the block in the system, click on the button "Accept".

Bild:FS_Picture_18_en.jpg

Enter a name for the block, which can be accessed via the context menu of the newly created module in the project tree.

Bild:FS_Picture_22_en.jpg

Enter the name "1.Block" in the box.

Bild:FS_Picture_20_en.jpg

Creating a more complex block

As starting point, we use a copy of the previous block. To do so, select the block and open the right-click context menu. Then select the Copy item and afterwards the Paste item.

Bild:FS_Picture_23_en.jpg

After pasting, you will have a copy of the previous block.

Bild:FS_Picture_30_en.jpg

Place the block "Arith [ Product ]" from the additional tree via drag & drop into the network. Afterwards, your network should look like the following one:

Bild:FS_Picture_32_en.jpg

After the execution of the module you will get the following picture:

Bild:FS_Picture_07_en.jpg

The activities will be displayed in different colors, depending on their execution state. As seen here in green - for successful. As you can also see, no activity has started for the new step. The step is lacking the required input values (recognizable through the red exclamation mark).

Therefore, we connect the inputs and outputs of the steps.

Most connections are data-driven, which means they have to have the same data at the beginning and at the end of the connection. For example, it is not possible to add text into an addition block.

If the input and output data types do not match, various conversion blocks are available in the standard library under the category "Type Conversion".

To create a connection, follow these steps:

  1. Select with the left mouse button, the output pin "sum" at the step "Arith [ Sum ]" and keep it pressed.
    Bild:FS_Picture_07.jpg
  2. Drag the mouse button to connect to the input pin "number1" at the step "Arith [ Product ]" and release the mouse button while on the input pin Bild:Icon_Input_Pin.jpg.
    Bild:FS_Picture_02.jpg

Repeat this step and connect the additional output "sum" with the input pin "number2".

Bild:FS_Picture_08.jpg

Run the module again, as you can see all the steps were executed now.

Bild:FS_Picture_12_en.jpg

Take over the block and rename it into "2.Block".

Adding output pins to a block

As starting point, we use a copy of the previous block, which you can create through the context menu (Copy then Paste).

You will get the following picture:

Bild:FS_Picture_36_en.jpg

The interface of a block is described by its inputs and outputs. In the schema editor, the input pins are displayed on the left and the output pins on the right. Each pin is assigned to a data type.

In order to create new pins, there are different possibilities:

  1. Click the Bild:Icon_Add_Outputpin.png button inside the schema editor to create a new input or output pin. To change the default data type, click on the data type and select the desired data type from the appearing menu.
    Bild:FS_Picture_06_en.jpg

  2. Drag the corresponding input or output pin to the left or right side of the editor.
    Bild:FS_Picture_11.jpg
    After releasing the mouse, you see the following picture at the left border:
    Bild:FS_Picture_10.jpg

Create an output pin as described in example 2.

Select the tab Schema and you will get the following picture:

Bild:FS_Picture_25_en.jpg

The block has received a new output pin, the data type and name of the output pin were taken over by the internally associated output pin within the network. By clicking on the name, the pin can be renamed.

To delete an existing input or output pin, select the appropriate pin and click on the button Bild:Icon_Remove_Pin.png.

Execute the block again and you will get the following picture:

Bild:FS_Picture_14_en.jpg

The output value is now available for further use at the output pin.
Take over the block and rename it into "3.Block".

Adding input pins to a block

As starting point, we use a copy of the previous block, which you can create through the context menu (Copy then Paste).

You will get the following picture:

Bild:FS_Picture_24_en.jpg

To externally supply the step "Arith [ Sum ]", create the input pins (same approach as for the Output pins):

Bild:FS_Picture_05.jpg Bild:FS_Picture_04.jpg
Perform the same action for the second input pin "number2":
Bild:FS_Picture_01.jpg Bild:FS_Picture_09.jpg

You will get the following picture:

Bild:FS_Picture_13_en.jpg

Execute the block again and you will get the following picture:

Bild:FS_Picture_05_en.jpg

As you can see, the block could not be executed because the necessary input values for the input pins of our test module are missing. Allocate the input with fixed values:

Bild:FS_Picture_09_en.jpg

Execute the block again and you will get the following picture:

Bild:FS_Picture_19_en.jpg

Now go to the tab Schema. Here you can change the trigger conditions for the block. Click on the field "And-Connected". A submenu is displayed on the configuration:

Bild:FS_Picture_02_en.jpg

Here you can specify which input pins must have values in order to be executed. Three options are supported:

  1. And-Connected
    All connected input pins must have values, open inputs are ignored.
  2. And
    all input pins must have values.
  3. Or
    at least one input pin must have a value.

In our case, all input values have to fit, so choose the "And" condition.

Bild:FS_Picture_33_en.jpg

Take over the block and rename it into "4.Block".

Reuse of blocks

The way of working with blocks is the key to reusability and flexibility. Once a block is created it can be reused in any compound block.

Insert a new compound block by clicking the button Bild:Icon_New_Compound.jpg. Now drag & drop the previously created blocks into the network (activity diagram) of the new block.

Bild:FS_Picture_34_en.jpg

Add additional blocks from the Standard Library and make the connections as shown in the following activity diagram.
You can find the blocks under the following categories:

  • Data Generators
    Random [ Integers ]
  • Compare
    Compare [ Greater 2-Way ]
  • Assertions, Exceptions & Logging
    Log [ Info ], Log [ Failure ]

Bild:FS_Picture_16_en.jpg

Due to the upstreamed "Random [Integers ]" step, the created "4.Block" is supplied by different values, leading to different results. This can be seen best, when you execute the block in the Test tab a few times.

Bild:FS_Picture_11_en.jpg

Take over the block and rename it into "5.Block".

Sequential execution of steps

For a graph with no data flows (i.e., with exclusive control flows), trigger inputs will be connected with trigger outputs, creating a pure flow chart.
To prepare, create a new compound block by clicking the button Bild:Icon_New_Compound.jpg. Drag and drop the blocks 1 and 2 in the network and you will get the following picture:

Bild:FS_Picture_37_en.jpg

Select the "1.Block". By holding the shift key you can add the "2.Block". Both steps are now selected in the order, in which they should be executed sequentially. By clicking the button Bild:Icon_Execute_Sequential.png, a control flow connection from step 1 to step 2 is set. Bild:FS_Picture_38_en.jpg
After executing the block in theTest tab, you will get the following picture. As you can see "1.Block" was executed before "2.Block". Bild:FS_Picture_39_en.jpg
You can delete a connection by clicking it and afterwards select remove or press the button Bild:Icon_Remove_Connection.png.

Now, delete the existing control flow connection and set up the control flow in the reverse direction. Proceed as described above, only selecting "2.Block" before "1.Block" this time.

Bild:FS_Picture_40_en.jpg

After executing the block, you will now get the following error screen:

Bild:FS_Picture_41_en.jpg

As you can see the in the network editor, the "2.Block" is marked with a red exclamation mark, which means it is not ready to be executed. Bild:FS_Picture_42_en.jpg

The step has an open trigger input pin. By connecting the trigger input with any other output pin, the action of the step can also be triggered.
In our case, delete the trigger input by selecting it and then press the Delete key.

To execute a step, it has to have at least one connected not-parameter pin or the auto-start attribute. Therefore, mark step 2 as an auto-start. To do so, select it and click on the button Bild:Icon_Toggle_Autostart.png. Bild:FS_Picture_43_en.jpg
After executing the block in theTest tab, you will see the following picture. As you can recognize the "2.Block" was executed before the "1.Block". Bild:FS_Picture_44_en.jpg



Creating a testplan

In expecco, a collection of several testcases is described as a testplan. During execution of a testplan, all individual testcases are executed sequentially.

To generate a new testplan, click the button Bild:Icon_New_Testplan.jpg on the toolbar Bild:Icon_Toolbar_Create.jpg.

Drag & drop the newly created blocks into the test plan editor. You will determine quickly that the "4.Block" is not addable to the testplan. Blocks with open entries can not be used within testplans.
You will get the following picture:

Bild:FS_Picture_27_en.jpg

Take over the testplan and execute it by pressing the button Bild:Icon_Run.png.
You will get the following picture:

Bild:FS_Picture_04_en.jpg

Since the "5.Block" works internally with randomly generated input values, you will get different results with multiple executions for the testplan.

Generating a report

For preparation, execute the testplan. To create and view a detailed report about the test execution, click on the button Bild:Icon_Print_Report.png.

The dialog box "Report Generation / Print" will open. Prior to the report generation, you will have to determine further settings:

Bild:FS_Picture_45_en.jpg

  • Output Format(s):
    The reports can be created in different output formats. A multiple selection is possible.
  • Report Language:
    Set the language for the report.
  • Paper Size:
    Only for the PDF output format the paper size is specified. For all other formats this setting will be ignored.
  • Report Template:
    Here, the content and appearance of the report can be determined.
    For more information, go to Report Generation.

Click on the button "Generate Report" to start the report generation. After generating the file is open within a browser.

Saving the testsuite

To save the testsuite, click into the menu "File""Save As...". The Save dialog will appear.


Bild:FS_Picture_01_en.jpg

Summary

In our example, we have intentionally used simple blocks from the Standard Library to help you work with expecco.

On specific blocks(TCP / IP, DLL calls, FTP, ...) and various libraries and plugins, the system under test tied to expecco.


For the testing of web applications, we recommend you the document:
http://wiki.expecco.de/index.php5/Expecco_web (First steps).

Other examples can be found at:
http://wiki.expecco.de/index.php5/Examples.

Persönliche Werkzeuge