Monitor multiple remote log files with MultiTail

With MultiTail you are able to view one or multiple log files (on remote engines). Therefore it creates multiple split-windows on your console. You can configure these! To see all features look here.

Installation

Examples

Note

If you look on multiple files at same time with MultiTail – just hit the “b” key to select the window, with up/down keys you can scroll.

Create PDF test-reports with Python

With only two python libraries and some line of codes, you are able to create very nice test-reports in PDF format. This tutorial should give you a hint. Feel free to improve with your requirements.

Preconditions

Example

You can call it simply by

Create screenshot with Python Selenium Webdriver

The following example show how easy you could make screenshots with Python Selenium Webdriver.

Precondition

Example

The MyLibrary.py could be used on different places.

After running the test you should see the folder “/screenshot” with the picture.

Postgres for Mac OS X

On Mac OS X you can use Postgres.app to install and use PostgreSQL. It really is the easiest way to get started with PostgreSQL on the Mac!

Installation

  1. Download from website
  2. Drag’n’Drop into /Applications folder
  3. Start Postgres.app

Configuration

The app also provides additional command-line tools (e.q. psql). To use these tools, you need to add the directory to the path.

Finish

Now you can use it! If you want to use tools like pgAdmin, just connect without password.

Prettify JSON with Python

If you are testing REST , it happens that you need to prettify JSON. With Python you do not need any other tool except your terminal!

Example

Now open you terminal…

JUnit report with Python Webdriver

To create JUnit reports, you just need the python library xmlrunner. This is needed for the integration with build server like Jenkins.

Installation

Usage

Just replace for example:

with

Jenkins

On Jenkins add a new “post-build” action and select the Publish JUnit test result report. Add now the string “reports/*.xml” into the “Test report XMLs” field.

DDT with Python Selenium

DDT (Data-driven Testing) with Python Selenium Webdriver is very easy! DDT becomes very useful if you have test cases that contains the same test steps. All values could outsourced into files or databases. This tutorial use CSV files.

Precondition

  • Python installed
  • selenium and ddt library installed

Example

The folder structure for this tutorial looks like:

Into folder “data” we store the csv files. The packages “library” include a function to read the specific csv files and the package “scenarios” include the test cases. The test suite is on root folder.

Into the “testsuite.py” we add all test cases provided by scenario package.

data folder

The CSV stores the test data that we supplied to the @data decorator of test case.

library package

Just for read the csv and return the values as a list.

scenarios package

Test case with @ddt (for classes), @data and @unpack (for methods) decorators.

  • @data take the arguments from csv file
  • @unpack unpacks tuples or lists into multiple arguments

The test_search() method accepts the arguments, which will be mapped to the tuple values by ddt.

Run