How to start using the Qxf2 framework with a new project

This post will help you in modifying the Qxf2’s open-sourced test automation framework to use with your new project. In this post, you will learn about the files and folders to edit and delete so you can use the framework to write tests for your web or mobile application.

If you want to read more before you start

Here is a quick refresher on the various framework components. The framework (based on the page object pattern) essentially consists of the following components:

  1. Driver Factory – returns appropriate drivers for the browser.
  2. Page Factory – returns page objects.
  3. Base Page – consists of wrappers around common selenium operation.
  4. Fixtures – since we run tests with pytest, there are useful fixtures added in the conftest file.
  5. Conf files- every page has its conf files.

If you want a more detailed introduction to our test automation framework, you can read our framework’s wiki.


The rest of this post will show you:
1. Setup
2. Cleanup (deletions)
3. Edits

1. Setup

We assume you have already gotten setup with our framework, run the sample tests it comes with, evaluated it and then decided to implement it in your project. If not, please:

a) Click the Use This Template button on the Qxf2’s Page Object Model framework that uses python.
b) follow the setup instructions in the on GitHub
c) run one of the existing tests to ensure you are fully setup (pytest-k example_form)

2. Cleanup

Note: There is also a clean-up script is available under utils folder, which can be used to delete all the files mentioned in the above section.

Please follow these steps to clean up(delete examples and related files).

  • Delete all test files under the tests folder,  don’t delete
  • can be edited and used to write your tests. This holds the skeleton to start writing tests quickly.

Then, delete files mentioned in the table below:

conf folder page_objects folder endpoints folder
  1. api_example_conf
  5. successive_form_
  2. Registration_API_
  • After cleanup, the folder structure should look similar to the image below :

3. Edits

You will have to make a few edits to let the framework know about your web or mobile application. You will also have to remove a couple of lines of code that refer to the example that we ship with.

  1. conf/ holds the reference to the entry point to the app. Hence mention the base URL of the web application under test.
  2. page_objects/ file holds references to the pages being used in your application. Remove the imports and if-else conditions related to our example. Import the new pages you have added to your project.
  3. conf/ file has locators that apply to our example. You can delete the locators and replace them with the locators used in your application.
  4. The Readme file explains how the framework can be used. We suggest you can edit the readme as per your usage for easy collaboration among your team members.

Now you can add new tests and implement the test cases using our framework. Tests can be run with pytest. Hope by following this blog, you are able to quickly start using our framework. Happy testing!