Arjuna is a Python based test automation framework developed by Rahul Verma (www.rahulverma.net).
Project description
Arjuna
Arjuna is a Python based test automation framework developed by Rahul Verma (www.rahulverma.net). Rahul has implemented smaller variants of features in Arjuna across frameworks and organizations, or given advise around it. However Arjuna being a generic library has the most complete implementation of his ideas, away from project specific contexts and constraints.
Arjuna uses pytest as its recommended test engine. Arjuna also provides its markup for some common use cases on top of pytest. If you like, you can make use of Arjuna with any other test engine or custom frameworks as well.
You'd need Python 3.5+ 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.
Arjuna Installation
- Download and install latest Python (3.5+) from https://python.org
- If you are insterested to learn python Following are links for tutorials and docs.
- Confirm the python version installed by running the command
python --version
. If expected version in not shown, fix this by looking into PATH variables and/or to see whether you have multiple versions of Python installed. - Install Arjuna using the following command
pip install arjuna
You can find the example code in arjex project.
Features
- Arjuna provides the concept of a test project with a fixed project structure, which gives consistency across implementations as well many re-usable features.
- Arjuna provides a comprehensive and intuitive Command Line Interface.
- You can easily define a test as a test function.
- You can take care of setup and cleanup before and after tests as test fixtures 3 levels - test, module and session. These test fixtures can be coded centrally so that they become available to all tests.
- Arjuna provides very comprehensive and advanced features for Test Configuration.
- You can define a project level configuration.
- You can create any number of custom configurations programmatically.
- In addition to Arjuna's built-in options, you can define your own user options.
- You can define any number of configuration files to load configuration options from.
- Arjuna provides the magic
C
function with a Configuration query format to easily retrieve configuration values. - You can define environment configurations and easily specify an active test environment.
- You can create a Run Configuration file and super-impose its options on central configuration.
- You can use configuration queries in Gui Namespace files to create dynamic identifiers.
- You can do data driven testing with a multitude of easy to use and powerful constructs to create data sources in Arjuna:
- Driving with single data record or multiple data records
- Driving with Static Data Functions/Generators and Dynamic Data Functions/Generators.
- Driving with Static Data Classes and Dynamic Data Classes
- Driving with Data Files (Excel Files/Delimiter-Separated Files/INI Files)
- Filtering Data Records
- Driving by combinig multiple data sources
- You can create Contextual Data References to pull data based on a context string.
- Currently Excel format is supported.
- Arjuna provides the magic
R
function with a data reference query format to easily retrieve data reference values anywhere. - You can use data reference queries in Gui Namespace files to create dynamic identifiers.
- You can easily localize your strings anywhere in your test project.
- Excel localizer
- Json localizer
- Arjuna provides the magic
L
function with a localization query format to easily retrieve localized strings anywhere. - Localization can strict or non-strict.
- You can use localization queries in Gui Namespace files to create dynamic identifiers.
- Arjuna has comprehenstive support for Web Gui Automation.
- Arjuna provides highly customized automation on top of Selenium WebDriver for web automation.
- Arjuna automatically downloads drivers using WebDriver Manager. Currenlty only Chrome and Firefox are the supported browsers (in normal as well as headless mode).
- The starting point for web automation in Arjuna is the
GuiApp
class. - Arjuna supports various features for element identification and interaction:
- A single element is represented as a
GuiElement
. It provides very intuitive and Pythonic interaction methods. - You can locate elements using ID, Name, Tag, Class, Link Text and Partial Link Text, XPath and CSS Selectors. These are mostly direct wrappers on what Selenium supports.
- Arjuna provides its own advanced locator extensions for simple and powerful identifiers.
- Arjuna automatically does a dynamic wait during locating elements as well as some basic interactions.
- You can find nested elements i.e. an element within an element.
- You can define dynamic identifiers i.e. identifiers which contain Arjuna format strings which are replaced with their values at run-time. The Arjuna format strings can be simple names or Configuration queries or Data Reference Queries or Localization queries.
- A single element is represented as a
- Gui Namespace (GNS) is used to externalize element locators in a GNS File which can be associated with a
GuiApp
- You can externalize ID, Name, Tag, Class, Link Text and Partial Link Text, XPath and CSS Selectors.
- You can also externalize Arjuna's locators extensions.
- You can define dynamic identifiers i.e. identifiers which contain Arjuna format strings which are replaced with their values at run-time. The Arjuna format strings can be simple names or Configuration queries or Data Reference Queries or Localization queries.
- You can define your own locators. You define them globally or within a GNS file.
- Various higher-level element templates are available. These can directly coded in your test or can be defined in a Gui Namespace.
GuiMultiElement
represents multipleGuiElement
s together. Can be defined in code as well defined in GNS.DropDown
represents an HTML drop-down list. Can be defined in code as well defined in GNSRadioGroup
represents an HTML radio group. Can be defined in code as well defined in GNS
- Arjuna provides various classes so that you can build various types of Gui Abstractions.
Gui
is a generic abstraction of a Graphical User Interface.GuiApp
represents the complete web application. You can create an object of it or inherit from it to add methods and attributes as needed. AGuiApp
can be used with or without externalized identifiers or both (partial externalization).GuiPage
class represents a web page and is associated with aGuiApp
.GuiSection
(with aliasesGuiWidget
orGuiDialog
) represents part of a web page or a dialog. It can be associated with aGuiApp
or aGuiPage
.- With Arjuna you can create various Gui abstraction models, for example:
- Arjuna has a comprehensive Gui loading protocol.
GuiPage
andGuiSection
can have ananchor
element defined in corresponding Gui Namespace.GuiSection
can have aroot
element defined in corresponding Gui Namespace.
- Arjuna provides various helper classes, functions and enums to aid in test automation:
XmlNode
andNodeLocator
for XML parsing.Formatter
andLocator
to define locators.
- Various custom Arjuna Exceptions are implemented to give you precise information about the issues that take place.
Arjex - The Arjuna Examples Project
The arjex
project contains lots and lots of example code for using Arjuna features.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file arjuna-0.9.15.tar.gz
.
File metadata
- Download URL: arjuna-0.9.15.tar.gz
- Upload date:
- Size: 118.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 987215d9501acdbcaab34f96a3dbd5ed7a608c89e9bda14a5cb2593a310b0918 |
|
MD5 | 5f9bd2209b0f118712c6f682396742f5 |
|
BLAKE2b-256 | 78d6398e1f3725e1dbe0f0833fb7b0023a97dd7f8add5b2b18f58fd94a0dedaf |
File details
Details for the file arjuna-0.9.15-py3-none-any.whl
.
File metadata
- Download URL: arjuna-0.9.15-py3-none-any.whl
- Upload date:
- Size: 204.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2ca37115b4e414e25e0fad26fc10c92b1987b77945a15a741a910824e635894f |
|
MD5 | 5529f3b106d36896d7d1f8f3438f4bab |
|
BLAKE2b-256 | 2aee6bfe9bf857908a6613e61d54128ed31bf177a2032ed3e794d1504d32dcd6 |