Welcome to Arjuna - The Framework for Professional Coded Testing¶

Arjuna is a Python based test automation framework developed by Rahul Verma.
It is an open source, Apache Licensed software: Arjuna on GitHub.
Rahul has implemented smaller variants of features in Arjuna across frameworks and organizations, or given advice around it. However Arjuna being a generic library has the most complete implementation of his ideas, away from project specific contexts and constraints.
For test execution, Arjuna is implemented as a pytest plugin and provides its own markup over pytest as its underlying test engine. If you like, you can make use of Arjuna with any other test engine or custom frameworks as well.
You’d need Python 3.8+ to make use of Arjuna.
Note: On Linux, the built-in Python3 build has issues with the Python’s built-in enum module which is heavily used in Arjuna. One alternative is to install ActiveState Python on linux. Advanced users can go for installing a custom Python build.
You can find a lot of example code for using Arjuna in Arjex project on GitHub.
Tester’s Guide¶
Arjuna Fundamentals¶
- Installing Arjuna
- Arjuna Test Project
- Basics of Writing Automated Tests in Arjuna
- Provisions in @test Decorator
- Arjuna’s Command Line Interface as pytest plugin
- Handling Test Resources
- Handling Configuration Options
- Understanding Configuration System of Arjuna
- project.yaml - Setting Project Level Configuration Options
- Configuration Builder - Creating Custom Configurations
- Defining and Handling User Options
- Configuration Builder - Adding options from a .yaml File
- The Magic C Function
- Data Configurations and Environment Configurations
- Arjuna Options Reference for Overriding
- Test Selection Rules
- Logging
- Introduction
- Arjuna’s Logging Functions to Support Python Logging Levels
- Controlling Which Log Messages Are Included on Console and in Log File
- Default Logging Levels
- Arjuna’s TRACE Log Level
- Overriding Logging Level Defaults
- Contextual Logging
- Auto-Logging using @track Decorator
- Tracking Methods, Functions, Properties
- Tracking All Methods in a Class
- Default Logging Level for @track
- Changing Logging Level for @track
- Test Reporting
Handling Data and Files in Arjuna¶
- Data Driven Testing with Arjuna
- Data Spaces - Shareable Data Objects for Tests
- Data References
- Data Generation and Data Entities
- Random Data Generation
- Creating a Basic Data Entity
- Setting Defaults in Data Entity
- Basic Usage of Random with Data Entity
- Dynamic Generation of Data for Data Entities
- Processing Dynamically Generated Data
- Defining Composite Data Using composite and composer Constructs
- Creating a Data Entity from Other Data Entities
- Parsing Text, JSON, YAML, XML, HTML Files and Strings
- Data Localisation
Web GUI Automation¶
- The GuiApp class
- Element Identification and Interaction
- Gui Namespace - Externalizing Locators
- GuiWidget Locators
- Alternative Locators - Specifying Multiple Locators with OR Relationship
- Dynamic/Formatted GuiWidget Locators
- Gui Widget Meta Data - Controlling Selection and Interaction Behavior
- Defining Your Own Locators using withx
- Gui Widgets
- Advanced Gui Abstractions
HTTP Automation¶
Notes About Python Libraries and Tools Used in Arjuna¶
Tester Programming Interface (TPI) Reference¶
All classes, functions, enums and exceptions that are supposed to be directly used by a test author are a part of Arjuna’s Tester Programming Interface (TPI).
This interface is fully encapsulated in arjuna.tpi
package.
You can either do a fully qualified import for a public name, for example:
from arjuna.tpi.log import log_info
or an easy, simple import that imports all public TPI names from Arjuna:
from arjuna import *
Following links direct you to documentation for all public names:
Test, Test Resources and Assertions¶
Test Configuration¶
The Magic Functions¶
Data Driven Testing¶
Data Source Markup
DataRecord
Data References¶
Web GUI Automation¶
Gui
: It represents all type of Guis and is the base class for the following classes:GuiApp
GuiAppContent
: It represents the content of a GuiApp and is the base class of the following classes:
- Defining and formatting Gui Widget Locators:
GuiWidgetDefinition
- Classes related to formatting of GuiWidgetDefinition:
- Different Gui Widgets
GuiElement
GuiMultiElement
- Filtering a GuiMultiElement -
GuiMultiElementFilter
- Filtering a GuiMultiElement -
GuiDropDown
GuiRadioGroup
- Inquiring Gui Source
GuiPageSource
GuiElementSource
GuiMultiElementSource
GuiSourceContent
- Encapsulates source content for all Guis and GuiWidgets.
HTTP Automation¶
Reporting Protocols¶
Objects In Arjuna Hooks¶
Parsers¶
Helpers¶
Arjuna Exceptions¶
Indices and tables¶
Contributors¶
This package is authored and maintained by:
with the help of patches submitted by these contributors.
Copyright and License¶
Copyright 2015-2020 Rahul Verma
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.