diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 0ee38f2cd..23e3a3e2d 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -6,17 +6,36 @@ jobs: build: runs-on: ubuntu-latest + continue-on-error: true strategy: matrix: - python-version: [3.7, 3.9, pypy-3.7] - rf-version: [4.1.3, 5.0.1, 6.0.1] + python-version: [3.8, 3.11] # 3.12, pypy-3.9 + rf-version: [5.0.1, 6.1.1, 7.0] + selenium-version: [4.14.0, 4.15.2, 4.16.0, 4.17.2, 4.18.1, 4.19.0] + browser: [firefox, chrome, headlesschrome] #edge steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} with Robot Framework ${{ matrix.rf-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} + - name: Setup Chrome + uses: browser-actions/setup-chrome@latest + with: + chrome-version: latest + id: setup-chrome + - run: | + echo Installed chromium version: ${{ steps.setup-chrome.outputs.chrome-version }} + ${{ steps.setup-chrome.outputs.chrome-path }} --version + - name: Setup firefox + id: setup-firefox + uses: browser-actions/setup-firefox@v1 + with: + firefox-version: latest + - run: | + echo Installed firefox versions: ${{ steps.setup-firefox.outputs.firefox-version }} + ${{ steps.setup-firefox.outputs.firefox-path }} --version - name: Start xvfb run: | export DISPLAY=:99.0 @@ -27,53 +46,49 @@ jobs: python -m pip install --upgrade pip pip install -r requirements-dev.txt - name: Install dependencies for pypy - if: matrix.python-version == 'pypy-3.7' + if: matrix.python-version == 'pypy-3.9' run: | python -m pip install --upgrade pip pip install -r requirements.txt pip install robotstatuschecker>=1.4 pip install requests robotframework-pabot + - name: Install Seleninum v${{ matrix.selenium-version }} + run: | + pip install --upgrade selenium==${{ matrix.selenium-version }} - name: Install RF ${{ matrix.rf-version }} run: | pip install -U --pre robotframework==${{ matrix.rf-version }} + - name: Install drivers via selenium-manager + run: | + SELENIUM_MANAGER_EXE=$(python -c 'from selenium.webdriver.common.selenium_manager import SeleniumManager; sm=SeleniumManager(); print(f"{str(sm.get_binary())}")') + echo "$SELENIUM_MANAGER_EXE" + echo "WEBDRIVERPATH=$($SELENIUM_MANAGER_EXE --browser chrome --debug | awk '/INFO[[:space:]]Driver path:/ {print $NF;exit}')" >> "$GITHUB_ENV" + echo "$WEBDRIVERPATH" - name: Generate stub file for ${{ matrix.python-version }} - if: matrix.python-version != 'pypy-3.7' + if: matrix.python-version != 'pypy-3.9' run: | invoke gen-stub - - name: Debugging - if: matrix.python-version != 'pypy-3.7' - run: | - which python + # Temporarily ignoring pypy execution - name: Run tests with headless Chrome and with PyPy - if: matrix.python-version == 'pypy-3.7' + if: startsWith( matrix.python-version, 'pypy') == true run: | xvfb-run --auto-servernum python atest/run.py --nounit --zip headlesschrome - - name: Run tests with normal Chrome and with Python 3.7 - if: matrix.python-version == '3.7' - run: | - xvfb-run --auto-servernum python atest/run.py --zip chrome - - - name: Run tests with headless Firefox with Python 3.9 and RF 4.1.3 - if: matrix.python-version == '3.9' && matrix.rf-version == '4.1.3' + - name: Run tests with ${{ matrix.browser }} if CPython + if: startsWith( matrix.python-version, 'pypy') == false run: | - xvfb-run --auto-servernum python atest/run.py --zip headlessfirefox + xvfb-run --auto-servernum python atest/run.py --zip ${{ matrix.browser }} - - name: Run tests with normal Firefox with Python 3.9 and RF != 4.1.3 - if: matrix.python-version == '3.9' && matrix.rf-version != '4.1.3' - run: | - xvfb-run --auto-servernum python atest/run.py --zip firefox - - - name: Run tests with Selenium Grid - if: matrix.python-version == '3.8' && matrix.rf-version == '3.2.2' && matrix.python-version != 'pypy-3.7' - run: | - wget --no-verbose --output-document=./selenium-server-standalone.jar http://selenium-release.storage.googleapis.com/3.141/selenium-server-standalone-3.141.59.jar - sudo chmod u+x ./selenium-server-standalone.jar - xvfb-run --auto-servernum python atest/run.py --zip headlesschrome --grid True + # - name: Run tests with Selenium Grid + # if: matrix.python-version == '3.11' && matrix.rf-version == '3.2.2' && matrix.python-version != 'pypy-3.9' + # run: | + # wget --no-verbose --output-document=./selenium-server-standalone.jar http://selenium-release.storage.googleapis.com/3.141/selenium-server-standalone-3.141.59.jar + # sudo chmod u+x ./selenium-server-standalone.jar + # xvfb-run --auto-servernum python atest/run.py --zip headlesschrome --grid True - uses: actions/upload-artifact@v1 - if: success() || failure() + if: failure() with: - name: Failed Test results + name: SeleniumLibrary Test results path: atest/zip_results diff --git a/BUILD.rst b/BUILD.rst index 9033fdaa4..ea33b0860 100644 --- a/BUILD.rst +++ b/BUILD.rst @@ -64,7 +64,8 @@ Testing ------- Make sure that adequate tests are executed before releases are created. -See ``_ for details. +For more information about unit tests see ``_ or for +acceptance tests see ``_. Preparation ----------- diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index de1a76316..ffb9d6ff8 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -3,21 +3,22 @@ Contribution guidelines These guidelines instruct how to submit issues and contribute code to the `SeleniumLibrary project`_. Other great ways to contribute include -answering questions and participating discussion on `robotframework-users`_ -mailing list and other forums as well as spreading the word about the -framework one way or the other. +answering questions and participating in discussions within the +#seleniumlibrary channel on the community `Robot Framework Slack`_, the +`Robot Framework Forum`_ and other channels as well as spreading the word +about the framework one way or the other. Submitting issues ================= Bugs and enhancements are tracked in the `issue tracker`_. If you are unsure if something is a bug or is a feature worth -implementing, you can first ask on `robotframework-users`_ list. This and +implementing, you can first ask within the `Robot Framework Slack`_. This and other similar forums, not the issue tracker, are also places where to ask general questions. -Before submitting a new issue, it is always a good idea to check is the -same bug or enhancement already reported. If it is, please add your +Before submitting a new issue, it is always a good idea to check if the +same bug or enhancement is already reported. If it is, please add your comments to the existing issue instead of creating a new one. Reporting bugs @@ -43,9 +44,11 @@ Enhancement requests Describe the new feature and use cases for it in as much detail as possible in an issue. Especially with larger enhancements, be prepared to -contribute the code in form of a pull request as explained below or to +contribute the code in the form of a pull request as explained below or to pay someone for the work. Consider also would it be better to implement this -functionality as a separate library outside the SeleniumLibrary. +functionality as a separate library outside the SeleniumLibrary. One option +here is to extend SeleniumLibrary using the public API or plug-in api. Please +see `extending documentation`_ for more details. Code contributions ================== @@ -88,17 +91,25 @@ We do, however, recommend to create dedicated branches for pull requests instead of creating them based on the master branch. This is especially important if you plan to work on multiple pull requests at the same time. -This project requires that pull request contains linear history of commits and -we do not allow that pull request contains merge commits or other noise. This helps -the review process and makes the maintenance easier for the project administrators. -Generally it is recommended to do `git pull --rebase` instead of the `git pull --merge` -when there is need pull changes from upstream. +This project asks that prior to making an enhancement pull request that you +discuss the enhancement with the team. We wish to avoid having you spend effort on an +ehancement that won't match with the project. We require that a pull request contains +linear history of commits and we do not allow that pull request contains merge commits +or other noise. This helps the review process and makes the maintenance easier for the +project administrators. Generally it is recommended to do `git pull --rebase` instead +of the `git pull --merge` when there is need pull changes from upstream. Coding conventions ------------------ +The SeleniumLibrary team is currently reviewing, revising, and updating +the coding conventions during Q1 2024. Knowing these coding conventions +are seen as a good practice, we are leaving these here as recommendations +in the mean time but are not forcing this as a requirement for accepting +pull requests. + SeleniumLibrary uses the general Python code conventions defined in -`PEP-8`_. In addition to that, we try to write `idiomatic Python`_ +`PEP-8`_. In addition to that, we try to write `idiomatic Python`_ or `"Pythonic" code`_ and follow the `SOLID principles`_. with all new code. An important guideline is that the code should be clear enough that comments are generally not needed. @@ -145,7 +156,7 @@ individual keywords. - All new enhancements or changes should have a note telling when the change was introduced. Often adding something like - ``New in SeleniumLibray 1.8.`` is enough. + ``New in SeleniumLibrary 1.8.`` is enough. Keyword documentation can be easily created using `invoke`_ task:: @@ -159,13 +170,13 @@ Tests When submitting a pull request with a new feature or a fix, you should always include tests for your changes. These tests prove that your changes work, help prevent bugs in the future, and help document what -your changes do. Depending an the change, you may need -``acceptance tests``\ *, ``unit tests``* or both. +your changes do. Depending an the change, you may need ``acceptance tests``, +``unit tests`` or both. Make sure to run all of the tests before submitting a pull request to be sure that your changes do not break anything. If you can, test in multiple browsers and versions (Firefox, Chrome, IE, Edge etc). Pull requests -are also automatically tested on `Travis CI`_. +are also automatically tested on `GitHub Actions`_. Acceptance tests ~~~~~~~~~~~~~~~~ @@ -173,20 +184,24 @@ Acceptance tests Most of SeleniumLibrary's testing is done using acceptance tests that naturally use Robot Framework itself for testing. Every new functionality or fix should generally get one or more acceptance tests. +For more details on acceptance tests and how to run the acceptance tests, +see `atest/README.rst`_. Unit tests ~~~~~~~~~~ Unit tests are great for testing internal logic and should be added when -appropriate. For more details see `Unit and acceptance -tests `__. +appropriate. For more details on unit tests and running them, see +`utest/README.rst`_. Continuous integration ---------------------- -SeleniumLibrary's continuous integration (CI) servers are visible through -`Travis CI`_. For more details about how to run test and how `Travis CI`_ -integration is implemented can be found from the `test/README.rst`_. +SeleniumLibrary uses GitHub Actions as it's continuous integration (CI) server. + +.. ToDo: re-add when explanation of GitHUb Actions is written + More details about how `GitHub Actions`_ integration is implemented can be + found within `<.github/CI/README.rst>. Finalizing pull requests ------------------------ @@ -198,7 +213,7 @@ Acknowledgments ~~~~~~~~~~~~~~~ If you have done any non-trivial change and would like to be credited, -remind us to add `acknowledge` tag to the issue. This way we will add +remind us to add ``acknowledge`` tag to the issue. This way we will add your name to the release notes, when next release is made. Resolving conflicts @@ -209,22 +224,26 @@ the same code as your changes. In that case you should `sync your fork`_ and `resolve conflicts`_ to allow for an easy merge. .. _SeleniumLibrary project: https://github.com/robotframework/SeleniumLibrary -.. _robotframework-users: http://groups.google.com/group/robotframework-users +.. _Robot Framework Slack: https://rf-invite.herokuapp.com/ +.. _Robot Framework Forum: https://forum.robotframework.org/c/libraries/lib-seleniumlibrary/11 .. _issue tracker: https://github.com/robotframework/SeleniumLibrary/issues .. _(SSCCE): http://sscce.org +.. _extending documentation: https://github.com/robotframework/SeleniumLibrary/blob/master/docs/extending/extending.rst .. _GitHub account: https://github.com/ .. _Git: https://git-scm.com .. _set up Git: https://help.github.com/articles/set-up-git/ .. _fork a repository: https://help.github.com/articles/fork-a-repo/ .. _use pull requests: https://help.github.com/articles/using-pull-requests .. _PEP-8: https://www.python.org/dev/peps/pep-0008/ -.. _idiomatic Python: http://python.net/~goodger/projects/pycon/2007/idiomatic/handout.html +.. _idiomatic Python: https://en.wikibooks.org/wiki/Python_Programming/Idioms +.. _"Pythonic" code: https://docs.python-guide.org/writing/style/ .. _SOLID principles: https://en.wikipedia.org/wiki/SOLID_(object-oriented_design) .. _PEP-257: https://www.python.org/dev/peps/pep-0257/ .. _invoke: http://www.pyinvoke.org/ -.. _Travis CI: https://travis-ci.org/robotframework/SeleniumLibrary -.. _test/README.rst`: https://github.com/robotframework/SeleniumLibrary/blob/master/test/README.rst +.. _GitHub Actions: https://github.com/robotframework/SeleniumLibrary/actions +.. _atest/README.rst: https://github.com/robotframework/SeleniumLibrary/tree/master/atest/README.rst +.. _utest/README.rst: https://github.com/robotframework/SeleniumLibrary/blob/master/utest/README.rst .. _sync your fork: https://help.github.com/articles/syncing-a-fork/ .. _resolve conflicts: https://help.github.com/articles/resolving-a-merge-conflict-from-the-command-line .. _Black: https://github.com/psf/black -.. _flake8: https://gitlab.com/pycqa/flake8 \ No newline at end of file +.. _flake8: https://github.com/PyCQA/flake8 \ No newline at end of file diff --git a/README.rst b/README.rst index 24a36213c..68b3405d3 100644 --- a/README.rst +++ b/README.rst @@ -10,14 +10,14 @@ SeleniumLibrary_ is a web testing library for `Robot Framework`_ that utilizes the Selenium_ tool internally. The project is hosted on GitHub_ and downloads can be found from PyPI_. -SeleniumLibrary works with Selenium 3 and 4. It supports Python 3.6 or +SeleniumLibrary currently works with Selenium 4. It supports Python 3.8 or newer. In addition to the normal Python_ interpreter, it works also with PyPy_. -SeleniumLibrary is based on the `old SeleniumLibrary`_ that was forked to -Selenium2Library_ and then later renamed back to SeleniumLibrary. -See the Versions_ and History_ sections below for more information about -different versions and the overall project history. +SeleniumLibrary is based on the "old SeleniumLibrary" that was forked to +Selenium2Library and then later renamed back to SeleniumLibrary. +See the `VERSIONS.rst`_ for more information about different versions and the +overall project history. .. image:: https://img.shields.io/pypi/v/robotframework-seleniumlibrary.svg?label=version :target: https://pypi.python.org/pypi/robotframework-seleniumlibrary @@ -28,8 +28,8 @@ different versions and the overall project history. .. image:: https://img.shields.io/pypi/l/robotframework-seleniumlibrary.svg :target: https://www.apache.org/licenses/LICENSE-2.0 -.. image:: https://github.com/robotframework/SeleniumLibrary/workflows/SeleniumLibrary%20CI/badge.svg - :target: https://github.com/robotframework/SeleniumLibrary/actions?query=workflow%3A%22SeleniumLibrary+CI%22 +.. image:: https://github.com/robotframework/SeleniumLibrary/actions/workflows/CI.yml/badge.svg?branch=master + :target: https://github.com/robotframework/SeleniumLibrary/actions/workflows/CI.yml Keyword Documentation --------------------- @@ -48,23 +48,8 @@ versions, but you still need to install `browser drivers`_ separately. The ``--upgrade`` option can be omitted when installing the library for the first time. -Those migrating from Selenium2Library_ can install SeleniumLibrary so that -it is exposed also as Selenium2Library:: - - pip install --upgrade robotframework-selenium2library - -The above command installs the normal SeleniumLibrary as well as a new -Selenium2Library version that is just a thin wrapper to SeleniumLibrary. -That allows importing Selenium2Library in tests while migrating to -SeleniumLibrary. - -To install the last legacy Selenium2Library_ version, use this command instead:: - - pip install robotframework-selenium2library==1.8.0 - -With recent versions of ``pip`` it is possible to install directly from the -GitHub_ repository. To install latest source from the master branch, use -this command:: +It is possible to install directly from the GitHub_ repository. To install +latest source from the master branch, use this command:: pip install git+https://github.com/robotframework/SeleniumLibrary.git @@ -197,7 +182,6 @@ Community If the provided documentation is not enough, there are various community channels available: -- `robotframework-users`_ mailing list - ``#seleniumlibrary`` and ``#seleniumlibrary-dev`` channels in Robot Framework `Slack community`_ - `Robot Framework forum`_ has channel for SeleniumLibrary. @@ -205,89 +189,23 @@ available: requests - `Other community channels`_ including paid support -Versions --------- - -SeleniumLibrary has over the years lived under SeleniumLibrary and -Selenium2Library names and different library versions have supported -different Selenium and Python versions. This is summarized in the table -below and the History_ section afterwards explains the project history -a bit more. - -================================== ========================== ========================== =============== - Project Selenium Version Python Version Comment -================================== ========================== ========================== =============== -SeleniumLibrary 2.9.2 and earlier Selenium 1 and 2 Python 2.5-2.7 The original SeleniumLibrary using Selenium RC API. -Selenium2Library 1.8.0 and earlier Selenium 2 and 3 Python 2.6-2.7 Fork of SeleniumLibrary using Selenium WebDriver API. -SeleniumLibrary 3.0 and 3.1 Selenium 2 and 3 Python 2.7 and 3.3+ Selenium2Library renamed and with Python 3 support and new architecture. -SeleniumLibrary 3.2 Selenium 3 Python 2.7 and 3.4+ Drops Selenium 2 support. -SeleniumLibrary 4.0 Selenium 3 Python 2.7 and 3.4+ Plugin API and support for event friging webdriver. -SeleniumLibrary 4.1 Selenium 3 Python 2.7 and 3.5+ Drops Python 3.4 support. -SeleniumLibrary 4.2 Selenium 3 Python 2.7 and 3.5+ Supports only Selenium 3.141.0 or newer. -SeleniumLibrary 4.4 Selenium 3 and 4 Python 2.7 and 3.6+ New PythonLibCore and dropped Python 3.5 support. -SeleniumLibrary 5.0 Selenium 3 and 4 Python 3.6+ Python 2 and Jython support is dropped. -SeleniumLibrary 5.1 Selenium 3 and 4 Python 3.6+ Robot Framework 3.1 support is dropped. -Selenium2Library 3.0 Depends on SeleniumLibrary Depends on SeleniumLibrary Thin wrapper for SeleniumLibrary 3.0 to ease transition. -================================== ========================== ========================== =============== - -History -------- - -SeleniumLibrary originally used the Selenium Remote Controller (RC) API. -When Selenium 2 was introduced with the new but backwards incompatible -WebDriver API, SeleniumLibrary kept using Selenium RC and separate -Selenium2Library using WebDriver was forked. These projects contained -mostly the same keywords and in most cases Selenium2Library was a drop-in -replacement for SeleniumLibrary. - -Over the years development of the old SeleniumLibrary stopped and also -the Selenium RC API it used was deprecated. Selenium2Library was developed -further and replaced the old library as the de facto web testing library -for Robot Framework. - -When Selenium 3 was released in 2016, it was otherwise backwards compatible -with Selenium 2, but the deprecated Selenium RC API was removed. This had two -important effects: - -- The old SeleniumLibrary could not anymore be used with new Selenium versions. - This project was pretty much dead. -- Selenium2Library was badly named as it supported Selenium 3 just fine. - This project needed a new name. - -At the same time when Selenium 3 was released, Selenium2Library was going -through larger architecture changes in order to ease future maintenance and -to make adding Python 3 support easier. With all these big internal and -external changes, it made sense to rename Selenium2Library back to -SeleniumLibrary. This decision basically meant following changes: - -- Create separate repository for the `old SeleniumLibrary`_ to preserve - its history since Selenium2Library was forked. -- Rename Selenium2Library project and the library itself to SeleniumLibrary_. -- Add new Selenium2Library_ project to ease transitioning from Selenium2Library - to SeleniumLibrary. - -Going forward, all new development will happen in the new SeleniumLibrary -project. .. _Robot Framework: https://robotframework.org .. _Selenium: https://www.seleniumhq.org/ .. _SeleniumLibrary: https://github.com/robotframework/SeleniumLibrary -.. _Selenium2Library: https://github.com/robotframework/Selenium2Library -.. _Old SeleniumLibrary: https://github.com/robotframework/OldSeleniumLibrary .. _pip: http://pip-installer.org .. _PyPI: https://pypi.python.org/pypi/robotframework-seleniumlibrary .. _GitHub: https://github.com/robotframework/SeleniumLibrary .. _Keyword Documentation: https://robotframework.org/SeleniumLibrary/SeleniumLibrary.html .. _Python: https://python.org .. _PyPy: https://pypy.org -.. _Jython: https://jython.org/ -.. _IronPython: https://ironpython.net/ .. _demo project: https://github.com/robotframework/WebDemo .. _Robot Framework User Guide: https://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html .. _Robot Framework installation instructions: https://github.com/robotframework/robotframework/blob/master/INSTALL.rst -.. _robotframework-users: https://groups.google.com/group/robotframework-users .. _extending documentation: https://github.com/robotframework/SeleniumLibrary/blob/master/docs/extending/extending.rst .. _Slack community: https://robotframework-slack-invite.herokuapp.com .. _Robot Framework forum: https://forum.robotframework.org/ .. _issue tracker: https://github.com/robotframework/SeleniumLibrary/issues .. _Other community channels: https://robotframework.org/#community +.. _VERSIONS.rst: https://github.com/robotframework/SeleniumLibrary/blob/master/VERSIONS.rst + diff --git a/VERSIONS.rst b/VERSIONS.rst new file mode 100644 index 000000000..289736971 --- /dev/null +++ b/VERSIONS.rst @@ -0,0 +1,72 @@ +Versions +-------- + +SeleniumLibrary has over the years lived under SeleniumLibrary and +Selenium2Library names and different library versions have supported +different Selenium and Python versions. This is summarized in the table +below and the History_ section afterwards explains the project history +a bit more. + +================================== ========================== ========================== =============== + Project Selenium Version Python Version Comment +================================== ========================== ========================== =============== +SeleniumLibrary 2.9.2 and earlier Selenium 1 and 2 Python 2.5-2.7 The original SeleniumLibrary using Selenium RC API. +Selenium2Library 1.8.0 and earlier Selenium 2 and 3 Python 2.6-2.7 Fork of SeleniumLibrary using Selenium WebDriver API. +SeleniumLibrary 3.0 and 3.1 Selenium 2 and 3 Python 2.7 and 3.3+ Selenium2Library renamed and with Python 3 support and new architecture. +SeleniumLibrary 3.2 Selenium 3 Python 2.7 and 3.4+ Drops Selenium 2 support. +SeleniumLibrary 4.0 Selenium 3 Python 2.7 and 3.4+ Plugin API and support for event friging webdriver. +SeleniumLibrary 4.1 Selenium 3 Python 2.7 and 3.5+ Drops Python 3.4 support. +SeleniumLibrary 4.2 Selenium 3 Python 2.7 and 3.5+ Supports only Selenium 3.141.0 or newer. +SeleniumLibrary 4.4 Selenium 3 and 4 Python 2.7 and 3.6+ New PythonLibCore and dropped Python 3.5 support. +SeleniumLibrary 5.0 Selenium 3 and 4 Python 3.6+ Python 2 and Jython support is dropped. +SeleniumLibrary 5.1 Selenium 3 and 4 Python 3.6+ Robot Framework 3.1 support is dropped. +Selenium2Library 3.0 Depends on SeleniumLibrary Depends on SeleniumLibrary Thin wrapper for SeleniumLibrary 3.0 to ease transition. +================================== ========================== ========================== =============== + +History +------- + +SeleniumLibrary originally used the Selenium Remote Controller (RC) API. +When Selenium 2 was introduced with the new but backwards incompatible +WebDriver API, SeleniumLibrary kept using Selenium RC and separate +Selenium2Library using WebDriver was forked. These projects contained +mostly the same keywords and in most cases Selenium2Library was a drop-in +replacement for SeleniumLibrary. + +Over the years development of the old SeleniumLibrary stopped and also +the Selenium RC API it used was deprecated. Selenium2Library was developed +further and replaced the old library as the de facto web testing library +for Robot Framework. + +When Selenium 3 was released in 2016, it was otherwise backwards compatible +with Selenium 2, but the deprecated Selenium RC API was removed. This had two +important effects: + +- The old SeleniumLibrary could not anymore be used with new Selenium versions. + This project was pretty much dead. +- Selenium2Library was badly named as it supported Selenium 3 just fine. + This project needed a new name. + +At the same time when Selenium 3 was released, Selenium2Library was going +through larger architecture changes in order to ease future maintenance and +to make adding Python 3 support easier. With all these big internal and +external changes, it made sense to rename Selenium2Library back to +SeleniumLibrary. This decision basically meant following changes: + +- Create separate repository for the `old SeleniumLibrary`_ to preserve + its history since Selenium2Library was forked. +- Rename Selenium2Library project and the library itself to SeleniumLibrary_. +- Add new Selenium2Library_ project to ease transitioning from Selenium2Library + to SeleniumLibrary. + +All new development is happenning in the SeleniumLibrary project. + +Installation of legacy Selenium2Library +--------------------------------------- +To install the last legacy Selenium2Library_ version, use this command:: + + pip install robotframework-selenium2library==1.8.0 + +.. _SeleniumLibrary: https://github.com/robotframework/SeleniumLibrary +.. _Selenium2Library: https://github.com/robotframework/Selenium2Library +.. _Old SeleniumLibrary: https://github.com/robotframework/OldSeleniumLibrary diff --git a/atest/acceptance/1-plugin/plugin_does_not_exist.robot b/atest/acceptance/1-plugin/plugin_does_not_exist.robot index 503c32f71..e97d25f21 100644 --- a/atest/acceptance/1-plugin/plugin_does_not_exist.robot +++ b/atest/acceptance/1-plugin/plugin_does_not_exist.robot @@ -1,5 +1,5 @@ *** Variables *** -${SERVER}= localhost:7000 +${SERVER}= localhost:${PORT} ${BROWSER}= firefox ${REMOTE_URL}= ${NONE} ${ROOT}= http://${SERVER}/html diff --git a/atest/acceptance/1-plugin/plugin_open_browser.robot b/atest/acceptance/1-plugin/plugin_open_browser.robot index 41247443b..9d391d956 100644 --- a/atest/acceptance/1-plugin/plugin_open_browser.robot +++ b/atest/acceptance/1-plugin/plugin_open_browser.robot @@ -2,7 +2,7 @@ Library SeleniumLibrary plugins=${CURDIR}/OpenBrowserExample.py *** Variables *** -${SERVER}= localhost:7000 +${SERVER}= localhost:${PORT} ${ROOT}= http://${SERVER}/html &{EXTRA DICTIONARY} extra=dictionary key=value diff --git a/atest/acceptance/2-event_firing_webdriver/event_firing_webdriver.robot b/atest/acceptance/2-event_firing_webdriver/event_firing_webdriver.robot index 90d6598a6..2ee7904a1 100644 --- a/atest/acceptance/2-event_firing_webdriver/event_firing_webdriver.robot +++ b/atest/acceptance/2-event_firing_webdriver/event_firing_webdriver.robot @@ -1,8 +1,8 @@ *** Settings *** Library SeleniumLibrary event_firing_webdriver=${CURDIR}/../../resources/testlibs/MyListener.py Resource resource_event_firing_webdriver.robot -Suite Setup Open Browser ${FRONT PAGE} ${BROWSER} alias=event_firing_webdriver -... remote_url=${REMOTE_URL} desired_capabilities=${DESIRED_CAPABILITIES} +Suite Setup Open Browser ${FRONT_PAGE} ${BROWSER} alias=event_firing_webdriver +... remote_url=${REMOTE_URL} Suite Teardown Close All Browsers *** Variables *** @@ -12,10 +12,9 @@ ${event_firing_or_none} ${NONE} Open Browser To Start Page [Tags] NoGrid [Documentation] - ... LOG 1:37 DEBUG Wrapping driver to event_firing_webdriver. - ... LOG 1:39 INFO Got driver also from SeleniumLibrary. - Open Browser ${FRONT PAGE} ${BROWSER} remote_url=${REMOTE_URL} - ... desired_capabilities=${DESIRED_CAPABILITIES} + ... LOG 1:31 DEBUG Wrapping driver to event_firing_webdriver. + ... LOG 1:33 INFO Got driver also from SeleniumLibrary. + Open Browser ${FRONT_PAGE} ${BROWSER} remote_url=${REMOTE_URL} Event Firing Webdriver Go To (WebDriver) [Tags] NoGrid diff --git a/atest/acceptance/2-event_firing_webdriver/resource_event_firing_webdriver.robot b/atest/acceptance/2-event_firing_webdriver/resource_event_firing_webdriver.robot index ac68038d0..27e92aab7 100644 --- a/atest/acceptance/2-event_firing_webdriver/resource_event_firing_webdriver.robot +++ b/atest/acceptance/2-event_firing_webdriver/resource_event_firing_webdriver.robot @@ -1,14 +1,7 @@ -*** Variables *** -${SERVER}= localhost:7000 -${BROWSER}= Chrome -${REMOTE_URL}= ${NONE} -${DESIRED_CAPABILITIES}= ${NONE} -${ROOT}= http://${SERVER}/html -${FRONT_PAGE}= ${ROOT}/ - -*** Keyword *** +*** Settings *** +Resource ../variables.robot +*** Keywords *** Go To Page "${relative url}" [Documentation] Goes to page Go To ${ROOT}/${relative url} - diff --git a/atest/acceptance/__init__.robot b/atest/acceptance/__init__.robot index 632c26b08..cc9186ad0 100644 --- a/atest/acceptance/__init__.robot +++ b/atest/acceptance/__init__.robot @@ -1,4 +1,4 @@ -*** Setting *** +*** Settings *** Resource resource.robot Force Tags Regression diff --git a/atest/acceptance/big_list_of_naught_strings.robot b/atest/acceptance/big_list_of_naught_strings.robot index 3ab67c007..fbfaf6f22 100644 --- a/atest/acceptance/big_list_of_naught_strings.robot +++ b/atest/acceptance/big_list_of_naught_strings.robot @@ -1,4 +1,4 @@ -*** Setting *** +*** Settings *** Resource resource.robot Library BigListOfNaughtyStrings.BigListOfNaughtyStrings WITH NAME blns diff --git a/atest/acceptance/create_webdriver.robot b/atest/acceptance/create_webdriver.robot index 788936c3c..0ee079522 100644 --- a/atest/acceptance/create_webdriver.robot +++ b/atest/acceptance/create_webdriver.robot @@ -1,4 +1,4 @@ -*** Setting *** +*** Settings *** Documentation Tests Webdriver Resource resource.robot Library Collections @@ -7,7 +7,7 @@ Library Collections Create Webdriver Creates Functioning WebDriver [Documentation] ... LOG 1:1 INFO REGEXP: Creating an instance of the \\w+ WebDriver. - ... LOG 1:25 DEBUG REGEXP: Created \\w+ WebDriver instance with session id (\\w|-)+. + ... LOG 1:19 DEBUG REGEXP: Created \\w+ WebDriver instance with session id (\\w|-)+. [Tags] Known Issue Internet Explorer Known Issue Safari [Setup] Set Driver Variables Create Webdriver ${DRIVER_NAME} kwargs=${KWARGS} @@ -30,7 +30,7 @@ Create Webdriver With Bad Keyword Argument Dictionary [Documentation] Invalid arguments types ${status} ${error} = Run Keyword And Ignore Error Create Webdriver Firefox kwargs={'spam': 'eggs'} Should Be Equal ${status} FAIL - Should Match Regexp ${error} (TypeError: __init__\\(\\) got an unexpected keyword argument 'spam'|kwargs must be a dictionary\.) + Should Match Regexp ${error} (TypeError: (?:WebDriver.)?__init__\\(\\) got an unexpected keyword argument 'spam'|kwargs must be a dictionary\.) *** Keywords *** Set Driver Variables @@ -42,8 +42,7 @@ Set Driver Variables Set Test Variable ${DRIVER_NAME} ${name} ${dc names}= Create Dictionary ff=FIREFOX firefox=FIREFOX ie=INTERNETEXPLORER ... internetexplorer=INTERNETEXPLORER googlechrome=CHROME gc=CHROME - ... chrome=CHROME htmlunit=HTMLUNIT htmlunitwithjs=HTMLUNITWITHJS - ... safari=SAFARI headlessfirefox=FIREFOX headlesschrome=CHROME + ... chrome=CHROME safari=SAFARI headlessfirefox=FIREFOX headlesschrome=CHROME ${dc name}= Get From Dictionary ${dc names} ${BROWSER.lower().replace(' ', '')} ${caps}= Evaluate selenium.webdriver.DesiredCapabilities.${dc name} ... modules=selenium, selenium.webdriver diff --git a/atest/acceptance/expected_conditions.robot.PROTOTYPE b/atest/acceptance/expected_conditions.robot.PROTOTYPE new file mode 100644 index 000000000..06c471857 --- /dev/null +++ b/atest/acceptance/expected_conditions.robot.PROTOTYPE @@ -0,0 +1,34 @@ +*** Test Cases *** +# Wait Until Element State Is (Not) +# Get Element State +# Element States Should (Not) Be + +Check waiting for condition that takes a element + Fail + +Check waiting for condition that takes a title + Fail + +Check waiting for condition that takes a url + Fail + Wait Until url contains google + # verify took 2 seconds + +Check waiting for condition that takes locator and string + Wait Until Element State Is ${condition} ${locator} ${string} + Wait Until Element State Is ${condition} ${element} + Wait Until Condition Is ${condition} ${target} + Wait Until Condition Is ${condition} ${whatelse you need for this condition} + + + Wait Until State Is number_of_windows_to_be + Wait Until Expected Condition Is number_of_windows_to_be + Wait Until Condition Is number of windows to be 5 + Wait Until Condition Is text to be present in element attribute //some/xpath/to/an/element href http://hello + + Wait Until Condition Is number of windows to be 5 text to be present in element attribute //some/xpath/to/an/element href http://hello + + Wait Until number of windows to be 5 + Wait Until text to be present in element attribute //some/xpath/to/an/element href http://hello + Get Condition + Is number of windows to be 5 \ No newline at end of file diff --git a/atest/acceptance/keywords/async_javascript.robot b/atest/acceptance/keywords/async_javascript.robot index 2a9f8fcbd..7fc72b198 100644 --- a/atest/acceptance/keywords/async_javascript.robot +++ b/atest/acceptance/keywords/async_javascript.robot @@ -19,6 +19,14 @@ Execute Async Javascript With ARGUMENTS and JAVASCRIPT Marker ... alert(arguments[0]); Alert Should Be Present 123 timeout=10 s +Execute Javascript with dictionary object + &{ARGS}= Create Dictionary key=value number=${1} boolean=${TRUE} + ${returned} Execute Async Javascript arguments[1](arguments[0]); ARGUMENTS ${ARGS} + Should Be True type($returned) == dict + Should Be Equal ${returned}[key] value + Should Be Equal ${returned}[number] ${1} + Should Be Equal ${returned}[boolean] ${TRUE} + Should Be Able To Return Javascript Primitives From Async Scripts Neither None Nor Undefined ${result} = Execute Async Javascript arguments[arguments.length - 1](123); Should Be Equal ${result} ${123} diff --git a/atest/acceptance/keywords/choose_file.robot b/atest/acceptance/keywords/choose_file.robot index b706dda55..c03b12751 100644 --- a/atest/acceptance/keywords/choose_file.robot +++ b/atest/acceptance/keywords/choose_file.robot @@ -45,11 +45,11 @@ Choose File With Grid From Library Using SL choose_file method Input Text Should Work Same Way When Not Using Grid [Documentation] - ... LOG 1:6 DEBUG GLOB: POST*/session/*/clear {"* - ... LOG 1:9 DEBUG Finished Request - ... LOG 1:10 DEBUG GLOB: POST*/session/*/value*"text": "* - ... LOG 1:13 DEBUG Finished Request - ... LOG 1:14 DEBUG NONE + ... LOG 1:6 DEBUG GLOB: POST*/session/*/clear {* + ... LOG 1:9 DEBUG Finished Request + ... LOG 1:10 DEBUG REGEXP: POST.*/session/.*/value.*['\\\"]text['\\\"]: ['\\\"].* + ... LOG 1:13 DEBUG Finished Request + ... LOG 1:14 DEBUG NONE [Tags] NoGrid [Setup] Touch ${CURDIR}${/}temp.txt Input Text file_to_upload ${CURDIR}${/}temp.txt diff --git a/atest/acceptance/keywords/click_element.robot b/atest/acceptance/keywords/click_element.robot index 4464ad874..d1fd4d4b3 100644 --- a/atest/acceptance/keywords/click_element.robot +++ b/atest/acceptance/keywords/click_element.robot @@ -40,7 +40,7 @@ Click Element Action Chain [Tags] NoGrid [Documentation] ... LOB 1:1 INFO Clicking 'singleClickButton' using an action chain. - ... LOG 1:6 DEBUG GLOB: *actions {"actions": [{* + ... LOG 1:6 DEBUG REGEXP: .*actions {['\\\"]actions['\\\"]: \\\[\\\{.* Click Element singleClickButton action_chain=True Element Text Should Be output single clicked diff --git a/atest/acceptance/keywords/click_element_modifier.robot b/atest/acceptance/keywords/click_element_modifier.robot index f83a0317d..f3b9ac5ce 100644 --- a/atest/acceptance/keywords/click_element_modifier.robot +++ b/atest/acceptance/keywords/click_element_modifier.robot @@ -5,19 +5,23 @@ Resource ../resource.robot *** Test Cases *** Click Element Modifier CTRL + [Tags] SKIP_ON_MAC Click Element Button modifier=CTRL Element Text Should Be output CTRL click Click Link Modifier CTRL + [Tags] SKIP_ON_MAC Click Link link text modifier=CTRL Element Text Should Be output CTRL click [Teardown] Close Popup Window Click Button Modifier CTRL + [Tags] SKIP_ON_MAC Click Button Click me! modifier=CTRL Element Text Should Be output CTRL click Click Image Modifier CTRL + [Tags] SKIP_ON_MAC Click Image robot modifier=CTRL Element Text Should Be output CTRL click @@ -46,7 +50,7 @@ Click Element Action Chain and modifier [Documentation] LOG 1:1 INFO Clicking element 'Button' with CTRL. Click Element Button modifier=CTRL action_chain=True Element Text Should Be output CTRL click - + *** Keywords *** Initialize Page Reload Page diff --git a/atest/acceptance/keywords/content_assertions.robot b/atest/acceptance/keywords/content_assertions.robot index a9f53ec70..7e115b0e8 100644 --- a/atest/acceptance/keywords/content_assertions.robot +++ b/atest/acceptance/keywords/content_assertions.robot @@ -33,7 +33,7 @@ Page Should Contain Using Default Custom Log Level ... 'TRACE' - noting the excluded second argument for the `Page Should Contain` ... keyword) fails and the log contains the html content. ... FAIL Page should have contained text 'non existing text' but did not. - ... LOG 2:19 TRACE REGEXP: (?i) + ... LOG 2:19 TRACE REGEXP: ... LOG 2:20 FAIL Page should have contained text 'non existing text' but did not. ${old_level}= Set Log Level TRACE Page Should Contain non existing text @@ -53,7 +53,7 @@ Page Should Contain With Custom Log Level INFO [Tags] NoGrid [Documentation] Html content is shown at the explicitly specified INFO level. ... FAIL Page should have contained text 'non existing text' but did not. - ... LOG 1:18 INFO REGEXP: (?i) + ... LOG 1:18 INFO REGEXP: ... LOG 1:19 FAIL Page should have contained text 'non existing text' but did not. Page Should Contain non existing text INFO @@ -61,7 +61,7 @@ Page Should Contain With Custom Log Level WARN [Tags] NoGrid [Documentation] Html content is shown at the explicitly specified WARN level. ... FAIL Page should have contained text 'non existing text' but did not. - ... LOG 1:18 WARN REGEXP: (?i) + ... LOG 1:18 WARN REGEXP: ... LOG 1:19 FAIL Page should have contained text 'non existing text' but did not. Page Should Contain non existing text WARN @@ -69,7 +69,7 @@ Page Should Contain With Custom Log Level DEBUG [Tags] NoGrid [Documentation] Html content is shown at the explicitly specified DEBUG level. ... FAIL Page should have contained text 'non existing text' but did not. - ... LOG 1:18 DEBUG REGEXP: (?i) + ... LOG 1:18 DEBUG REGEXP: ... LOG 1:19 FAIL Page should have contained text 'non existing text' but did not. Page Should Contain non existing text DEBUG @@ -77,7 +77,7 @@ Page Should Contain With Custom Log Level TRACE [Tags] NoGrid [Documentation] Html content is shown at the explicitly specified TRACE level. ... FAIL Page should have contained text 'non existing text' but did not. - ... LOG 2:19 TRACE REGEXP: (?i) + ... LOG 2:19 TRACE REGEXP: ... LOG 2:20 FAIL Page should have contained text 'non existing text' but did not. Set Log Level TRACE Page Should Contain non existing text TRACE @@ -122,7 +122,7 @@ Page Should Not Contain Page Should Not Contain With Custom Log Level [Tags] NoGrid - [Documentation] LOG 1.1:13 DEBUG REGEXP: (?i) + [Documentation] LOG 1.1:13 DEBUG REGEXP: Run Keyword And Expect Error ... Page should not have contained text 'needle'. ... Page Should Not Contain needle DEBUG diff --git a/atest/acceptance/keywords/cookies.robot b/atest/acceptance/keywords/cookies.robot index a457842e5..81e22c453 100644 --- a/atest/acceptance/keywords/cookies.robot +++ b/atest/acceptance/keywords/cookies.robot @@ -1,9 +1,10 @@ -*** Setting *** +*** Settings *** Documentation Tests cookies Suite Setup Go To Page "cookies.html" Suite Teardown Delete All Cookies Test Setup Add Cookies Resource ../resource.robot +Library DateTime *** Test Cases *** Get Cookies @@ -13,7 +14,7 @@ Get Cookies Get Cookies As Dict ${cookies}= Get Cookies as_dict=True - ${expected_cookies}= Create Dictionary test=seleniumlibrary another=value + ${expected_cookies}= Create Dictionary test=seleniumlibrary another=value far_future=timemachine Dictionaries Should Be Equal ${expected_cookies} ${cookies} App Sees Cookie Set By Selenium @@ -35,21 +36,22 @@ Add Cookie When Secure Is False Should Be Equal ${cookie.secure} ${False} Add Cookie When Expiry Is Epoch - Add Cookie Cookie1 value1 expiry=1698601011 + Add Cookie Cookie1 value1 expiry=1730205247 ${cookie} = Get Cookie Cookie1 - ${expiry} = Convert Date ${1698601011} exclude_millis=True + ${expiry} = Convert Date ${1730205247} exclude_millis=True Should Be Equal As Strings ${cookie.expiry} ${expiry} Add Cookie When Expiry Is Human Readable Data&Time - Add Cookie Cookie12 value12 expiry=2023-10-29 19:36:51 + Add Cookie Cookie12 value12 expiry=2024-10-29 19:36:51 ${cookie} = Get Cookie Cookie12 - Should Be Equal As Strings ${cookie.expiry} 2023-10-29 19:36:51 + Should Be Equal As Strings ${cookie.expiry} 2024-10-29 19:36:51 Delete Cookie [Tags] Known Issue Safari Delete Cookie test - ${cookies} = Get Cookies - Should Be Equal ${cookies} another=value + ${cookies} = Get Cookies as_dict=True + ${expected_cookies} Create Dictionary far_future=timemachine another=value + Dictionaries Should Be Equal ${cookies} ${expected_cookies} Non-existent Cookie Run Keyword And Expect Error @@ -71,12 +73,12 @@ Get Cookies As Dict When There Are None Test Get Cookie Object Expiry ${cookie} = Get Cookie another - Should Be Equal As Integers ${cookie.expiry.year} 2023 - Should Be Equal As Integers ${cookie.expiry.month} 10 - Should Be Equal As Integers ${cookie.expiry.day} 29 - Should Be Equal As Integers ${cookie.expiry.hour} 19 - Should Be Equal As Integers ${cookie.expiry.minute} 36 - Should Be Equal As Integers ${cookie.expiry.second} 51 + Should Be Equal As Integers ${cookie.expiry.year} ${tomorrow_thistime_datetime.year} + Should Be Equal As Integers ${cookie.expiry.month} ${tomorrow_thistime_datetime.month} + Should Be Equal As Integers ${cookie.expiry.day} ${tomorrow_thistime_datetime.day} + Should Be Equal As Integers ${cookie.expiry.hour} ${tomorrow_thistime_datetime.hour} + Should Be Equal As Integers ${cookie.expiry.minute} ${tomorrow_thistime_datetime.minute} + Should Be Equal As Integers ${cookie.expiry.second} ${tomorrow_thistime_datetime.second} Should Be Equal As Integers ${cookie.expiry.microsecond} 0 Test Get Cookie Object Domain @@ -106,18 +108,23 @@ Test Get Cookie Object Value Test Get Cookie Keyword Logging [Tags] NoGrid Known Issue Firefox [Documentation] - ... LOG 1:5 ${cookie} = name=another - ... value=value + ... LOG 1:5 GLOB: ${cookie} = name=far_future + ... value=timemachine ... path=/ ... domain=localhost ... secure=False ... httpOnly=False - ... expiry=2023-10-29 19:36:51 + ... expiry=2024-09-15 *:22:33 ... extra={'sameSite': 'Lax'} - ${cookie} = Get Cookie another + ${cookie} = Get Cookie far_future -*** Keyword *** +*** Keywords *** Add Cookies Delete All Cookies Add Cookie test seleniumlibrary - Add Cookie another value expiry=2023-10-29 19:36:51 + ${now} = Get Current Date + ${tomorrow_thistime} = Add Time To Date ${now} 1 day + ${tomorrow_thistime_datetime} = Convert Date ${tomorrow_thistime} datetime + Set Suite Variable ${tomorrow_thistime_datetime} + Add Cookie another value expiry=${tomorrow_thistime} + Add Cookie far_future timemachine expiry=1726399353 # 2024-09-15 11:22:33 diff --git a/atest/acceptance/keywords/elements.robot b/atest/acceptance/keywords/elements.robot index 95bf90734..a93ccd219 100644 --- a/atest/acceptance/keywords/elements.robot +++ b/atest/acceptance/keywords/elements.robot @@ -60,6 +60,92 @@ Get Element Attribute ${class}= Get Element Attribute ${second_div} class Should Be Equal ${class} Second Class +# About DOM Attributes and Properties +# ----------------------------------- +# When implementing the new `Get DOM Attirbute` and `Get Property` keywords (#1822), several +# questions were raised. Fundamentally what is the difference between a DOM attribute and +# a Property. As [1] explains "Attributes are defined by HTML. Properties are defined by the +# DOM (Document Object Model)." +# +# Below are some references which talk to some descriptions and oddities of DOM attributes +# and properties. +# +# References: +# [1] HTML attributes and DOM properties: +# https://angular.io/guide/binding-syntax#html-attribute-vs-dom-property +# [2] W3C HTML Specification - Section 13.1.2.3 Attributes: +# https://html.spec.whatwg.org/multipage/syntax.html#attributes-2 +# [3] JavaScript.Info - Attributes and properties: +# https://javascript.info/dom-attributes-and-properties +# [4] "Which CSS properties are inherited?" - StackOverflow +# https://stackoverflow.com/questions/5612302/which-css-properties-are-inherited +# [5] MDN Web Docs: Attribute +# https://developer.mozilla.org/en-US/docs/Glossary/Attribute +# [6] MDN Web Docs: HTML attribute reference +# https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes + +Get DOM Attribute + # Test get DOM attribute + ${id}= Get DOM Attribute link:Link with id id + Should Be Equal ${id} some_id + # Test custom attribute + ${existing_custom_attr}= Get DOM Attribute id:emptyDiv data-id + Should Be Equal ${existing_custom_attr} my_id + ${doesnotexist_custom_attr}= Get DOM Attribute id:emptyDiv data-doesnotexist + Should Be Equal ${doesnotexist_custom_attr} ${None} + # Get non existing DOM Attribute + ${class}= Get DOM Attribute link:Link with id class + Should Be Equal ${class} ${NONE} + +More DOM Attributes + [Setup] Go To Page "forms/enabled_disabled_fields_form.html" + # Test get empty boolean attribute + ${disabled}= Get DOM Attribute css:input[name="disabled_input"] disabled + Should Be Equal ${disabled} true + # Test boolean attribute whose value is a string + ${disabled}= Get DOM Attribute css:input[name="disabled_password"] disabled + Should Be Equal ${disabled} true + # Test empty string as the value for the attribute + ${empty_value}= Get DOM Attribute css:input[name="disabled_password"] value + Should Be Equal ${empty_value} ${EMPTY} + # Test non-existing attribute + ${disabled}= Get DOM Attribute css:input[name="enabled_password"] disabled + Should Be Equal ${disabled} ${NONE} + +Get Property + [Setup] Go To Page "forms/enabled_disabled_fields_form.html" + ${tagName_prop}= Get Property css:input[name="readonly_empty"] tagName + Should Be Equal ${tagName_prop} INPUT + # Get a boolean property + ${isConnected}= Get Property css:input[name="readonly_empty"] isConnected + Should Be Equal ${isConnected} ${True} + # Test property which returns webelement + ${children_prop}= Get Property id:table1 children + Length Should Be ${children_prop} ${1} + ${isWebElement}= Evaluate isinstance($children_prop[0], selenium.webdriver.remote.webelement.WebElement) modules=selenium + Should Be Equal ${isWebElement} ${True} + # ToDo: need to test own versus inherited property + # ToDo: Test enumerated property + +Get "Attribute" That Is Both An DOM Attribute and Property + [Setup] Go To Page "forms/enabled_disabled_fields_form.html" + ${value_property}= Get Property css:input[name="readonly_empty"] value + ${value_attribute}= Get DOM Attribute css:input[name="readonly_empty"] value + Should Be Equal ${value_property} ${value_attribute} + +Modify "Attribute" That Is Both An DOM Attribute and Property + [Setup] Go To Page "forms/prefilled_email_form.html" + ${initial_value_property}= Get Property css:input[name="email"] value + ${initial_value_attribute}= Get DOM Attribute css:input[name="email"] value + Should Be Equal ${initial_value_property} ${initial_value_attribute} + Should Be Equal ${initial_value_attribute} Prefilled Email + Input Text css:input[name="email"] robot@robotframework.org + ${changed_value_property}= Get Property css:input[name="email"] value + ${changed_value_attribute}= Get DOM Attribute css:input[name="email"] value + Should Not Be Equal ${changed_value_property} ${changed_value_attribute} + Should Be Equal ${changed_value_attribute} Prefilled Email + Should Be Equal ${changed_value_property} robot@robotframework.org + Get Element Attribute Value Should Be Should Be Succesfull Element Attribute Value Should Be link=Absolute external link href http://www.google.com/ Element Attribute Value Should Be link=Absolute external link nothere ${None} @@ -70,7 +156,7 @@ Get Element Attribute And Element Attribute Value Should Be Should have same res Element Attribute Value Should Be css=#second_div class ${attribute_value} Get Element Attribute Value Should Be Should Be Succesfull with non-ascii characters - Element Attribute Value Should Be link=Link with Unicode äöüÄÖÜß href http://localhost:7000/html/index.html + Element Attribute Value Should Be link=Link with Unicode äöüÄÖÜß href ${FRONT_PAGE}index.html Get Element Attribute Value Should Be Should Be Succesfull error and error messages Run Keyword And Expect Error @@ -83,8 +169,8 @@ Get Element Attribute Value Should Be Should Be Succesfull error and error messa ... Element with locator 'id=non_existing' not found. ... Element Attribute Value Should Be id=non_existing href http://non_existing.com Run Keyword And Expect Error - ... Element 'link=Target opens in new window' attribute should have value 'http://localhost:7000/html/indéx.html' (str) but its value was 'http://localhost:7000/html/index.html' (str). - ... Element Attribute Value Should Be link=Target opens in new window href http://localhost:7000/html/indéx.html + ... Element 'link=Target opens in new window' attribute should have value '${FRONT_PAGE}indéx.html' (str) but its value was '${FRONT_PAGE}index.html' (str). + ... Element Attribute Value Should Be link=Target opens in new window href ${FRONT_PAGE}indéx.html Get Horizontal Position ${pos}= Get Horizontal Position link=Link diff --git a/atest/acceptance/keywords/expected_conditions.robot b/atest/acceptance/keywords/expected_conditions.robot new file mode 100644 index 000000000..4fa40dbfe --- /dev/null +++ b/atest/acceptance/keywords/expected_conditions.robot @@ -0,0 +1,52 @@ +*** Settings *** +Test Setup Go To Page "javascript/expected_conditions.html" +Resource ../resource.robot + +*** Test Cases *** +Wait For Expected Conditions One Argument + Title Should Be Original + Click Element link=delayed change title + Wait For Expected Condition title_is Delayed + Title Should Be Delayed + +Wait For Expected Condition Times out within set timeout + [Documentation] FAIL REGEXP: TimeoutException: Message: Expected Condition not met within set timeout of 0.3* + Title Should Be Original + Click Element link=delayed change title + Wait For Expected Condition title_is Delayed timeout=0.3 + +Wait For Expected Conditions using WebElement as locator + Click Button Change the button state + ${dynamic_btn}= Get WebElement id:enabledDisabledBtn + Wait For Expected Condition element_to_be_clickable ${dynamic_btn} + +Wait For Expected Conditions Where Condition Written With Spaces + Title Should Be Original + Click Element link=delayed change title + Wait For Expected Condition title is Delayed + Title Should Be Delayed + +Wait For Expected Conditions Where Condition Is Variable + ${condition}= Set Variable title is + Title Should Be Original + Click Element link=delayed change title + Wait For Expected Condition ${condition} Delayed + Title Should Be Delayed + +Wait For Expected Conditions Where Condition Is Strange Case + Click Button Change the button state + ${dynamic_btn}= Get WebElement id:enabledDisabledBtn + Wait For Expected Condition EleMENT tO BE cLiCkAbLe ${dynamic_btn} + +Wait For Non Existing Expected Conditions + Click Button Change the button state + ${dynamic_btn}= Get WebElement id:enabledDisabledBtn + Run Keyword And Expect Error this_is_not_an_expected_con_dition is an unknown expected condition + ... Wait For Expected Condition this_is not an expected con dition ${dynamic_btn} + +Wait For Expected Conditions When Condition Includes Locator + Title Should Be Original + ${byElem}= Evaluate ("id","added_btn") + Click Element link:delayed add element + Wait For Expected Condition Presence Of Element Located ${byElem} + Click Element id:added_btn \ No newline at end of file diff --git a/atest/acceptance/keywords/frames.robot b/atest/acceptance/keywords/frames.robot index 0e0c10e61..c9d65d1e3 100644 --- a/atest/acceptance/keywords/frames.robot +++ b/atest/acceptance/keywords/frames.robot @@ -1,4 +1,4 @@ -*** Setting *** +*** Settings *** Documentation Tests frames Test Setup Go To Page "frames/frameset.html" Test Teardown UnSelect Frame diff --git a/atest/acceptance/keywords/javascript.robot b/atest/acceptance/keywords/javascript.robot index 2a2195cb2..a8d61fa7f 100644 --- a/atest/acceptance/keywords/javascript.robot +++ b/atest/acceptance/keywords/javascript.robot @@ -85,6 +85,14 @@ Execute Javascript from File With ARGUMENTS Marker ... 123 Alert Should Be Present 123 timeout=10 s +Execute Javascript with dictionary object + &{ARGS}= Create Dictionary key=value number=${1} boolean=${TRUE} + ${returned} Execute JavaScript return arguments[0] ARGUMENTS ${ARGS} + Should Be True type($returned) == dict + Should Be Equal ${returned}[key] value + Should Be Equal ${returned}[number] ${1} + Should Be Equal ${returned}[boolean] ${TRUE} + Open Context Menu [Tags] Known Issue Safari Go To Page "javascript/context_menu.html" diff --git a/atest/acceptance/keywords/location.robot b/atest/acceptance/keywords/location.robot index 58525018c..d96fdb3aa 100644 --- a/atest/acceptance/keywords/location.robot +++ b/atest/acceptance/keywords/location.robot @@ -44,12 +44,13 @@ Wait Until Location Contains At The End Wait Until Location Contains In The Middle [Setup] Go To Page "javascript/wait_location.html" Click Element button - Wait Until Location Contains 7000 + Wait Until Location Contains ${PORT} Wait Until Location Contains As Number [Setup] Go To Page "javascript/wait_location.html" Click Element button - Wait Until Location Contains ${7000} + ${number} Convert To Integer ${PORT} + Wait Until Location Contains ${number} Wait Until Location Contains Fails [Setup] Go To Page "javascript/wait_location.html" @@ -70,7 +71,7 @@ Wait Until Location Contains Fails With Timeout Wait Until Location Is [Setup] Go To Page "javascript/wait_location.html" Click Element button - Wait Until Location Is http://localhost:7000/html/ + Wait Until Location Is ${FRONT_PAGE} Wait Until Location Is Fails [Setup] Go To Page "javascript/wait_location.html" @@ -91,14 +92,14 @@ Wait Until Location Is Fails With Timeout Wait Until Location Is Not [Setup] Go To Page "javascript/wait_location.html" Click Element button - Wait Until Location Is Not http://localhost:7000/html/javascript/wait_location.html + Wait Until Location Is Not ${FRONT_PAGE}javascript/wait_location.html Wait Until Location Is Not Fail [Setup] Go To Page "javascript/wait_location.html" ${orig_timeout}= Set Selenium Timeout 2 s Run Keyword And Expect Error - ... Location is 'http://localhost:7000/html/javascript/wait_location.html' in 2 seconds. - ... Wait Until Location Is Not http://localhost:7000/html/javascript/wait_location.html + ... Location is '${FRONT_PAGE}javascript/wait_location.html' in 2 seconds. + ... Wait Until Location Is Not ${FRONT_PAGE}javascript/wait_location.html Set Selenium Timeout ${orig_timeout} Wait Until Location Is Not Fails With Timeout @@ -106,16 +107,17 @@ Wait Until Location Is Not Fails With Timeout ${orig_timeout}= Set Selenium Timeout 2 s Click Element button Run Keyword And Expect Error - ... Location is 'http://localhost:7000/html/javascript/wait_location.html' in 750 milliseconds. - ... Wait Until Location Is Not http://localhost:7000/html/javascript/wait_location.html timeout=750ms + ... Location is '${FRONT_PAGE}javascript/wait_location.html' in 750 milliseconds. + ... Wait Until Location Is Not ${FRONT_PAGE}javascript/wait_location.html timeout=750ms Set Selenium Timeout ${orig_timeout} Wait Until Location Is Not Fails With Message [Setup] Go To Page "javascript/wait_location.html" + Sleep 1s # Make sure you don't check too soon ${orig_timeout}= Set Selenium Timeout 2 s Run Keyword And Expect Error ... my_message - ... Wait Until Location Is Not http://localhost:7000/html/javascript/wait_location.html message=my_message + ... Wait Until Location Is Not ${FRONT_PAGE}javascript/wait_location.html message=my_message Set Selenium Timeout ${orig_timeout} Wait Until Location Does Not Contain @@ -142,9 +144,10 @@ Wait Until Location Does Not Contain Fail In The Middle Wait Until Location Does Not Contain Fail As Number [Setup] Go To Page "javascript/wait_location.html" ${orig_timeout}= Set Selenium Timeout 2 s + ${number} Convert To Integer ${PORT} run keyword and expect error - ... Location did contain '${7000}' in 2 seconds. - ... Wait Until Location Does Not Contain ${7000} + ... Location did contain '${number}' in 2 seconds. + ... Wait Until Location Does Not Contain ${number} Set Selenium Timeout ${orig_timeout} Wait Until Location Does Not Contain Fail At The End diff --git a/atest/acceptance/keywords/page_load_timeout.robot b/atest/acceptance/keywords/page_load_timeout.robot index 44fb2a1cb..a39df7d50 100644 --- a/atest/acceptance/keywords/page_load_timeout.robot +++ b/atest/acceptance/keywords/page_load_timeout.robot @@ -7,8 +7,9 @@ Test Teardown Close Browser And Reset Page Load Timeout *** Test Cases *** Should Open Browser With Default Page Load Timeout [Documentation] Verify that 'Open Browser' changes the page load timeout. - ... LOG 1.1.1:33 DEBUG REGEXP: POST http://localhost:\\d{2,5}/session/[a-f0-9-]+/timeouts {"pageLoad": 300000} - ... LOG 1.1.1:35 DEBUG STARTS: Remote response: status=200 + ... LOG 1.1.1:27 DEBUG REGEXP: POST http://localhost:\\d{2,5}/session/[a-f0-9-]+/timeouts {['\\\"]pageLoad['\\\"]: 300000} + ... LOG 1.1.1:29 DEBUG STARTS: Remote response: status=200 + # Note: previous log check was 33 and 37. Recording to see if something is swtiching back and forth Open Browser To Start Page Should Run Into Timeout Exception @@ -20,8 +21,8 @@ Should Run Into Timeout Exception Should Set Page Load Timeout For All Opened Browsers [Documentation] One browser is already opened as global suite setup. - ... LOG 2:1 DEBUG REGEXP: POST http://localhost:\\d{2,5}/session/[a-f0-9-]+/timeouts {"pageLoad": 5000} - ... LOG 2:5 DEBUG REGEXP: POST http://localhost:\\d{2,5}/session/[a-f0-9-]+/timeouts {"pageLoad": 5000} + ... LOG 2:1 DEBUG REGEXP: POST http://localhost:\\d{2,5}/session/[a-f0-9-]+/timeouts {['\\\"]pageLoad['\\\"]: 5000} + ... LOG 2:5 DEBUG REGEXP: POST http://localhost:\\d{2,5}/session/[a-f0-9-]+/timeouts {['\\\"]pageLoad['\\\"]: 5000} Open Browser To Start Page Set Selenium Page Load Timeout 5 s diff --git a/atest/acceptance/keywords/screenshots_embed.robot b/atest/acceptance/keywords/screenshots_embed.robot index 2c8799126..3ab3ef2f5 100644 --- a/atest/acceptance/keywords/screenshots_embed.robot +++ b/atest/acceptance/keywords/screenshots_embed.robot @@ -38,10 +38,10 @@ Capture Page Screenshot Override EMBED [Setup] Remove .png Files Set Screenshot Directory EMBED ${file}= Capture Page Screenshot override-embed-screenshot.png - Should Be Equal ${file} ${OUTPUTDIR}/override-embed-screenshot.png - File Should Exist ${OUTPUTDIR}/override-embed-screenshot.png - File Should Not Exist ${EXECDIR}/*.png - File Should Not Exist ${EXECDIR}/EMBED/*.png + Should Be Equal ${file} ${OUTPUTDIR}${/}override-embed-screenshot.png + File Should Exist ${OUTPUTDIR}${/}override-embed-screenshot.png + File Should Not Exist ${EXECDIR}${/}*.png + File Should Not Exist ${EXECDIR}${/}EMBED${/}*.png *** Keywords *** Remove .png Files diff --git a/atest/acceptance/keywords/textfields.robot b/atest/acceptance/keywords/textfields.robot index a537ecd64..1fa6f4522 100644 --- a/atest/acceptance/keywords/textfields.robot +++ b/atest/acceptance/keywords/textfields.robot @@ -1,4 +1,4 @@ -*** Setting *** +*** Settings *** Test Setup Go To Page "forms/prefilled_email_form.html" Resource ../resource.robot Force Tags Known Issue Internet Explorer @@ -39,7 +39,7 @@ Input Password Should Not Log Password String ... LOG 1:8 DEBUG STARTS: Remote response ... LOG 1:9 DEBUG Finished Request ... LOG 1:10 INFO Temporally setting log level to: NONE - ... LOG 1:11 INFO Log level changed from NONE to DEBUG. + ... LOG 1:11 ANY Log level changed from NONE to DEBUG. ... LOG 1:12 NONE ... LOG 2:1 INFO Typing text 'username' into text field 'username_field'. Input Password password_field password diff --git a/atest/acceptance/keywords/textfields_html5.robot b/atest/acceptance/keywords/textfields_html5.robot index 72ebe41ac..be8901134 100644 --- a/atest/acceptance/keywords/textfields_html5.robot +++ b/atest/acceptance/keywords/textfields_html5.robot @@ -1,4 +1,4 @@ -*** Setting *** +*** Settings *** Test Setup Go To Page "forms/html5_input_types.html" Resource ../resource.robot diff --git a/atest/acceptance/locators/locator_parsing.robot b/atest/acceptance/locators/locator_parsing.robot index eca57d054..2efb1586f 100644 --- a/atest/acceptance/locators/locator_parsing.robot +++ b/atest/acceptance/locators/locator_parsing.robot @@ -52,6 +52,10 @@ Multiple Locators as a List should work ${locator_list} = Create List id:div_id ${element} id:bar=foo Page Should Contain Element ${locator_list} +WebElement as locator should work + ${element} = Get WebElement id:foo:bar + Page Should Contain Element ${element} + When One Of Locator From Multiple Locators Is Not Found Keyword Fails Run Keyword And Expect Error ... Element with locator 'id:not_here' not found. diff --git a/atest/acceptance/multiple_browsers_multiple_windows.robot b/atest/acceptance/multiple_browsers_multiple_windows.robot index ceb0c2035..a8837965e 100644 --- a/atest/acceptance/multiple_browsers_multiple_windows.robot +++ b/atest/acceptance/multiple_browsers_multiple_windows.robot @@ -1,4 +1,4 @@ -*** Setting *** +*** Settings *** Documentation These tests must open own browser because windows opened by ... earlier tests would otherwise be visible to Get Window XXX keywords ... even if those windows were closed. diff --git a/atest/acceptance/multiple_browsers_options.robot b/atest/acceptance/multiple_browsers_options.robot index 2ff672361..40ce798d7 100644 --- a/atest/acceptance/multiple_browsers_options.robot +++ b/atest/acceptance/multiple_browsers_options.robot @@ -9,36 +9,36 @@ Documentation Creating test which would work on all browser is not possible. *** Test Cases *** Chrome Browser With Selenium Options As String [Documentation] - ... LOG 1:20 DEBUG GLOB: *"goog:chromeOptions"* - ... LOG 1:20 DEBUG GLOB: *args": ["--disable-dev-shm-usage"?* + ... LOG 1:14 DEBUG REGEXP: .*['\\\"]goog:chromeOptions['\\\"].* + ... LOG 1:14 DEBUG REGEXP: .*args['\\\"]: \\\[['\\\"]--disable-dev-shm-usage['\\\"].* Open Browser ${FRONT PAGE} ${BROWSER} remote_url=${REMOTE_URL} ... desired_capabilities=${DESIRED_CAPABILITIES} options=add_argument("--disable-dev-shm-usage") - -Chrome Browser With Selenium Options As String With Attirbute As True + +Chrome Browser With Selenium Options As String With Attribute As True [Documentation] - ... LOG 1:20 DEBUG GLOB: *"goog:chromeOptions"* - ... LOG 1:20 DEBUG GLOB: *args": ["--disable-dev-shm-usage"?* - ... LOG 1:20 DEBUG GLOB: *"--headless"* + ... LOG 1:14 DEBUG REGEXP: .*['\\\"]goog:chromeOptions['\\\"].* + ... LOG 1:14 DEBUG REGEXP: .*args['\\\"]: \\\[['\\\"]--disable-dev-shm-usage['\\\"].* + ... LOG 1:14 DEBUG REGEXP: .*['\\\"]--headless=new['\\\"].* Open Browser ${FRONT PAGE} ${BROWSER} remote_url=${REMOTE_URL} - ... desired_capabilities=${DESIRED_CAPABILITIES} options=add_argument ( "--disable-dev-shm-usage" ) ; headless = True - + ... desired_capabilities=${DESIRED_CAPABILITIES} options=add_argument ( "--disable-dev-shm-usage" ) ; add_argument ( "--headless=new" ) + Chrome Browser With Selenium Options With Complex Object [Tags] NoGrid [Documentation] - ... LOG 1:20 DEBUG GLOB: *"goog:chromeOptions"* - ... LOG 1:20 DEBUG GLOB: *"mobileEmulation": {"deviceName": "Galaxy S5"* - ... LOG 1:20 DEBUG GLOB: *args": ["--disable-dev-shm-usage"?* + ... LOG 1:14 DEBUG REGEXP: .*['\\\"]goog:chromeOptions['\\\"].* + ... LOG 1:14 DEBUG REGEXP: .*['\\\"]mobileEmulation['\\\"]: {['\\\"]deviceName['\\\"]: ['\\\"]Galaxy S5['\\\"].* + ... LOG 1:14 DEBUG REGEXP: .*args['\\\"]: \\\[['\\\"]--disable-dev-shm-usage['\\\"].* Open Browser ${FRONT PAGE} ${BROWSER} remote_url=${REMOTE_URL} ... desired_capabilities=${DESIRED_CAPABILITIES} options=add_argument ( "--disable-dev-shm-usage" ) ; add_experimental_option( "mobileEmulation" , { 'deviceName' : 'Galaxy S5'}) - + Chrome Browser With Selenium Options Object [Documentation] - ... LOG 2:20 DEBUG GLOB: *"goog:chromeOptions"* - ... LOG 2:20 DEBUG GLOB: *args": ["--disable-dev-shm-usage"?* + ... LOG 2:14 DEBUG REGEXP: .*['\\\"]goog:chromeOptions['\\\"].* + ... LOG 2:14 DEBUG REGEXP: .*args['\\\"]: \\\[['\\\"]--disable-dev-shm-usage['\\\"].* ${options} = Get Chrome Options Open Browser ${FRONT PAGE} ${BROWSER} remote_url=${REMOTE_URL} ... desired_capabilities=${DESIRED_CAPABILITIES} options=${options} - + Chrome Browser With Selenium Options Invalid Method Run Keyword And Expect Error AttributeError: 'Options' object has no attribute 'not_here_method' ... Open Browser ${FRONT PAGE} ${BROWSER} remote_url=${REMOTE_URL} @@ -47,7 +47,24 @@ Chrome Browser With Selenium Options Invalid Method Chrome Browser With Selenium Options Argument With Semicolon [Documentation] - ... LOG 1:20 DEBUG GLOB: *"goog:chromeOptions"* - ... LOG 1:20 DEBUG GLOB: *["has;semicolon"* + ... LOG 1:14 DEBUG REGEXP: .*['\\\"]goog:chromeOptions['\\\"].* + ... LOG 1:14 DEBUG REGEXP: .*\\\[['\\\"]has;semicolon['\\\"].* Open Browser ${FRONT PAGE} ${BROWSER} remote_url=${REMOTE_URL} ... desired_capabilities=${DESIRED_CAPABILITIES} options=add_argument("has;semicolon") + +Chrome Browser with Selenium Options Ending With Semicolon + Open Browser ${FRONT PAGE} ${BROWSER} remote_url=${REMOTE_URL} + ... desired_capabilities=${DESIRED_CAPABILITIES} options=add_argument("--disable-dev-shm-usage") ; + +Chrome Browser with Selenium Options Ending With A Few Semicolons + Open Browser ${FRONT PAGE} ${BROWSER} remote_url=${REMOTE_URL} + ... desired_capabilities=${DESIRED_CAPABILITIES} options=add_argument("--disable-dev-shm-usage") ; ; ; + +Chrome Browser with Selenium Options Containing Empty Option + Open Browser ${FRONT PAGE} ${BROWSER} remote_url=${REMOTE_URL} + ... desired_capabilities=${DESIRED_CAPABILITIES} options=add_argument ( "--disable-dev-shm-usage" ) ; ; add_argument ( "--headless=new" ) + +Chrome Browser with Selenium Options With A Missing Semicolon + Run Keyword And Expect Error ValueError: Unable to parse option: "add_argument ( "--disable-dev-shm-usage" ) add_argument ( "--headless=new" )" + ... Open Browser ${FRONT PAGE} ${BROWSER} remote_url=${REMOTE_URL} + ... desired_capabilities=${DESIRED_CAPABILITIES} options=add_argument ( "--disable-dev-shm-usage" ) add_argument ( "--headless=new" ) diff --git a/atest/acceptance/multiple_browsers_service_log_path.robot b/atest/acceptance/multiple_browsers_service_log_path.robot index cdbbfb563..ee22a3b25 100644 --- a/atest/acceptance/multiple_browsers_service_log_path.robot +++ b/atest/acceptance/multiple_browsers_service_log_path.robot @@ -7,20 +7,22 @@ First Browser With Service Log Path [Documentation] ... LOG 1:2 INFO STARTS: Browser driver log file created to: [Setup] OperatingSystem.Remove Files ${OUTPUT DIR}/${BROWSER}.log - Open Browser ${FRONT PAGE} ${BROWSER} service_log_path=${BROWSER}.log + Open Browser ${FRONT PAGE} ${BROWSER} service_log_path=${OUTPUT DIR}/${BROWSER}.log + OperatingSystem.List Directories In Directory ${OUTPUT DIR}/ + ${output}= OperatingSystem.Run ls -lh OperatingSystem.File Should Not Be Empty ${OUTPUT DIR}/${BROWSER}.log Second Browser With Service Log Path And Index [Setup] OperatingSystem.Remove Files ${OUTPUT DIR}/${BROWSER}-1.log - Open Browser ${FRONT PAGE} ${BROWSER} service_log_path=${BROWSER}-{index}.log + Open Browser ${FRONT PAGE} ${BROWSER} service_log_path=${OUTPUT DIR}/${BROWSER}-{index}.log OperatingSystem.File Should Not Be Empty ${OUTPUT DIR}/${BROWSER}-1.log Third Browser With Service Log Path And Index Should Not Overwrite [Setup] OperatingSystem.Remove Files ${OUTPUT DIR}/${BROWSER}-2.log - Open Browser ${FRONT PAGE} ${BROWSER} service_log_path=${BROWSER}-{index}.log + Open Browser ${FRONT PAGE} ${BROWSER} service_log_path=${OUTPUT DIR}/${BROWSER}-{index}.log OperatingSystem.File Should Not Be Empty ${OUTPUT DIR}/${BROWSER}-2.log Fourth Browser With Service Log Path In Subfolder [Setup] OperatingSystem.Remove Files ${OUTPUT DIR}/a_folder/${BROWSER}-1.log - Open Browser ${FRONT PAGE} ${BROWSER} service_log_path=a_folder/${BROWSER}-{index}.log + Open Browser ${FRONT PAGE} ${BROWSER} service_log_path=${OUTPUT DIR}/a_folder/${BROWSER}-{index}.log OperatingSystem.File Should Not Be Empty ${OUTPUT DIR}/a_folder/${BROWSER}-1.log diff --git a/atest/acceptance/open_and_close.robot b/atest/acceptance/open_and_close.robot index 368ea4bf0..aad19deb9 100644 --- a/atest/acceptance/open_and_close.robot +++ b/atest/acceptance/open_and_close.robot @@ -16,8 +16,8 @@ Close Browser Does Nothing When No Browser Is Opened Browser Open With Not Well-Formed URL Should Close [Documentation] Verify after incomplete 'Open Browser' browser closes - ... LOG 1.1:41 DEBUG STARTS: Opened browser with session id - ... LOG 1.1:41 DEBUG REGEXP: .*but failed to open url.* + ... LOG 1.1:35 DEBUG STARTS: Opened browser with session id + ... LOG 1.1:35 DEBUG REGEXP: .*but failed to open url.* ... LOG 2:2 DEBUG STARTS: DELETE ... LOG 2:5 DEBUG STARTS: Finished Request Run Keyword And Expect Error * Open Browser bad.url.bad ${BROWSER} diff --git a/atest/acceptance/remote_browsers.robot.TRIAGE b/atest/acceptance/remote_browsers.robot.TRIAGE new file mode 100644 index 000000000..c5e4639d8 --- /dev/null +++ b/atest/acceptance/remote_browsers.robot.TRIAGE @@ -0,0 +1,34 @@ +*** Settings *** +Library SeleniumLibrary +Library Process + +*** Variables *** +${URL} https://robotframework.org/ +${REMOTE_BETA} http://localhost:7272 + +*** Test Cases *** +Open Chrome with Remote Webdriver without Options + # [Setup] StartDriver chromedriver + Open Browser + ... url=${URL} + ... browser=chrome + ... remote_url=${REMOTE_BETA} + # [Teardown] Stop Driver + +Open Edge with Remote Webdriver without Options + # [Setup] StartDriver msedgedriver + Open Browser + ... url=${URL} + ... browser=edge + ... remote_url=${REMOTE_BETA} + # [Teardown] Stop Driver + +*** Keywords *** +Start Driver + [Arguments] ${driver_cmd} + Start Process ${driver_cmd} --port:7272 + ${result}= Wait For Process timeout=30secs + Process Should Be Running error_message=Unable to start driver with command ${driver_cmd} + +Stop Driver + Terminate Process \ No newline at end of file diff --git a/atest/acceptance/resource.robot b/atest/acceptance/resource.robot index 2ff32f7c8..7b429d0ff 100644 --- a/atest/acceptance/resource.robot +++ b/atest/acceptance/resource.robot @@ -1,19 +1,11 @@ -*** Setting *** +*** Settings *** Library SeleniumLibrary run_on_failure=Nothing implicit_wait=0.2 seconds Library Collections Library OperatingSystem Library DateTime +Resource variables.robot -*** Variable *** -${SERVER}= localhost:7000 -${BROWSER}= firefox -${REMOTE_URL}= ${NONE} -${DESIRED_CAPABILITIES}= ${NONE} -${ROOT}= http://${SERVER}/html -${FRONT_PAGE}= ${ROOT}/ -${SPEED}= 0 - -*** Keyword *** +*** Keywords *** Open Browser To Start Page [Documentation] This keyword also tests 'Set Selenium Speed' and 'Set Selenium Timeout' ... against all reason. diff --git a/atest/acceptance/variables.robot b/atest/acceptance/variables.robot new file mode 100644 index 000000000..b613ccb5a --- /dev/null +++ b/atest/acceptance/variables.robot @@ -0,0 +1,9 @@ +*** Variables *** +${PORT}= 7000 +${SERVER}= localhost:${PORT} +${BROWSER}= firefox +${REMOTE_URL}= ${NONE} +${DESIRED_CAPABILITIES}= ${NONE} +${ROOT}= http://${SERVER}/html +${FRONT_PAGE}= ${ROOT}/ +${SPEED}= 0 \ No newline at end of file diff --git a/atest/acceptance/windows.robot b/atest/acceptance/windows.robot index 733d59d16..25b6ab1f4 100644 --- a/atest/acceptance/windows.robot +++ b/atest/acceptance/windows.robot @@ -1,4 +1,4 @@ -*** Setting *** +*** Settings *** Documentation These tests must open own browser because windows opened by ... earlier tests would otherwise be visible to Get Window XXX keywords ... even if those windows were closed. @@ -114,6 +114,31 @@ Set Window Position using strings Should Be Equal ${x} ${200} Should Be Equal ${y} ${100} +Test Minimize and Maximize Will Actually Move and Resize Window + [Tags] Triage + Set Window Position 300 200 + Set Window Size 400 300 + ${isHidden}= Execute Javascript return document.hidden; + Should Not Be True ${isHidden} + + Minimize Browser Window + + ${isHidden}= Execute Javascript return document.hidden; + Should Be True ${isHidden} + + Maximize Browser Window + + ${isHidden}= Execute Javascript return document.hidden; + Should Not Be True ${isHidden} + + ${x} ${y}= Get Window Position + ${width} ${height}= Get Window Size + # Windows: Can't test for zero in multi-monitor setups + Should Not Be Equal ${x} ${300} + Should Not Be Equal ${y} ${200} + Should Be True ${width} > 400 + Should Be True ${height} > 300 + Select Window By Title After Close Window [Tags] Known Issue Internet Explorer Known Issue Safari Cannot Be Executed in IE diff --git a/atest/resources/html/javascript/dynamic_content.html b/atest/resources/html/javascript/dynamic_content.html index 284d5d4ee..8c602cd64 100644 --- a/atest/resources/html/javascript/dynamic_content.html +++ b/atest/resources/html/javascript/dynamic_content.html @@ -10,10 +10,17 @@ container = document.getElementById(target_container); container.appendChild(p); } + + function delayed_title_change() { + setTimeout(function(){ + document.title='Delayed'; + },600); + } change title
+ delayed change title
add content
title to ääää

