{"id":14978800,"url":"https://github.com/yandex-qatools/htmlelements","last_synced_at":"2025-04-12T19:45:20.714Z","repository":{"id":4810282,"uuid":"5963893","full_name":"yandex-qatools/htmlelements","owner":"yandex-qatools","description":"Html Elements is a Java framework providing easy-to-use way of interaction with web-page elements in web-page tests.","archived":false,"fork":false,"pushed_at":"2024-01-15T10:58:18.000Z","size":840,"stargazers_count":271,"open_issues_count":29,"forks_count":117,"subscribers_count":56,"default_branch":"master","last_synced_at":"2025-04-03T22:09:34.688Z","etag":null,"topics":["framework","htmlelements","java","selenium","selenium-webdriver","webdriver"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"jshttp/basic-auth","license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yandex-qatools.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2012-09-26T09:56:23.000Z","updated_at":"2025-02-07T15:10:53.000Z","dependencies_parsed_at":"2024-06-21T17:53:46.264Z","dependency_job_id":"c04636a9-64af-4872-a252-6bf7ace67754","html_url":"https://github.com/yandex-qatools/htmlelements","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yandex-qatools%2Fhtmlelements","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yandex-qatools%2Fhtmlelements/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yandex-qatools%2Fhtmlelements/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yandex-qatools%2Fhtmlelements/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yandex-qatools","download_url":"https://codeload.github.com/yandex-qatools/htmlelements/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248625491,"owners_count":21135513,"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":["framework","htmlelements","java","selenium","selenium-webdriver","webdriver"],"created_at":"2024-09-24T13:58:25.708Z","updated_at":"2025-04-12T19:45:20.683Z","avatar_url":"https://github.com/yandex-qatools.png","language":"Java","funding_links":[],"categories":["测试"],"sub_categories":[],"readme":"Html Elements framework\n=======================\n[![release](http://github-release-version.herokuapp.com/github/yandex-qatools/htmlelements/release.svg?style=flat)](https://github.com/yandex-qatools/htmlelements/releases/latest) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/ru.yandex.qatools.htmlelements/htmlelements-java/badge.svg?style=flat)](https://maven-badges.herokuapp.com/maven-central/ru.yandex.qatools.htmlelements/htmlelements-java)\n\n\nThis framework is designed to provide an easy-to-use way of interacting with web-page elements in your tests.\nIt can be considered to be an extension of WebDriver Page Object.\n\nWith the help of the Html Elements framework you can group web-page elements into blocks, encapsulate logic of interaction within them \nand then easily use created blocks in page objects. It also provides a set of helpful matchers to use with web-page elements \nand blocks. See [JavaDocs](https://oss.sonatype.org/service/local/repositories/releases/archive/ru/yandex/qatools/htmlelements/htmlelements-java/1.16/htmlelements-java-1.16-javadoc.jar/!/index.html) \nand [Samples](https://github.com/yandex-qatools/htmlelements-examples) for more details.\n\nYou can ask your questions on StackOverflow with the [![htmlelements](https://img.shields.io/badge/stackoverflow-htmlelements-orange.svg?style=flat)](http://stackoverflow.com/questions/tagged/htmlelements) tag.\n\nOther Languages\n-------------\nIn case you are not a Java guy/gal, don't panic, there are still few options:\n\n* [Html Elements .NET implementation](https://github.com/yandex-qatools/htmlelements-dotnet) - .NET port made by [Vadzim Hushchanskou](https://github.com/HardNorth)\n* [Html Elements PHP implementation](https://github.com/qa-tools/qa-tools) - PHP port made by [Alexander Obuhovich](https://github.com/aik099)\n* [bumblebee framework (C#)](https://github.com/patrickherrmann/Bumblebee) - same idea, nice implementation\n\nRelease Notes\n-------------\n* [Version 1.20 Release Notes](https://github.com/yandex-qatools/htmlelements/releases/tag/htmlelements-1.20.0)\n* [Version 1.19 Release Notes](https://github.com/yandex-qatools/htmlelements/releases/tag/htmlelements-1.19)\n* [Version 1.18 Release Notes](https://github.com/yandex-qatools/htmlelements/releases/tag/htmlelements-1.18)\n* [Version 1.17 Release Notes](https://github.com/yandex-qatools/htmlelements/releases/tag/htmlelements-1.17)\n* [Version 1.16 Release Notes](https://github.com/yandex-qatools/htmlelements/releases/tag/htmlelements-1.16)\n* [Version 1.15 Release Notes](https://github.com/yandex-qatools/htmlelements/releases/tag/htmlelements-1.15)\n* [Version 1.14 Release Notes](https://github.com/yandex-qatools/htmlelements/releases/tag/htmlelements-1.14)\n* [Version 1.13 Release Notes](https://github.com/yandex-qatools/htmlelements/releases/tag/htmlelements-1.13)\n* [Version 1.12 Release Notes](https://github.com/yandex-qatools/htmlelements/releases/tag/htmlelements-1.12)\n* [Version 1.11 Release Notes](https://github.com/yandex-qatools/htmlelements/blob/master/releasenotes/1.11-releasenotes.ru.md)\n* [Version 1.10 Release Notes](https://github.com/yandex-qatools/htmlelements/blob/master/releasenotes/1.10-releasenotes.ru.md)\n* [Version 1.9 Release Notes](https://github.com/yandex-qatools/htmlelements/blob/master/releasenotes/1.9-releasenotes.ru.md)\n\nInclude Html Elements in your project\n-------------------------------------\nMaven dependencies for Html Elements core:\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eru.yandex.qatools.htmlelements\u003c/groupId\u003e\n    \u003cartifactId\u003ehtmlelements-java\u003c/artifactId\u003e\n    \u003cversion\u003e1.21.0\u003c/version\u003e \u003c!-- 1.21+ is SELENIUM 4.1.0 compatible --\u003e\n\u003c/dependency\u003e\n```\n\nAnd for Thucydides integration:\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eru.yandex.qatools.htmlelements\u003c/groupId\u003e\n    \u003cartifactId\u003ehtmlelements-thucydides\u003c/artifactId\u003e\n    \u003cversion\u003e1.21.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nOr you can include all modules at once if needed:\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eru.yandex.qatools.htmlelements\u003c/groupId\u003e\n    \u003cartifactId\u003ehtmlelements-all\u003c/artifactId\u003e\n    \u003cversion\u003e1.21.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nSince 1.15 Java 8 is required. Please use 1.14 for Java 7 support.\n\nCreate blocks of elements\n-------------------------\nFor example, let's create a block for the search form on the page http://www.yandex.com:\n\n```java\n@Name(\"Search form\")\n@FindBy(xpath = \"//form\")\npublic class SearchArrow extends HtmlElement {\n\n    @Name(\"Search request input\")\n    @FindBy(id = \"searchInput\")\n    private TextInput requestInput;\n\n    @Name(\"Search button\")\n    @FindBy(className = \"b-form-button__input\")\n    private Button searchButton;\n\n    public void search(String request) {\n        requestInput.sendKeys(request);\n        searchButton.click();\n    }\n}\n```\n\nConstruct page object using created blocks\n------------------------------------------\nYou can easily use created blocks in page objects:\n\n```java\npublic class SearchPage {\n\n    private SearchArrow searchArrow;\n    // Other blocks and elements here ...\n\n    public SearchPage(WebDriver driver) {\n        PageFactory.initElements(new HtmlElementDecorator(new HtmlElementLocatorFactory(driver)), this);\n    }\n\n    public void search(String request) {\n        searchArrow.search(request);\n    }\n\n    // Other methods here ...\n}\n```\n\nUse page objects in your tests\n------------------------------\nCreated page objects can be used in your tests. This makes tests more concise, easier to maintain, and easy to write.\n\n```java\npublic class SampleTest {\n\n    private WebDriver driver = new FirefoxDriver();\n    private SearchPage searchPage = new SearchPage(driver);\n\n    @Before\n    public void loadPage() {\n        driver.get(\"http://www.yandex.com\");\n    }\n\n    @Test\n    public void sampleTest() {\n        searchPage.search(\"yandex\");\n        // Some assertion here\n    }\n\n    @After\n    public void closeDriver() {\n        driver.quit();\n    }\n}\n```\n\nQuestions?\n----------\nIn case you can't find an answer in documentation and examples provided above, you can ask it on StackOverflow with the \n[![htmlelements](https://img.shields.io/badge/stackoverflow-htmlelements-orange.svg?style=flat)](http://stackoverflow.com/questions/tagged/htmlelements) tag.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyandex-qatools%2Fhtmlelements","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyandex-qatools%2Fhtmlelements","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyandex-qatools%2Fhtmlelements/lists"}