Robot Framework framework for mobile and desktop testing.
Project description
robotframework-applicationlibrary
Introduction
Robotframework-ApplicationLibrary is a collection of libraries spanning Mobile and Windows Desktop (WinAppDriver) automation using Robot Framework. These libraries are and extensions of the existing AppiumLibrary. ApplicationLibrary extends the functionality of AppiumLibrary for Mobile app testing and adds support Windows desktop automation.
In the course of our own automation as a team, we found that out-of-the-box AppiumLibrary did not fit our needs for mobile testing and needed major rework inorder to get it working with WinAppDriver for Desktop testing. Originally this code was a part of RobotFramework-Zoomba but diverging dependency requirements lead to a need for two separate repositories.
See the Keyword Documentation for the Mobile or Desktop libraries for more specific information about the functionality.
Example tests can be found in the samples directory.
Some Features of the Library
Mobile Library:
Extending the AppiumLibrary we added some quality of life 'Wait For And' type keywords:
Wait For And Click Element locator
Wait For And Click Text text
Wait Until Element Contains locator text
As well as additional features that have yet to be implemented in AppiumLibrary:
Drag and Drop source_locator target_locator
Drag And Drop By Offset locator x_offset y_offset
Scroll Down To Text text
Scroll Up To Text text
Desktop Library:
Also extends AppiumLibrary to tailor it Windows desktop automation. This includes enhancements to base keywords such as Open Application or Click Element to perform better for windows. Other notable additions include:
Start and Stop the WinAppDriver as needed (best used for suite setup/teardown):
Driver Setup
Driver Teardown
Easily switching to new windows or the desktop session:
Switch Application Desktop
Switch Application By Name remote_url new_window_name
A variety of keywords for controlling the mouse:
Mouse Over Element locator
Mouse Over and Click Element locator
Mouse over and Context Click Element locator
Mouse Over By Offset x_offset y_offset
Keywords for dragging and dropping:
Drag and Drop source_locator target_locator
Drag And Drop By Offset locator x_offset y_offset
The ability to send key commands to the application:
Send Keys \\ue00 p \\ue00
Send Keys To Element locator a b c
Selecting an element from a combobox or a menu:
Select Element From ComboBox combobox_locator element_locator
Select Elements From Menu locator_1 locator_2 locator_n
Select Elements From Context Menu locator_1 locator_2 locator_n
Selecting an element by an image file (Appium v1.18.0 and higher only):
Wait For And Click Element image=file.png
For WebView2 applications we can control both the application view and the Edge browser view:
With the split from RobotFramework-Zoomba, the support for this exact example won't work in this current code. An example of this can be found in the samples directory for robotframework-zoomba version 2.14.3 or lower.
Getting Started
The Application library is easily installed using the setup.py
file in the home directory.
Simply run the following command to install ApplicationLibrary and it's dependencies:
pip install robotframework-applicationlibrary
If you decide to pull the repo locally to make contributions or just want to play around with the code you can install ApplicationLibrary by running the following from the root directory:
pip install .
or if you intend to run unit tests:
pip install .[testing]
To access the keywords in the library simply add the following to your robot file settings (depending on what you are testing):
*** Settings ***
Library ApplicationLibrary.MobileLibrary
Library ApplicationLibrary.DesktopLibrary
Additional Setup Information
If you plan to run Mobile automation you will need to have a running appium server. To do so first have Node installed and then run the following:
npm install -g appium
appium
To use the image
locator strategy you will need to install opencv4nodejs via the following command:
npm install -g opencv4nodejs
Alternatively Appium Desktop can be used.
For Windows automation we suggest installing and using the WinAppDriver without Appium as it seems to be a bit faster and more stable.
Make sure to enable developer mode on your system to allow the WinAppDriver to work.
Examples
Example tests can be found in the samples directory.
The test directory may also contain tests but be aware that these are used for testing releases and may not be as straight forward to use as the ones in the samples directory.
Contributing
To make contributions please refer to the CONTRIBUTING guidelines.
See the .githooks directory for scripts to help in development.
Support
General Robot Framework questions should be directed to the community forum.
For questions and issues specific to ApplicationLibrary please create an issue here on Github.
Project details
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 robotframework-applicationlibrary-1.2.1.tar.gz
.
File metadata
- Download URL: robotframework-applicationlibrary-1.2.1.tar.gz
- Upload date:
- Size: 27.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f7dd44fd4f120188130b63710940cb2bfd08a2ddfd20e33051ec3c100d5ac74 |
|
MD5 | 06ce31298598fe330f653d792c4dae62 |
|
BLAKE2b-256 | 3bb198b9898f57cd897c7a35c4670b1716bd9876525174e8dee8f50a3e0b65af |
File details
Details for the file robotframework_applicationlibrary-1.2.1-py3-none-any.whl
.
File metadata
- Download URL: robotframework_applicationlibrary-1.2.1-py3-none-any.whl
- Upload date:
- Size: 27.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 758c4e82e92153d16d91b3114e8228eacd6c2a12dc0059e3f1cfc50aed7a332f |
|
MD5 | 7e766dedb8b495844cc91584cb975ba7 |
|
BLAKE2b-256 | 714688fca21c88babae6e935b72e429a39c04dbb414553f0ee3db46f86c35717 |