{"id":15018744,"url":"https://github.com/qentinelqi/qweb","last_synced_at":"2025-04-04T21:08:13.644Z","repository":{"id":37398074,"uuid":"346385640","full_name":"qentinelqi/qweb","owner":"qentinelqi","description":"Keyword driven automation for the web","archived":false,"fork":false,"pushed_at":"2024-11-27T09:13:02.000Z","size":106759,"stargazers_count":40,"open_issues_count":1,"forks_count":17,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-28T10:22:07.125Z","etag":null,"topics":["automation","python","robotframework","selenium","testing"],"latest_commit_sha":null,"homepage":"https://github.com/qentinelqi/qweb","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/qentinelqi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-03-10T14:36:50.000Z","updated_at":"2024-11-27T09:13:06.000Z","dependencies_parsed_at":"2024-01-25T10:56:21.209Z","dependency_job_id":"f9fff501-9a22-4115-8823-2fb983266769","html_url":"https://github.com/qentinelqi/qweb","commit_stats":{"total_commits":677,"total_committers":14,"mean_commits":"48.357142857142854","dds":0.621861152141802,"last_synced_commit":"bf8ef0d847061c0b084705487e81805e23631af2"},"previous_names":[],"tags_count":43,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qentinelqi%2Fqweb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qentinelqi%2Fqweb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qentinelqi%2Fqweb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qentinelqi%2Fqweb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qentinelqi","download_url":"https://codeload.github.com/qentinelqi/qweb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247249525,"owners_count":20908212,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","python","robotframework","selenium","testing"],"created_at":"2024-09-24T19:52:23.958Z","updated_at":"2025-04-04T21:08:13.621Z","avatar_url":"https://github.com/qentinelqi.png","language":"Python","funding_links":[],"categories":["Libraries"],"sub_categories":["Web Testing"],"readme":"\u003cimg id=\"qweb\" src=\"https://github.com/qentinelqi/qweb/raw/master/images/qweb.png\" alt=\"QWeb\"\u003e\r\n\r\n\u003e Keyword based test automation for the web.\r\n\r\n---\r\n![License][license-badge]\r\n![Python versions][python-versions-badge]\r\n![Release][pypi-badge]\r\n![Windows Acceptance][win_ci_badge]\r\n![Linux Acceptance][linux_ci_badge]\r\n![MacOS Acceptance][macos_ci_badge]\r\n[![Tested with][pace-badge]][pace-url]\r\n[![Slack][slack-badge]][slack-url]\r\n\r\n### Table of Contents\r\n\r\n- [Introduction](#introduction)\r\n- [Requirements](#requirements)\r\n- [Installation](#installation)\r\n  - [Windows](#windows)\r\n  - [Linux/Mac](#linuxmac)\r\n  - [Automatic browser \\\u0026 driver management](#automatic-browser--driver-management)\r\n  - [Manual driver management](#manual-driver-management)\r\n- [Usage](#usage)\r\n  - [Keyword documentation](#keyword-documentation)\r\n  - [Examples](#examples)\r\n    - [Basic usage](#basic-usage)\r\n    - [Shadow DOMs and visibility](#shadow-doms-and-visibility)\r\n    - [Timeouts and anchors](#timeouts-and-anchors)\r\n    - [Other locators](#other-locators)\r\n    - [Working with tables](#working-with-tables)\r\n    - [Changing configuration](#changing-configuration)\r\n    - [Running with Python](#running-with-python)\r\n- [Changelog](#changelog)\r\n- [Contribute](#contribute)\r\n- [Community](#community)\r\n- [License](#license)\r\n- [Resources](#resources)\r\n\r\n---\r\n\r\n## Introduction\r\n\r\nQWeb is a powerful and versatile [Robot Framework](https://robotframework.org/) library that enables efficient and reliable web testing and automation. One of the key strengths of QWeb is its intuitive and user-friendly syntax, which makes it easy to write and maintain complex test cases. \r\n\r\nQWeb aims to make web automation easy and maintainable by:\r\n* providing an intuitive and **user-friendly syntax for writing and maintaining** complex test cases.\r\n* providing **smart locators**: finding elements by text or by any attribute value with a simple syntax\r\n* automatically handling latencies etc. via **automatic wait times**\r\n* automatically handling **frames**\r\n* automatically handling unexpected **alerts**\r\n* providing support for finding **shadow dom** elements with an easy syntax\r\n* providing **in-built bitmap comparison** for special cases where element can't be identified by any other means\r\n* being **technology agnostic** and providing extensive support for various web technologies/frameworks \r\n\r\nSee [examples](#examples).\r\n\r\n[Back To The Top](#qweb)\r\n\r\n---\r\n## Requirements\r\nPython **3.9-3.12** and Robot Framework 5.0.1 or above.\r\n\r\n(Note that support on Macs with Apple based silicon (M1) requires MacOS version 12/Monterey or above or [custom installation](https://github.com/qentinelqi/qweb/blob/master/docs/qweb_mac_m1_installation.md).)\r\n\r\n## Installation\r\n\r\n### Windows\r\n```bash\r\n    pip install QWeb\r\n```\r\n\r\n### Linux/Mac\r\n\r\nSome Linux distributions (Ubuntu) use snap to install browsers, which brings it's own problems with non-default binary, \r\nuser data-dir and/or profile location. We suggest installing the browser via terminal, for example:\r\n\r\n```bash\r\n    wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb\r\n    apt-get install -y ./google-chrome-stable_current_amd64.deb\r\n```\r\n\r\nMake sure the following dependencies are installed:\r\n\r\n```bash\r\n    sudo apt-get install python3-tk python3-dev scrot\r\n    pip install python-xlib\r\n```\r\n\r\n```bash\r\n    python3 -m pip install -U pip\r\n    python3 -m pip install QWeb\r\n```\r\n\r\nRunning the above command installs also supported Selenium and Robot Framework versions + other dependencies.\r\n\r\n### Automatic browser \u0026 driver management\r\nSince Selenium 4.10.0 `browser drivers` can be automatically downloaded and installed using Selenium Manager, provided that driver is not found in PATH.\r\n\r\nFor Chrome `browser_version` can also be given; if your locally installed Chrome matches this version,\r\nit will be used. If not, a suitable version of `Chrome for Testing` will be automatically downloaded.\r\n\r\nExamples in [OpenBrowser keyword documentation](https://qentinelqi.github.io/qweb/QWeb.html#Open%20Browser)\r\n\r\n\r\n### Manual driver management\r\nFor manual installation of drivers, please refer to [Selenium documentation](https://www.selenium.dev/selenium/docs/api/py/index.html#drivers) for more information OR use 3rd party packages like [WebDriverManager](https://pypi.org/project/webdrivermanager/).\r\n\r\nNOTE: Manual driver management should only be used in exceptional cases. Letting Selenium Manager handle\r\ndrivers is the preferred, less error prone option.\r\n\r\n\r\n[Back To The Top](#qweb)\r\n\r\n---\r\n\r\n\r\n\r\n## Usage\r\n\r\n### Keyword documentation\r\nSee list of keywords and their usage on \r\n\r\n* [Keyword documentation](https://qentinelqi.github.io/qweb/QWeb.html)\r\n* [Copado Robotic Testing support pages](https://docs.copado.com/articles/#!copado-robotic-testing-publication/all-qwords) \r\n\r\n[Back To The Top](#qweb)\r\n\r\n### Examples\r\n\r\n#### Basic usage\r\n\r\nThe preferred way to interact with web elements is using their **text** property. Most elements like input fields and dropdowns can also be found by closest label (text).\r\n\r\n```RobotFramework\r\n*** Settings ***\r\nLibrary    QWeb     # Import library\r\n\r\n*** Test Cases ***\r\nBasic interaction\r\n    OpenBrowser         https://qentinelqi.github.io/shop      chrome   # Open chrome and goto given url\r\n    VerifyText          The animal friendly clothing company            # Assert heading text\r\n    ClickText           Scar the Lion                                   # Click link text\r\n    ClickText           Add to cart                                     # Click *button* with specific text\r\n    DropDown            Size            Large                           # Select value (Large) from dropdown (Size)\r\n\r\n```\r\n#### Shadow DOMs and visibility\r\nMost common cases when text or element is not found are:\r\n- Element has (incorrectly?) some attribute set so, that it's considered invisible.\r\n- Element is under shadow dom (i.e. has #shadow-root parent element)\r\n\r\nQWeb searches for visible elements by default, but can be instructed to work with invisible elements as well. See keyword documentation of **SetConfig** and the following parameters:\r\n- Visibility\r\n- Offsetcheck\r\n- InViewport\r\n\r\nElements under shadow DOM can not be found using xpaths. However, all *Text, *Item and *Input keywords do support extending the search to Shadow DOM elements. We intentionally keep this under separate setting for ensuring compatibility with older test cases. \r\n\r\nExample:\r\n```RobotFramework\r\n*** Settings ***\r\nLibrary    QWeb     # Import library\r\n\r\n*** Test Cases ***\r\nClick shadow dom element\r\n  SetConfig            ShadowDOM            True  # extends search to shadow dom elements\r\n  OpenBrowser          chrome://settings/content/popups   chrome\r\n  ClickText            Sites can send pop-ups \r\n```\r\n\r\n#### Timeouts and anchors\r\n\r\nBy default QWeb tries to locate the element 10 seconds (default time can be configured). Timeout can also be individually given for each keyword as an argument.\r\n\r\nWhen text to be found is not unique, an 'anchor' argument can be given to pinpoint which instance of text we want to interact with. Anchor can be either another text nearby or index.\r\n\r\n```RobotFramework\r\nClickText   Sign-in\r\nClickText   Sign-in     timeout=30\r\n\r\nClickText   Sign-in     anchor=Email\r\nClickText   Sign-in     index=3\r\n```\r\n\r\n#### Other locators\r\n\r\nNon-textual locators can be used with `ClickElement`and `ClickItem`keywords.\r\n\r\n```RobotFramework\r\nClickElement    xpath\\=//button[@class=\"my_class\"]   # xpath\r\nClickItem       Increment quantity                   # alt text\r\n\r\n```\r\n\r\n#### Working with tables\r\n\r\nQWeb includes keywords to interact with table data easily.\r\n\r\nConsider the following table as an example:\r\n\u003cimg src=\"https://github.com/qentinelqi/qweb/raw/master/images/example_table.png\" alt=\"Example table\"\u003e\r\n\r\n```RobotFramework\r\nUseTable    Firstname\r\n\r\n${row}=     GetTableRow     //last                        # returns 5\r\n${row}=     GetTableRow     //last    skip_header=True    # returns 4\r\n...\r\n${row}=     GetTableRow     Jim                           # returns 4\r\n${row}=     GetTableRow     Jim    skip_header=True       # returns 3\r\n\r\n${cell_value}=     GetCellText     r1c2                   # Returns \"John\", first name is column 2.\r\n\r\n${cell_value}=     GetCellText     r-1/c2                 # Returns \"Tina\", -1 points to last row\r\n${cell_value}=     GetCellText     r-2/c2                 # Returns \"Jim\", -2 points to second last row\r\n```\r\n\r\n#### Changing configuration\r\nQWeb's behavior can be changed with SetConfig keyword.\r\n\r\n```RobotFramework\r\n\r\nSetConfig     SearchMode     Draw       # Highlight all found elements with blue rectangle\r\n\r\nSetConfig     DefaultTimeout    60s     # change default/automatic timeout for all keywords\r\nVerifyText    User account created      # Re-tries to find text \"User account created\" 60 seconds and then fails, if text is not visible\r\n```\r\n\r\n#### Running with Python\r\nQWeb can be used directly with Python as well.\r\n\r\n```Python\r\n\r\nfrom QWeb import QWeb\r\n\r\nqweb = QWeb()\r\n\r\nqweb.open_browser(\"about:blank\", \"chrome\")\r\nqweb.go_to(\"https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_select\")\r\ntitle = qweb.get_title()\r\n# returns 'W3Schools Tryit Editor'\r\nqweb.verify_text(\"The select element\")\r\nqweb.drop_down(\"Choose a car\", \"Saab\")\r\nqweb.click_text(\"Submit\")\r\nqweb.verify_text(\"Your input was received as:\")\r\nqweb.verify_text(\"cars=saab\")\r\n\r\n```\r\n\r\nMore examples on [QWeb tutorial](https://github.com/qentinelqi/qweb_workshop).\r\n\r\n[Back To The Top](#qweb)\r\n\r\n---\r\n\r\n## Changelog\r\n\r\nSee [RELEASE.md](https://github.com/qentinelqi/qweb/blob/master/RELEASE.md)\r\n\r\n[Back To The Top](#qweb)\r\n\r\n## Contribute\r\n\r\nFound an bug? Want to propose a new feature or improve documentation? Please start by checking our [contribution guide](https://github.com/qentinelqi/qweb/blob/master/CONTRIBUTING.md)\r\n\r\n[Back To The Top](#qweb)\r\n\r\n## Community\r\n\r\nWant to join the community at Slack? On the official Robot Framework workspace, there is a QWeb channel where you can discuss with others about keywords, issues and improvements. [Join Now](https://robotframework.slack.com/archives/C029L0N3N81)\r\n\r\n[Back To The Top](#qweb)\r\n\r\n## License\r\n\r\nApache 2.0 License. See [LICENSE](https://github.com/qentinelqi/qweb/blob/master/LICENSE).\r\n\r\n\r\n[Back To The Top](#qweb)\r\n\r\n## Resources\r\n* [QWeb home page](https://qentinel.com/qweb-open-source/)\r\n* [QWeb tutorial](https://github.com/qentinelqi/qweb_workshop)\r\n\r\n\r\n\r\n---\r\n[license-badge]: https://img.shields.io/github/license/qentinelqi/qweb\r\n[linux_ci_badge]: https://github.com/qentinelqi/qweb/actions/workflows/linux_acceptance.yml/badge.svg\r\n[win_ci_badge]: https://github.com/qentinelqi/qweb/actions/workflows/win_acceptance.yml/badge.svg\r\n[macos_ci_badge]: https://github.com/qentinelqi/qweb/actions/workflows/mac_acceptance.yml/badge.svg\r\n[pace-url]: https://robotic.copado.com\r\n[pace-badge]: https://img.shields.io/badge/Tested%20with-Copado%20Robotic%20Testing-blue\r\n[python-versions-badge]: https://img.shields.io/pypi/pyversions/QWeb\r\n[pypi-badge]: https://img.shields.io/pypi/v/QWeb?color=green\r\n[slack-badge]: https://img.shields.io/badge/Slack-QWeb-blue?style=flat-square\u0026logo=Slack\r\n[slack-url]: https://robotframework.slack.com/archives/C029L0N3N81\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqentinelqi%2Fqweb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqentinelqi%2Fqweb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqentinelqi%2Fqweb/lists"}