📜 ⬆️ ⬇️

Introduction to frameworks (Part 2)

Testing
Part 1

Second generation frameworks

This generation is an intermediate level of automated testing frameworks, among them there can be quite simple frameworks, and they can be quite well designed. Such frameworks should be considered in the case when the support of autotests is an important factor. A good understanding of this generation of frameworks is important, since third-generation frameworks are based on the concepts of frameworks of this level.
Second-generation frameworks include data-oriented frameworks and frameworks using functional decomposition. Most frameworks of this level are hybrids and use both approaches, but since only one of them can be used, these approaches will be considered independently of each other.

Functional decomposition
Functional decomposition in a broad sense is the process of creating modular components (user-defined functions) in such a way that automated testing scripts can be created by combining these components.
Reusable functions
Modularity is often used to implement functionality tests for the application under test, but there are other user-defined functions that can be created. These functions include:
Framework based on functional decomposition may vary in complexity depending on the complexity of the functions included in them. Functions can be created for solving simple tasks, such as working with menus, as well as for complex functional procedures, complex error handling systems, and reporting mechanisms.

The advantages of functional decomposition

Disadvantages of functional decomposition

Data orientation
The frameworks created using this approach are similar to the first-generation frameworks in that the majority of components used in scripts are mainly within these scenarios. The difference is in the way of working with data. Data-oriented frameworks usually store information in sources that are external to scripts. Using parameterization of the fields for entering application data and binding external data to the corresponding parameters, test data is not placed inside the script itself.
Below is an example of a linear script.
  1. Input “John” into Username textbox
  2. Input “JPass” into Password textbox
  3. Click Login button
  4. If “Welcome Screen” exists then
  5. Pass the test
  6. Else
  7. Fail the test
  8. End if
The data-oriented version of this script will use information from an external source (spreadsheet, database, XML file, etc.), something like the one shown below.
NameParameterPasswordParameter
JohnJpass
SueSPass
RandyRPass
TrinaTPass
The data-driven version of the linear script shown above may look like this:
  1. Open data table
  2. Input <NameParameter> in Username textbox
  3. Input <PasswordParameter> into Password textbox
  4. Click Login button
  5. If “Welcome Screen” exists then
  6. Pass the test
  7. Else
  8. Fail the test
  9. End if
  10. Close Data Table
Note that the data has been removed from the script and replaced with parameters.
This approach allows you to use the same code on different data. Data orientation is often viewed as a technique contrary to the frameworks, but its use can help reuse the same script using different information. This approach does not solve many of the problems inherent in linear scenarios, but it can be useful.
')
The benefits of data orientation

Lack of data orientation
The disadvantages of this approach include the following aspects inherited from linear scripts (see Part 1 ):

Source: https://habr.com/ru/post/150603/


All Articles