hmalphettes / robotframework-selenium2library-extensions

Action Chains, Select IFrame and miscallenous keywords to add to robotframework-selenium2library
Apache License 2.0
23 stars 15 forks source link

robotframework-selenium2library-extensions

Extends the robotframework-selenium2library.

Extra keywords

Action Chains Lazily initiates an action chains.

Chain Sleep
Chain Click
Chain Click And Hold
Chain Drag And Drop
Chain Key Up
Chain Key Down
Chain Move By Offset
Chain Move To Element
Chain Move To Element With Offset
Chain Release
Chain Send Keys
Chain Send Keys To Element

Execute the created action chains:

Chains Perform Now

Drag and drop shortcuts: immediately performed.

Drag And Drop
Drag And Drop With Offset

Page Tests:

Select IFrame
Is Element Present
Is Visible

Note: some limitations regarding drag and drop

Note that action chains are not well supported by some dirvers. In particular, HTML5 Drag and Drop have not worked so far for firefox and chrome on my linux machine. It is working with jquery's drag and drop.

Here are some notable webkit and chrome-driver bugs to follow:

Requirements

Installation

git clone https://github.com/hmalphettes/robotframework-selenium2library-extensions.git

And in your robotframework test, import the library. For example:

*** Settings
Library           ${CURDIR}/../../src/Selenium2LibraryExtensions    WITH NAME    Selenium2LibraryExtensions

Run the tests

./test/run_tests.sh

Extending robotframework-selenium2library without forking it

Use any of the techniques documented to write a python plugin for robotframework. In your keyword's method here how to access the active selenium's browser:

selenium2lib = BuiltIn().get_library_instance('Selenium2Library') selenium_browser = selenium2lib._current_browser()

Now refer to selenium driver's python API and go wild.

License

ASL-2.0 just like robotframework-selenium2library.