diff --git a/atest/resources/html/javascript/expected_conditions.html b/atest/resources/html/javascript/expected_conditions.html new file mode 100644 index 000000000..621421e83 --- /dev/null +++ b/atest/resources/html/javascript/expected_conditions.html @@ -0,0 +1,95 @@ + + + + + Original + + + + + + + change title
+ delayed change title
+ delayed add element
+ add content
+ title to ääää
+

+ Change Title
+ Add Content
+

+
+
+
+
+
+ +
+

+ + +

+

+

+

+

+

+ + + + + + +
+

+ + + diff --git a/atest/resources/html/javascript/wait_location.html b/atest/resources/html/javascript/wait_location.html index c4e96c147..68bc0478e 100644 --- a/atest/resources/html/javascript/wait_location.html +++ b/atest/resources/html/javascript/wait_location.html @@ -5,7 +5,8 @@ setTimeout('doLocation()', 1000) } function doLocation() { - self.location = 'http://localhost:7000/html/' + var base_url = window.location.origin; + self.location = `${base_url}/html/` } diff --git a/atest/resources/testserver/testserver.py b/atest/resources/testserver/testserver.py index 565c6506f..b3e582e88 100644 --- a/atest/resources/testserver/testserver.py +++ b/atest/resources/testserver/testserver.py @@ -1,6 +1,7 @@ # Initially based on: # http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/336012 +import argparse import os import sys @@ -40,11 +41,14 @@ def start_server(path, port=7000): if __name__ == "__main__": - if len(sys.argv) != 2 or sys.argv[1] not in ["start", "stop"]: - print("usage: %s start|stop" % sys.argv[0]) - sys.exit(1) - if sys.argv[1] == "start": + parser = argparse.ArgumentParser() + parser.add_argument("command", choices=["start", "stop"]) + parser.add_argument("--port", default=7000, type=int) + args = parser.parse_args() + port = args.port + command = args.command + if command == "start": path = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) - start_server(path) + start_server(path, port) else: - stop_server() + stop_server(port) diff --git a/atest/run.py b/atest/run.py index e4059716f..3e7960a15 100755 --- a/atest/run.py +++ b/atest/run.py @@ -52,6 +52,8 @@ from robot import rebot_cli from robot import __version__ as robot_version +from selenium import __version__ as selenium_version +from selenium.webdriver.common.utils import free_port from robot.utils import is_truthy try: @@ -106,10 +108,12 @@ def acceptance_tests( if os.path.exists(RESULTS_DIR): shutil.rmtree(RESULTS_DIR) os.mkdir(RESULTS_DIR) + port = free_port() + print(f"Using port: {port}") if grid: hub, node = start_grid() - with http_server(interpreter): - execute_tests(interpreter, browser, rf_options, grid, event_firing) + with http_server(interpreter, port): + execute_tests(interpreter, browser, rf_options, grid, event_firing, port) failures = process_output(browser) if failures: print( @@ -177,23 +181,23 @@ def _grid_status(status=False, role="hub"): @contextmanager -def http_server(interpreter): +def http_server(interpreter, port:int): serverlog = open(os.path.join(RESULTS_DIR, "serverlog.txt"), "w") interpreter = "python" if not interpreter else interpreter process = subprocess.Popen( - [interpreter, HTTP_SERVER_FILE, "start"], + [interpreter, HTTP_SERVER_FILE, "start", "--port", str(port)], stdout=serverlog, stderr=subprocess.STDOUT, ) try: yield finally: - subprocess.call([interpreter, HTTP_SERVER_FILE, "stop"]) + subprocess.call([interpreter, HTTP_SERVER_FILE, "stop", "--port", str(port)]) process.wait() serverlog.close() -def execute_tests(interpreter, browser, rf_options, grid, event_firing): +def execute_tests(interpreter, browser, rf_options, grid, event_firing, port): options = [] if grid: runner = interpreter.split() + [ @@ -203,7 +207,11 @@ def execute_tests(interpreter, browser, rf_options, grid, event_firing): "2", ] else: - runner = interpreter.split() + ["-m", "robot.run"] + runner = interpreter.split() + ["-m", "robot.run", "--variable", f"PORT:{port}"] + if platform.system() == "Darwin": + runner.append("--exclude") + runner.append("SKIP_ON_MAC") + options.extend([opt.format(browser=browser) for opt in ROBOT_OPTIONS]) if rf_options: options += rf_options @@ -251,15 +259,15 @@ def process_output(browser): return exit.code -def create_zip(): +def create_zip(browser = None): if os.path.exists(ZIP_DIR): shutil.rmtree(ZIP_DIR) os.mkdir(ZIP_DIR) python_version = platform.python_version() - zip_name = f"rf-{robot_version}-python-{python_version}.zip" + zip_name = f"rf-{robot_version}-python-{python_version}-selenium-{selenium_version}-{browser}.zip" zip_path = os.path.join(ZIP_DIR, zip_name) print("Zip created in: %s" % zip_path) - zip_file = zipfile.ZipFile(zip_path, "w") + zip_file = zipfile.ZipFile(zip_path, "a") for root, dirs, files in os.walk(RESULTS_DIR): for file in files: file_path = os.path.join(root, file) @@ -326,5 +334,5 @@ def create_zip(): interpreter, browser, rf_options, selenium_grid, event_firing_webdriver ) if args.zip: - create_zip() + create_zip(browser) sys.exit(failures) diff --git a/docs/SeleniumLibrary-6.1.2.rst b/docs/SeleniumLibrary-6.1.2.rst new file mode 100644 index 000000000..454b70fad --- /dev/null +++ b/docs/SeleniumLibrary-6.1.2.rst @@ -0,0 +1,77 @@ +===================== +SeleniumLibrary 6.1.2 +===================== + + +.. default-role:: code + + +SeleniumLibrary_ is a web testing library for `Robot Framework`_ that utilizes +the Selenium_ tool internally. SeleniumLibrary 6.1.2 is a hotfix release +focused on bug fixes for setting configuration options when using a remote Edge +or Safari Browser. + +If you have pip_ installed, just run + +:: + + pip install --upgrade robotframework-seleniumlibrary + +to install the latest available release or use + +:: + + pip install robotframework-seleniumlibrary==6.1.2 + +to install exactly this version. Alternatively you can download the source +distribution from PyPI_ and install it manually. + +SeleniumLibrary 6.1.2 was released on Saturday September 9, 2023. SeleniumLibrary supports +Python 3.7+, Selenium 4.3+ and Robot Framework 4.1.3 or higher. + +.. _Robot Framework: http://robotframework.org +.. _SeleniumLibrary: https://github.com/robotframework/SeleniumLibrary +.. _Selenium: http://seleniumhq.org +.. _pip: http://pip-installer.org +.. _PyPI: https://pypi.python.org/pypi/robotframework-seleniumlibrary +.. _issue tracker: https://github.com/robotframework/SeleniumLibrary/issues?q=milestone%3Av6.1.2 + + +.. contents:: + :depth: 2 + :local: + +Most important enhancements +=========================== + +- Missing "Options" setup in EDGE browser for remote url execution (`#1844`_, rc 1) + + The browser options if given within the ``Open Browser`` or `Create WebDriver`` keyword were not being + passed to either a remote Edge or remote Safari browser. This has been fixed within this release. + +Acknowledgements +================ + +- I want to thank @ap0087105 for pointing out the library was missing "Options" setup within Edge and + Safari remote url execution (`#1844`_, rc 1) + +Full list of fixes and enhancements +=================================== + +.. list-table:: + :header-rows: 1 + + * - ID + - Type + - Priority + - Summary + - Added + * - `#1844`_ + - bug + - high + - Missing "Options" setup in EDGE browser for remote url execution + - rc 1 + +Altogether 1 issue. View on the `issue tracker `__. + +.. _#1844: https://github.com/robotframework/SeleniumLibrary/issues/1844 diff --git a/docs/SeleniumLibrary-6.1.2rc1.rst b/docs/SeleniumLibrary-6.1.2rc1.rst new file mode 100644 index 000000000..20089bc04 --- /dev/null +++ b/docs/SeleniumLibrary-6.1.2rc1.rst @@ -0,0 +1,78 @@ +======================== +SeleniumLibrary 6.1.2rc1 +======================== + + +.. default-role:: code + + +SeleniumLibrary_ is a web testing library for `Robot Framework`_ that utilizes +the Selenium_ tool internally. SeleniumLibrary 6.1.2rc1 is a hotfix release +focused on bug fixes for setting configuration options when using a remote Edge +or Safari Browser. + +If you have pip_ installed, just run + +:: + + pip install --pre --upgrade robotframework-seleniumlibrary + +to install the latest available release or use + +:: + + pip install robotframework-seleniumlibrary==6.1.2rc1 + +to install exactly this version. Alternatively you can download the source +distribution from PyPI_ and install it manually. + +SeleniumLibrary 6.1.2rc1 was released on Friday August 25, 2023. SeleniumLibrary supports +Python 3.7+, Selenium 4.3+ and Robot Framework 4.1.3 or higher. + +.. _Robot Framework: http://robotframework.org +.. _SeleniumLibrary: https://github.com/robotframework/SeleniumLibrary +.. _Selenium: http://seleniumhq.org +.. _pip: http://pip-installer.org +.. _PyPI: https://pypi.python.org/pypi/robotframework-seleniumlibrary +.. _issue tracker: https://github.com/robotframework/SeleniumLibrary/issues?q=milestone%3Av6.1.2 + + +.. contents:: + :depth: 2 + :local: + +Most important enhancements +=========================== + +- Missing "Options" setup in EDGE browser for remote url execution (`#1844`_, rc 1) + + The browser options if given within the ``Open Browser`` or `Create WebDriver`` keyword were not being + passed to either a remote Edge or remote Safari browser. This has been fixed within this release. + +Acknowledgements +================ + + +- I want to thank @ap0087105 for pointing out the library was missing "Options" setup within Edge and + Safari remote url execution (`#1844`_, rc 1) + +Full list of fixes and enhancements +=================================== + +.. list-table:: + :header-rows: 1 + + * - ID + - Type + - Priority + - Summary + - Added + * - `#1844`_ + - bug + - high + - Missing "Options" setup in EDGE browser for remote url execution + - rc 1 + +Altogether 1 issue. View on the `issue tracker `__. + +.. _#1844: https://github.com/robotframework/SeleniumLibrary/issues/1844 diff --git a/docs/SeleniumLibrary-6.1.3.rst b/docs/SeleniumLibrary-6.1.3.rst new file mode 100644 index 000000000..ee40a2330 --- /dev/null +++ b/docs/SeleniumLibrary-6.1.3.rst @@ -0,0 +1,74 @@ +===================== +SeleniumLibrary 6.1.3 +===================== + + +.. default-role:: code + + +SeleniumLibrary_ is a web testing library for `Robot Framework`_ that utilizes +the Selenium_ tool internally. SeleniumLibrary 6.1.3 is a hotfix release +that fixes an issue with remote browsers when options are not provided. + +If you have pip_ installed, just run + +:: + + pip install --upgrade robotframework-seleniumlibrary + +to install the latest available release or use + +:: + + pip install robotframework-seleniumlibrary==6.1.3 + +to install exactly this version. Alternatively you can download the source +distribution from PyPI_ and install it manually. + +SeleniumLibrary 6.1.3 was released on Thursday October 12, 2023. SeleniumLibrary supports +Python 3.8+, Selenium 4.3+ and Robot Framework 4.1.3 or higher. + +.. _Robot Framework: http://robotframework.org +.. _SeleniumLibrary: https://github.com/robotframework/SeleniumLibrary +.. _Selenium: http://seleniumhq.org +.. _pip: http://pip-installer.org +.. _PyPI: https://pypi.python.org/pypi/robotframework-seleniumlibrary +.. _issue tracker: https://github.com/robotframework/SeleniumLibrary/issues?q=milestone%3Av6.1.3 + + +.. contents:: + :depth: 2 + :local: + +Most important enhancements +=========================== + +- Remote browser fails when no options provided (`#1855`_) + + For several of the remote browsers we need to initialize the options if none are provided. + In addition the deprecated and removed from selenium desired_capabilities have been removed + from SeleniumLibrary v6.1.3. + +Acknowledgements +================ + +- I want to thank Tero Lempiäinen for pointing out this issue (`#1855`_) + +Full list of fixes and enhancements +=================================== + +.. list-table:: + :header-rows: 1 + + * - ID + - Type + - Priority + - Summary + * - `#1855`_ + - bug + - critical + - Remote browser fails when no options provided + +Altogether 1 issue. View on the `issue tracker `__. + +.. _#1855: https://github.com/robotframework/SeleniumLibrary/issues/1855 diff --git a/docs/SeleniumLibrary-6.1.3b1.rst b/docs/SeleniumLibrary-6.1.3b1.rst new file mode 100644 index 000000000..eaa96bf5d --- /dev/null +++ b/docs/SeleniumLibrary-6.1.3b1.rst @@ -0,0 +1,80 @@ +======================= +SeleniumLibrary 6.1.3b1 +======================= + + +.. default-role:: code + + +SeleniumLibrary_ is a web testing library for `Robot Framework`_ that utilizes +the Selenium_ tool internally. SeleniumLibrary 6.1.3b1 is a is a hotfix release +that fixes an issue with remote browsers when options are not provided. + +All issues targeted for SeleniumLibrary v6.1.3 can be found +from the `issue tracker`_. + +If you have pip_ installed, just run + +:: + + pip install --pre --upgrade robotframework-seleniumlibrary + +to install the latest available release or use + +:: + + pip install robotframework-seleniumlibrary==6.1.3b1 + +to install exactly this version. Alternatively you can download the source +distribution from PyPI_ and install it manually. + +SeleniumLibrary 6.1.3b1 was released on Sunday September 24, 2023. SeleniumLibrary supports +Python 3.8+, Selenium 4.3+ and +Robot Framework 4.1.3 or higher. + +.. _Robot Framework: http://robotframework.org +.. _SeleniumLibrary: https://github.com/robotframework/SeleniumLibrary +.. _Selenium: http://seleniumhq.org +.. _pip: http://pip-installer.org +.. _PyPI: https://pypi.python.org/pypi/robotframework-seleniumlibrary +.. _issue tracker: https://github.com/robotframework/SeleniumLibrary/issues?q=milestone%3Av6.1.3 + + +.. contents:: + :depth: 2 + :local: + +Most important enhancements +=========================== + +- Remote browser fails when no options provided (`#1855`_, b 1) + + For several of the remote browsers we need to initialize the options if none are provided. + In addition the deprecated and removed from selenium desired_capabilities have been removed + from SeleniumLibrary v6.1.3b1. + +Acknowledgements +================ + +- I want to thank Tero Lempiäinen for pointing out this issue (`#1855`_, b 1) + +Full list of fixes and enhancements +=================================== + +.. list-table:: + :header-rows: 1 + + * - ID + - Type + - Priority + - Summary + - Added + * - `#1855`_ + - bug + - critical + - Remote browser fails when no options provided + - b 1 + +Altogether 1 issue. View on the `issue tracker `__. + +.. _#1855: https://github.com/robotframework/SeleniumLibrary/issues/1855 \ No newline at end of file diff --git a/docs/SeleniumLibrary-6.2.0.rst b/docs/SeleniumLibrary-6.2.0.rst new file mode 100644 index 000000000..542bb66a1 --- /dev/null +++ b/docs/SeleniumLibrary-6.2.0.rst @@ -0,0 +1,124 @@ +===================== +SeleniumLibrary 6.2.0 +===================== + + +.. default-role:: code + + +SeleniumLibrary_ is a web testing library for `Robot Framework`_ that utilizes +the Selenium_ tool internally. SeleniumLibrary 6.2.0 is a new release with +compatibility fixes for recent selenium versions and some bug fixes. + +If you have pip_ installed, just run + +:: + + pip install --upgrade robotframework-seleniumlibrary + +to install the latest available release or use + +:: + + pip install robotframework-seleniumlibrary==6.2.0 + +to install exactly this version. Alternatively you can download the source +distribution from PyPI_ and install it manually. + +SeleniumLibrary 6.2.0 was released on Friday November 24, 2023. SeleniumLibrary supports +Python 3.8 through 3.11, Selenium 4.12.0 through 4.15.2 and +Robot Framework 5.0.1 and 6.1.1. + +.. _Robot Framework: http://robotframework.org +.. _SeleniumLibrary: https://github.com/robotframework/SeleniumLibrary +.. _Selenium: http://seleniumhq.org +.. _pip: http://pip-installer.org +.. _PyPI: https://pypi.python.org/pypi/robotframework-seleniumlibrary +.. _issue tracker: https://github.com/robotframework/SeleniumLibrary/issues?q=milestone%3Av6.2.0 + + +.. contents:: + :depth: 2 + :local: + +Most important enhancements +=========================== + +- Remove deprecated headless option for chrome and firefox. (`#1858`_) + If one specified either `headlesschrome` or `headlessfirefox` as the browser within the + Open Browser keyword, then the library would handle setting this option with the underlying + Selenium driver. But the methods to do so were depracted and then removed in Selenium + v4.13.0. Thus one was not getting a headless browser in these instances. This resolves that + issue. + +- Resolve issue with service log_path now log_output. (`#1870`_) + Selenium changed the arguments for the service log within v4.13.0. This change allows for a + seamless usage across versions before and after v4.13.0. + +- Execute JavaScript converts arguments to strings with robot==6.1 (`#1843`_) + If any ARGUMENTS were passed into either the `Execute Javascript` or `Execute Async Javascript` + then they were converted to strings even if they were of some other type. This has been + corrected within this release. + +Acknowledgements +================ + +I want to thank the following for helping to get out this release, + +- `René Rohner `_ for pointing out that Create Webdriver had a + mutable default value (`#1817`_) +- `Kieran Trautwein `_ for resolving the issue with + deprecated headless option for chrome and firefox. (`#1858`_) +- `Nicholas Bollweg `_ for assisting in resolving the issue + with service log_path now log_output. (`#1870`_) +- `Igor Kozyrenko `_ for reporting the argument issue with Execute + JavaScript and `René Rohner `_for resolving it. (`#1843`_) +- `Robin Matz `_ for improving the documentation on page load + timeout (`#1821`_) +- `Dor Blayzer `_ for reporting and fixing the SeleniumLibrary CI badge. () + +and **Yuri Verweij, Lisa Crispin, and Tatu Aalto**. + +Full list of fixes and enhancements +=================================== + +.. list-table:: + :header-rows: 1 + + * - ID + - Type + - Priority + - Summary + * - `#1817`_ + - bug + - critical + - Create Webdriver has mutable default value + * - `#1858`_ + - bug + - critical + - Remove deprecated headless option for chrome and firefox. + * - `#1870`_ + - bug + - critical + - Resolve issue with service log_path now log_output. + * - `#1843`_ + - bug + - high + - Execute JavaScript converts arguments to strings with robot==6.1 + * - `#1821`_ + - enhancement + - medium + - Improve documentation on page load timeout + * - `#1872`_ + - --- + - medium + - fix: Selenium CI badge show wrong status + +Altogether 6 issues. View on the `issue tracker `__. + +.. _#1817: https://github.com/robotframework/SeleniumLibrary/issues/1817 +.. _#1858: https://github.com/robotframework/SeleniumLibrary/issues/1858 +.. _#1870: https://github.com/robotframework/SeleniumLibrary/issues/1870 +.. _#1843: https://github.com/robotframework/SeleniumLibrary/issues/1843 +.. _#1821: https://github.com/robotframework/SeleniumLibrary/issues/1821 +.. _#1872: https://github.com/robotframework/SeleniumLibrary/issues/1872 diff --git a/docs/SeleniumLibrary-6.2.0rc1.html b/docs/SeleniumLibrary-6.2.0rc1.html new file mode 100644 index 000000000..6057aac57 --- /dev/null +++ b/docs/SeleniumLibrary-6.2.0rc1.html @@ -0,0 +1,1852 @@ + + + + + + + + + + + + + + + + + + + + + + + + + +
+

