Package: robotframework-applicationlibrary
robotframework-applicationlibraryIntroductionRobotframework-ApplicationLibrary is a collection of libraries spanning Mobile and Windows Desktop (WinAppDriver) automation usingRobot Framework.
These libraries are and extensions of the existingAppiumLibrary. 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 ofRobotFramework-Zoombabut diverging dependency requirements lead to a need for two separate repositories.See theKeyword Documentationfor theMobileorDesktoplibraries for more specific information about the functionality.Example tests can be found in thesamples directory.Some Features of the LibraryMobile Library:Extending theAppiumLibrarywe added some quality of life 'Wait For And' type keywords:Wait For And Click ElementlocatorWait For And Click TexttextWait Until Element ContainslocatortextAs well as additional features that have yet to be implemented in AppiumLibrary:Drag and Dropsource_locatortarget_locatorDrag And Drop By Offsetlocatorx_offsety_offsetScroll Down To TexttextScroll Up To TexttextDesktop Library:Also extendsAppiumLibraryto tailor it Windows desktop automation. This includes enhancements to base keywords such asOpen ApplicationorClick Elementto perform better for windows. Other notable additions include:Start and Stop the WinAppDriver as needed (best used for suite setup/teardown):Driver SetupDriver TeardownEasily switching to new windows or the desktop session:Switch ApplicationDesktopSwitch Application By Nameremote_urlnew_window_nameA variety of keywords for controlling the mouse:Mouse Over ElementlocatorMouse Over and Click ElementlocatorMouse over and Context Click ElementlocatorMouse Over By Offsetx_offsety_offsetKeywords for dragging and dropping:Drag and Dropsource_locatortarget_locatorDrag And Drop By Offsetlocatorx_offsety_offsetThe ability to send key commands to the application:Send Keys\\ue00p\\ue00Send Keys To ElementlocatorabcSelecting an element from a combobox or a menu:Select Element From ComboBoxcombobox_locatorelement_locatorSelect Elements From Menulocator_1locator_2locator_nSelect Elements From Context Menulocator_1locator_2locator_nSelecting an element by an image file (Appium v1.18.0 and higher only):Wait For And Click Elementimage=file.pngFor WebView2 applications we can control both the application view and the Edge browser view:With the split fromRobotFramework-Zoomba, the support for this exact example won't work in this current code. An example of thiscan be found in the samples directory for robotframework-zoomba version 2.14.3 or lower.Getting StartedThe Application library is easily installed using thesetup.pyfile in the home directory.
Simply run the following command to install ApplicationLibrary and it's dependencies:pipinstallrobotframework-applicationlibraryIf 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 theroot directory:pipinstall.or if you intend to run unit tests:pipinstall.[testing]To access the keywords in the library simply add the following to your robot file settings (depending on what you are testing):***Settings***LibraryApplicationLibrary.MobileLibraryLibraryApplicationLibrary.DesktopLibraryAdditional Setup InformationIf you plan to run Mobile automation you will need to have a running appium server. To do so first haveNodeinstalled and then run the following:npminstall-gappiumappiumTo use theimagelocator strategy you will need to installopencv4nodejsvia the following command:npminstall-gopencv4nodejsAlternativelyAppium Desktopcan be used.For Windows automation we suggestinstalling and using the WinAppDriverwithout Appium as it seems to be a bit faster and more stable.Make sure toenable developer mode on your systemto allow the WinAppDriver to work.ExamplesExample tests can be found in thesamples directory.Thetest directorymay 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 thesamples directory.ContributingTo make contributions please refer to theCONTRIBUTINGguidelines.See the.githooksdirectory for scripts to help in development.SupportGeneral Robot Framework questions should be directed to thecommunity forum.For questions and issues specific to ApplicationLibrary please create anissuehere on Github.