Skip to content

QAutofamily/QAutoLibrary

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

QAutoLibrary

QAutoLibrary is an extension for RobotFramework and Python, providing automation tools and RPA (Robotic Process Automation) libraries.

Main Libraries

QAutoRobot, extensive RPA and test automation library for Robot Framework.

QAutowin, a testing tool for native Windows applications. QAutowin can be used with QAutoRobot.

PythonOCR, Python library of functions for finding and locating words on screen, in image files or PDF files using OCR (Optical Character Recognition).

NOTE: PythonOCR is unreliable at best when finding words in files, and should only be used as an assistance to process files. Usage of other confirmation methods (such as manual reviewing) is adviced, when processing important files!

Getting Started

QAutoLibrary requires Python, and additional libraries depending on which QAutoLibrary modules you want to use.

The library can be installed using pip, or straight from the source code using setup.py file.

Extensive and detailed instructions on prerequisites, installing, dependencies, importing and usage, with examples, is provided in INSTRUCTIONS.md file.

Prerequisites

QAutoLibrary requires Python 3.7. Include pip with the Python installation, and add Python to PATH.

Installing

The library can be installed using pip, or straight from the source code using setup.py file. Instructions on how to install from the source files is provided in INSTRUCTIONS.md file, in Installing from Source Files-section.

QAutoLibrary can be downloaded and installed to your local Python libraries, using pip:

pip install --upgrade https://customer.qautomate.fi/downloadQautoLibrary.html

Dependencies

QAutoLibrary modules require other library installations, as detailed in the following sections.

QAutoRobot Dependencies

NOTE: If you have installed QAutomate tool, the libraries required by QAutoRobot should already be installed.

QAutoRobot modules require the following library installations:

Selenium: pip install selenium

Robot Framework: pip install robotframework

Requests: pip install requests

Pillow: pip install Pillow

LXML: pip install lxml

SimpleJSON: pip install simplejson

pymongo: pip install pymongo

pycryptodome: pip install pycryptodome

Tika: pip install tika

PythonOCR Dependencies

NOTE: See on INSTRUCTIONS.md file, in PythonOCR Dependencies-section, for PythonOCR dependencies' installation instructions.

PythonOCR module requires the following libraries:

pyautogui

poppler

pdf2image, with more information at https://github.com/Belval/pdf2image

Google Tesseract OCR

pytesseract

Usage

QAutoLibrary modules can provide additional functionality to Python code or Robot.

Extensive and detailed instructions, with examples, are provided in INSTRUCTIONS.md file, in Usage-section.

Usage in Python code

Importing

To import a QAutoLibrary module to Python code:

from QAutoLibrary import <Module>

To import a class from a module:

from QAutoLibrary.<Module> import <Class>

Usage

Module functions can then be used as follows:

<Module>.<function>()

Class objects can be instantiated as follows:

<Object> = <Class>()

Examples

from QAutoLibrary.QAutoSelenium import CommonMethods

my_methods = CommonMethods()
my_methods.set_speed(timeout=5)
from QAutoLibrary import PythonOCR

PythonOCR.find_coordinates("Python", "./images/screenshot.png")

Usage in QAutoRobot

Importing

QAutoLibrary modules can be imported to QAutoRobot as libraries. Import a module to robot in the Settings field:

*** Settings ***
Library  |  QAutoLibrary.<Module>

Usage

Keywords of the module can then be used in the robot:

*** Test Cases ***
Test Case
  |  <Module Keyword>  |  ${<argument1>}  |  ${<argument2>}  |  ...

Examples

*** Settings ***
Library  |  QAutoLibrary.QAutowin

*** Tasks ***
Example 1
    Open Application  |  notepad.exe
*** Settings ***
Library  |  QAutoLibrary.PythonOCR

*** Variables ***
${file} =  ./files/test_file.pdf
@{results_list}

*** Tasks ***
Example 2
    @{results_list} =  |  Find Words  |  Python  |  ${file}  |  ./output/

Custom libraries in QAutoRobot

Custom Python libraries can be provided to QAutoRobot. QAutoRobot dynamically (during runtime) imports modules located in the robot's 'pagemodel' folder.

Detailed instructions on how to create and use custom Python modules with QAutoRobot can be found in INSTRUCTIONS.md file, in Importing Custom Libraries-section.

Built With

Contributing

Adding dependencies

Add new dependencies to setup.py and if it's a library for a specific OS, add that aswell.

ie. 'pywin32; platform_system == "Windows"'

Creating a testpypi package

TBA later.

  • python setup.py sdist bdist_wheel
  • python -m twine upload --repository testpypi dist/*
  • User: _token_
  • Password: token from pypi

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the Apache License 2.0 - see the LICENSE.md file for details

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published