Opening library documentation failed

+
    +
  • Verify that you have JavaScript enabled in your browser.
  • +
  • Make sure you are using a modern enough browser. If using Internet Explorer, version 11 is required.
  • +
  • Check are there messages in your browser's JavaScript error log. Please report the problem if you suspect you have encountered a bug.
  • +
+
+ + + + + + + + + + + + + + + + diff --git a/docs/SeleniumLibrary-6.2.0rc1.rst b/docs/SeleniumLibrary-6.2.0rc1.rst new file mode 100644 index 000000000..2de9c477f --- /dev/null +++ b/docs/SeleniumLibrary-6.2.0rc1.rst @@ -0,0 +1,127 @@ +======================== +SeleniumLibrary 6.2.0rc1 +======================== + + +.. default-role:: code + + +SeleniumLibrary_ is a web testing library for `Robot Framework`_ that utilizes +the Selenium_ tool internally. SeleniumLibrary 6.2.0rc1 is a new release with +compatability fixes for recent selenium versions and some bug fixes. + +All issues targeted for SeleniumLibrary v6.2.0 can be found +from the `issue tracker`_. + +If you have pip_ installed, just run + +:: + + pip install --pre --upgrade robotframework-seleniumlibrary + +to install the latest available release or use + +:: + + pip install robotframework-seleniumlibrary==6.2.0rc1 + +to install exactly this version. Alternatively you can download the source +distribution from PyPI_ and install it manually. + +SeleniumLibrary 6.2.0rc1 was released on Saturday November 18, 2023. SeleniumLibrary supports +Python 3.8 through 3.11, Selenium 4.12.0 through 4.15.2 and +Robot Framework 5.0.1 and 6.1.1. + +.. _Robot Framework: http://robotframework.org +.. _SeleniumLibrary: https://github.com/robotframework/SeleniumLibrary +.. _Selenium: http://seleniumhq.org +.. _pip: http://pip-installer.org +.. _PyPI: https://pypi.python.org/pypi/robotframework-seleniumlibrary +.. _issue tracker: https://github.com/robotframework/SeleniumLibrary/issues?q=milestone%3Av6.2.0 + + +.. contents:: + :depth: 2 + :local: + +Most important enhancements +=========================== + +- Remove deprecated headless option for chrome and firefox. (`#1858`_, rc 1) + If one specified either `headlesschrome` or `headlessfirefox` as the browser within the + Open Browser keyword, then the library would handle setting this option with the underlying + Selenium driver. But the methods to do so were depracted and then removed in Selenium + v4.13.0. Thus one was not getting a headless browser in these instances. This resolves that + issue. + +- Resolve issue with service log_path now log_output. (`#1870`_, rc 1) + Selenium changed the arguments for the service log within v4.13.0. This change allows for a + seamless usage across versions before and after v4.13.0. + +- Execute JavaScript converts arguments to strings with robot==6.1 (`#1843`_, rc 1) + If any ARGUMENTS were passed into either the `Execute Javascript` or `Execute Async Javascript` + then they were converted to strings even if they were of some other type. This has been + corrected within this release. + +Acknowledgements +================ + +I want to thank the following for helping to get out this release, + +- `René Rohner `_ for pointing out that Create Webdriver had a + mutable default value (`#1817`_) +- `Kieran Trautwein `_ for resolving the issue with + deprecated headless option for chrome and firefox. (`#1858`_, rc 1) +- `Nicholas Bollweg `_ for assisting in resolving the issue + with service log_path now log_output. (`#1870`_, rc 1) +- `Igor Kozyrenko `_ for reporting the argument issue with Execute + JavaScript and `René Rohner `_for resolving it. (`#1843`_, rc 1) +- `Robin Matz `_ for improving the documentation on page load + timeout (`#1821`_, rc 1) + +and **Yuri Verweij, Lisa Crispin, and Tatu Aalto**. + +Full list of fixes and enhancements +=================================== + +.. list-table:: + :header-rows: 1 + + * - ID + - Type + - Priority + - Summary + - Added + * - `#1817`_ + - bug + - critical + - Create Webdriver has mutable default value + - rc�1 + * - `#1858`_ + - bug + - critical + - Remove deprecated headless option for chrome and firefox. + - rc�1 + * - `#1870`_ + - bug + - critical + - Resolve issue with service log_path now log_output. + - rc�1 + * - `#1843`_ + - bug + - high + - Execute JavaScript converts arguments to strings with robot==6.1 + - rc�1 + * - `#1821`_ + - enhancement + - medium + - Improve documentation on page load timeout + - rc�1 + +Altogether 5 issues. View on the `issue tracker `__. + +.. _#1817: https://github.com/robotframework/SeleniumLibrary/issues/1817 +.. _#1858: https://github.com/robotframework/SeleniumLibrary/issues/1858 +.. _#1870: https://github.com/robotframework/SeleniumLibrary/issues/1870 +.. _#1843: https://github.com/robotframework/SeleniumLibrary/issues/1843 +.. _#1821: https://github.com/robotframework/SeleniumLibrary/issues/1821 diff --git a/docs/SeleniumLibrary-6.3.0.rst b/docs/SeleniumLibrary-6.3.0.rst new file mode 100644 index 000000000..cfc2a5ae5 --- /dev/null +++ b/docs/SeleniumLibrary-6.3.0.rst @@ -0,0 +1,136 @@ +===================== +SeleniumLibrary 6.3.0 +===================== + + +.. default-role:: code + + +SeleniumLibrary_ is a web testing library for `Robot Framework`_ that utilizes +the Selenium_ tool internally. SeleniumLibrary 6.3.0 is a new release with +enhancements including minimizing browesr window, waiting on expected conditions, +getting element attribute or properties and bug fixes. + + +If you have pip_ installed, just run + +:: + + pip install --upgrade robotframework-seleniumlibrary + +to install the latest available release or use + +:: + + pip install robotframework-seleniumlibrary==6.3.0 + +to install exactly this version. Alternatively you can download the source +distribution from PyPI_ and install it manually. + +SeleniumLibrary 6.3.0 was released on Friday April 19, 2024. SeleniumLibrary supports +Python 3.8 through 3.11, Selenium 4.14.0 through 4.19.0 and +Robot Framework 5.0.1, 6.1.1 and 7.0. + +.. _Robot Framework: http://robotframework.org +.. _SeleniumLibrary: https://github.com/robotframework/SeleniumLibrary +.. _Selenium: http://seleniumhq.org +.. _pip: http://pip-installer.org +.. _PyPI: https://pypi.python.org/pypi/robotframework-seleniumlibrary +.. _issue tracker: https://github.com/robotframework/SeleniumLibrary/issues?q=milestone%3Av6.3.0 + + +.. contents:: + :depth: 2 + :local: + +Most important enhancements +=========================== + +- Added ``Minimize Browser Window`` keyword (`#1741`_) + New keyword which minimizes the current browser window. + +- Add keywords to fetch differentiated element Attribute or Property (`#1822`_) + The older ``Get Element Attribute`` keyword uses the Selenium getAttribute() method which, + as `this SauceLabs article `_ describes + "did not actually retrieve the Attribute value." Instead it "figured out what the user + was most likely interested in between the Attribute value and the Property values and + returned it." This would mean sometimes it might return an unexpected result. Selenium 4 + introduced newer methods which returns either the attribute or the property as specifically + asked for. + + It is recommend that one transition to these newer ``Get DOM Attribute`` and ``Get Property`` + keywords. + +- Incorporate the expected conditions of Selenium (`#1827`_) + A new keyword that allows for one to wait on an expected condition. + +- Remove deprecation of Press Key keyword (`#1892`_) + The Press Keys keyword was introduced to replace Press Key. Press Key in turn was deprecated + but I (Ed Manlove) failed to remove. Its been noted that both keywords use different underlying + methods for sending or pressing keys and either one will work in differing situations. So + instead of removing Press Key, it has been reinstated as a library keyword. + +Acknowledgements +================ + +- `Luciano Martorella `_ contributing the new + minimize keyword (`#1741`_) +- `Yuri Verweij `_ and `Lisa Crispin `_ + for reviewing changes and additions to Attribute or Property keywords (`#1822`_) +- `Noam Manos `_ for reporting the issues where + the Open Browser 'Options' object has no attribute '' (`#1877`_) +- Yuri for helping update the contribution guide (`#1881`_) +- All those who have commented on the deprecation of Press Key keyword (`#1892`_) +- Yuri and Lisa for assisting with the addition of Wait For Expected Condition keyword + and for the Robot Framework Foundation for the ecosystem support (`#1827`_) + +and **Yuri Verweij, Lisa Crispin, and Tatu Aalto** for their continued support of the library development. + +Full list of fixes and enhancements +=================================== + +.. list-table:: + :header-rows: 1 + + * - ID + - Type + - Priority + - Summary + * - `#1741`_ + - enhancement + - high + - Added minimize keyword + * - `#1822`_ + - enhancement + - high + - Add keywords to fetch differentiated element Attribute or Property + * - `#1827`_ + - enhancement + - high + - Incorporate the expected conditions of Selenium + * - `#1892`_ + - --- + - high + - Remove deprecation of Press Key keyword + * - `#1877`_ + - enhancement + - medium + - Open Browser 'Options' object has no attribute '' + * - `#1881`_ + - --- + - medium + - Update contribution guide + * - `#1841`_ + - --- + - --- + - Update maintainers and email within setup.py + +Altogether 7 issues. View on the `issue tracker `__. + +.. _#1741: https://github.com/robotframework/SeleniumLibrary/issues/1741 +.. _#1822: https://github.com/robotframework/SeleniumLibrary/issues/1822 +.. _#1827: https://github.com/robotframework/SeleniumLibrary/issues/1827 +.. _#1892: https://github.com/robotframework/SeleniumLibrary/issues/1892 +.. _#1877: https://github.com/robotframework/SeleniumLibrary/issues/1877 +.. _#1881: https://github.com/robotframework/SeleniumLibrary/issues/1881 +.. _#1841: https://github.com/robotframework/SeleniumLibrary/issues/1841 diff --git a/docs/SeleniumLibrary-6.3.0rc1.html b/docs/SeleniumLibrary-6.3.0rc1.html new file mode 100644 index 000000000..6cb9ea9ab --- /dev/null +++ b/docs/SeleniumLibrary-6.3.0rc1.html @@ -0,0 +1,1873 @@ + + + + + + + + + + + + + + + + + + + + + + + + + +
+

