AnywhereLibrary is a cross platform (desktop browser, Android, iOS) testing library for Robot Framework that leverages the Selenium 2 (WebDriver) libraries internally to control a web browser and Appium as mobile test automation framework for use with native and hybrid apps.
This library is especially suitable for handling SPA (single-page apps) with responsive design patterns. With this you only need to generate a set of scripts to cover all platforms (desktop browser, Android, iOS).
On the other hand, not any UI test automation framework is made for your real business. If this library isn't suitable for your business, it's highly recommended that you fork this repository as a prototype for UI test automation. Customize your own AnywhereLibrary in accordance to your actual business requirements.
python3 setup.py installKeyword documentation.
A sample test case which can run in desktop browser, sample Android and iOS webview apps with different platform parameter inputs.
Python source code.
Configuration file which stores all parameters for initializing the driver.
To write tests with Robot Framework and AnywhereLibrary, AnywhereLibrary must be imported into your RF test suite. See Robot Framework User Guide for more information.
As it uses Appium for its mobile solution, please make sure your Appium server is up and running. For how to use Appium, please refer to the Appium Documentation.
You must use the Initial Driver keyword with platform value as the parameter input; after the test case you must use Tear Down Driver keyword to tear down the related driver. Also you need to do some modifications in configuration.xml file in /AnywhereLibrary/cfg.
All keywords in AnywhereLibrary that need to find an element on the page take an argument, locator. AnywhereLibrary supports a subset of the WebDriver locator strategies. Currently available locator strategies are:
find by "class" (i.e., ui component type)
find by "xpath" (i.e., an abstract representation of a path to an element, with certain constraints)
Supported strategies are:
| Strategy | Example | Description |
|---|---|---|
| xpath | Click |
//div[@id='my_element'] |
| xpath | Click |
xpath=//div[@id='my_element'] |
| class | Click |
class=android.widget.Button |
| ... | Coming soon... | Coming soon... |
pybot --variable platform:chrome webviewTest.txt
pybot --variable platform:firefox webviewTest.txt
pybot --variable platform:iphone webviewTest.txtKeywords at a Glance:
Initial DriverTear Down DriverClickTypeElement FindGet TextGet ValueVerify TextVerify ValueIs Element PresentPage Should Contain ElementPage Should Not Contains ElementWait For Element PresentWait No Such Element PresentSwitch To NativeSwitch To WebviewCapture Page ScreenshotExecute Javascript
- mobile gestures
- Coming Soon...
More details about keyword documentation could be found at Keyword Documentation
- Add more keywords.
TODO