Opening library documentation failed

+
    +
  • Verify that you have JavaScript enabled in your browser.
  • +
  • Make sure you are using a modern enough browser. If using Internet Explorer, version 11 is required.
  • +
  • Check are there messages in your browser's JavaScript error log. Please report the problem if you suspect you have encountered a bug.
  • +
+
+ + + + + + + + + + + + + + + + diff --git a/docs/SeleniumLibrary-6.3.0rc1.rst b/docs/SeleniumLibrary-6.3.0rc1.rst new file mode 100644 index 000000000..b94e01b55 --- /dev/null +++ b/docs/SeleniumLibrary-6.3.0rc1.rst @@ -0,0 +1,115 @@ +======================== +SeleniumLibrary 6.3.0rc1 +======================== + + +.. default-role:: code + + +SeleniumLibrary_ is a web testing library for `Robot Framework`_ that utilizes +the Selenium_ tool internally. SeleniumLibrary 6.3.0rc1 is a new release with +**UPDATE** enhancements and bug fixes. **ADD more intro stuff...** + +All issues targeted for SeleniumLibrary v6.3.0 can be found +from the `issue tracker`_. + +If you have pip_ installed, just run + +:: + + pip install --pre --upgrade robotframework-seleniumlibrary + +to install the latest available release or use + +:: + + pip install robotframework-seleniumlibrary==6.3.0rc1 + +to install exactly this version. Alternatively you can download the source +distribution from PyPI_ and install it manually. + +SeleniumLibrary 6.3.0rc1 was released on Saturday March 30, 2024. SeleniumLibrary supports +Python 3.8 through 3.11, Selenium 4.14.0 through 4.19.0 and +Robot Framework 5.0.1, 6.1.1 and 7.0. + +.. _Robot Framework: http://robotframework.org +.. _SeleniumLibrary: https://github.com/robotframework/SeleniumLibrary +.. _Selenium: http://seleniumhq.org +.. _pip: http://pip-installer.org +.. _PyPI: https://pypi.python.org/pypi/robotframework-seleniumlibrary +.. _issue tracker: https://github.com/robotframework/SeleniumLibrary/issues?q=milestone%3Av6.3.0 + + +.. contents:: + :depth: 2 + :local: + +Most important enhancements +=========================== + +- Added ``Minimize Browser Window`` keyword (`#1741`_, rc 1) + New kyeword which minimizes the current browser window. + +- Add keywords to fetch differentiated element Attribute or Property (`#1822`_, rc 1) + The older ``Get Element Attribute`` keyword uses the Selenium getAttribute() method which, + as `this SauceLabs article `_ describes + "did not actually retrieve the Attribute value." Instead it "figured out what the user + was most likely interested in between the Attribute value and the Property values and + returned it." This would mean sometimes it might return an unexpected result. Selenium 4 + introduced newer methods which returns either the attribute or the property as specifically + asked for. + + It is recommend that one transition to these newer ``Get DOM Attribute`` and ``Get Property`` + keywords. + +Acknowledgements +================ + +- `Luciano Martorella `_ contributing the new + minimize keyword (`#1741`_, rc 1) +- `Yuri Verweij `_ and `Lisa Crispin `_ + for reviewing changes and addition to Attribute or Property keywords (`#1822`_, rc 1) +- `Noam Manos `_ for reporting the issues where + the Open Browser 'Options' object has no attribute '' (`#1877`_, rc 1) +- Yuri for helping update the contribution guide (`#1881`_, rc 1) + +and **Yuri Verweij, Lisa Crispin, and Tatu Aalto** for their continued support of the library development. + +Full list of fixes and enhancements +=================================== + +.. list-table:: + :header-rows: 1 + + * - ID + - Type + - Priority + - Summary + - Added + * - `#1741`_ + - enhancement + - high + - Added minimize keyword + - rc�1 + * - `#1822`_ + - enhancement + - high + - Add keywords to fetch differentiated element Attribute or Property + - rc�1 + * - `#1877`_ + - enhancement + - medium + - Open Browser 'Options' object has no attribute '' + - rc�1 + * - `#1881`_ + - --- + - medium + - Update contribution guide + - rc�1 + +Altogether 4 issues. View on the `issue tracker `__. + +.. _#1741: https://github.com/robotframework/SeleniumLibrary/issues/1741 +.. _#1822: https://github.com/robotframework/SeleniumLibrary/issues/1822 +.. _#1877: https://github.com/robotframework/SeleniumLibrary/issues/1877 +.. _#1881: https://github.com/robotframework/SeleniumLibrary/issues/1881 diff --git a/docs/SeleniumLibrary-6.3.0rc2.html b/docs/SeleniumLibrary-6.3.0rc2.html new file mode 100644 index 000000000..d59113795 --- /dev/null +++ b/docs/SeleniumLibrary-6.3.0rc2.html @@ -0,0 +1,1873 @@ + + + + + + + + + + + + + + + + + + + + + + + + + +
+

Opening library documentation failed

+
    +
  • Verify that you have JavaScript enabled in your browser.
  • +
  • Make sure you are using a modern enough browser. If using Internet Explorer, version 11 is required.
  • +
  • Check are there messages in your browser's JavaScript error log. Please report the problem if you suspect you have encountered a bug.
  • +
+
+ + + + + + + + + + + + + + + + diff --git a/docs/SeleniumLibrary-6.3.0rc2.rst b/docs/SeleniumLibrary-6.3.0rc2.rst new file mode 100644 index 000000000..19129c90a --- /dev/null +++ b/docs/SeleniumLibrary-6.3.0rc2.rst @@ -0,0 +1,140 @@ +======================== +SeleniumLibrary 6.3.0rc2 +======================== + + +.. default-role:: code + + +SeleniumLibrary_ is a web testing library for `Robot Framework`_ that utilizes +the Selenium_ tool internally. SeleniumLibrary 6.3.0rc2 is a new release with +enhancements including minimizing browesr window, waiting on expected conditions, +getting element attribute or properties and bug fixes. + +All issues targeted for SeleniumLibrary v6.3.0 can be found +from the `issue tracker`_. + +If you have pip_ installed, just run + +:: + + pip install --pre --upgrade robotframework-seleniumlibrary + +to install the latest available release or use + +:: + + pip install robotframework-seleniumlibrary==6.3.0rc2 + +to install exactly this version. Alternatively you can download the source +distribution from PyPI_ and install it manually. + +SeleniumLibrary 6.3.0rc2 was released on Tuesday April 16, 2024. SeleniumLibrary supports +Python 3.8 through 3.11, Selenium 4.14.0 through 4.19.0 and +Robot Framework 5.0.1, 6.1.1 and 7.0. + +.. _Robot Framework: http://robotframework.org +.. _SeleniumLibrary: https://github.com/robotframework/SeleniumLibrary +.. _Selenium: http://seleniumhq.org +.. _pip: http://pip-installer.org +.. _PyPI: https://pypi.python.org/pypi/robotframework-seleniumlibrary +.. _issue tracker: https://github.com/robotframework/SeleniumLibrary/issues?q=milestone%3Av6.3.0 + + +.. contents:: + :depth: 2 + :local: + +Most important enhancements +=========================== + +- Added ``Minimize Browser Window`` keyword (`#1741`_, rc 1) + New keyword which minimizes the current browser window. + +- Add keywords to fetch differentiated element Attribute or Property (`#1822`_, rc 1) + The older ``Get Element Attribute`` keyword uses the Selenium getAttribute() method which, + as `this SauceLabs article `_ describes + "did not actually retrieve the Attribute value." Instead it "figured out what the user + was most likely interested in between the Attribute value and the Property values and + returned it." This would mean sometimes it might return an unexpected result. Selenium 4 + introduced newer methods which returns either the attribute or the property as specifically + asked for. + + It is recommend that one transition to these newer ``Get DOM Attribute`` and ``Get Property`` + keywords. + +- Incorporate the expected conditions of Selenium (`#1827`_, rc 2) + A new keyword that allows for one to wait on an expected condition. + +- Remove deprecation of Press Key keyword (`#1892`_, rc 2) + The Press Keys keyword was introduced to replace Press Key. Press Key in turn was deprecated + but I (Ed Manlove failed to remove). Its been noted that both keywords use different underlying + methods for sending or pressing keys and either one will work in differing situations. So + instead of removing Press Key, it has been reinstated as a library keyword. + +Acknowledgements +================ + +- `Luciano Martorella `_ contributing the new + minimize keyword (`#1741`_, rc 1) +- `Yuri Verweij `_ and `Lisa Crispin `_ + for reviewing changes and addition to Attribute or Property keywords (`#1822`_, rc 1) +- `Noam Manos `_ for reporting the issues where + the Open Browser 'Options' object has no attribute '' (`#1877`_, rc 1) +- Yuri for helping update the contribution guide (`#1881`_, rc 1) +- All those who have commented on the deprecation of Press Key keyword (`#1892`_, rc 2) +- Yuri and Lisa for assisting with the addition of Wait For Expected Condition keyword + and for the Robot Framework Foundation for the ecosystem support (`#1827`_, rc 2) + +and **Yuri Verweij, Lisa Crispin, and Tatu Aalto** for their continued support of the library development. + +Full list of fixes and enhancements +=================================== + +.. list-table:: + :header-rows: 1 + + * - ID + - Type + - Priority + - Summary + - Added + * - `#1741`_ + - enhancement + - high + - Added minimize keyword + - rc�1 + * - `#1822`_ + - enhancement + - high + - Add keywords to fetch differentiated element Attribute or Property + - rc�1 + * - `#1827`_ + - enhancement + - high + - Incorporate the expected conditions of Selenium + - rc�2 + * - `#1892`_ + - --- + - high + - Remove deprecation of Press Key keyword + - rc�2 + * - `#1877`_ + - enhancement + - medium + - Open Browser 'Options' object has no attribute '' + - rc�1 + * - `#1881`_ + - --- + - medium + - Update contribution guide + - rc�1 + +Altogether 6 issues. View on the `issue tracker `__. + +.. _#1741: https://github.com/robotframework/SeleniumLibrary/issues/1741 +.. _#1822: https://github.com/robotframework/SeleniumLibrary/issues/1822 +.. _#1827: https://github.com/robotframework/SeleniumLibrary/issues/1827 +.. _#1892: https://github.com/robotframework/SeleniumLibrary/issues/1892 +.. _#1877: https://github.com/robotframework/SeleniumLibrary/issues/1877 +.. _#1881: https://github.com/robotframework/SeleniumLibrary/issues/1881 diff --git a/docs/SeleniumLibrary.html b/docs/SeleniumLibrary.html index 7bd3f1a9b..095f88efd 100644 --- a/docs/SeleniumLibrary.html +++ b/docs/SeleniumLibrary.html @@ -7,9 +7,9 @@ - + - - - - -