{"id":36425983,"url":"https://github.com/chavaillaz/automated-browser","last_synced_at":"2026-01-11T18:00:36.078Z","repository":{"id":65507528,"uuid":"535139647","full_name":"Chavaillaz/automated-browser","owner":"Chavaillaz","description":"Library to quickly implement an automated application controlling a browser for multiple purposes.","archived":false,"fork":false,"pushed_at":"2024-11-02T14:28:43.000Z","size":56,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-10T22:50:09.681Z","etag":null,"topics":["automation","browser","java","selenium"],"latest_commit_sha":null,"homepage":null,"language":"Java","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/Chavaillaz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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":"2022-09-10T23:04:42.000Z","updated_at":"2024-11-02T14:28:47.000Z","dependencies_parsed_at":"2024-11-02T15:33:43.527Z","dependency_job_id":null,"html_url":"https://github.com/Chavaillaz/automated-browser","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/Chavaillaz/automated-browser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chavaillaz%2Fautomated-browser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chavaillaz%2Fautomated-browser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chavaillaz%2Fautomated-browser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chavaillaz%2Fautomated-browser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Chavaillaz","download_url":"https://codeload.github.com/Chavaillaz/automated-browser/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chavaillaz%2Fautomated-browser/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28316906,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-11T14:58:17.114Z","status":"ssl_error","status_checked_at":"2026-01-11T14:55:53.580Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","browser","java","selenium"],"created_at":"2026-01-11T18:00:19.663Z","updated_at":"2026-01-11T18:00:36.042Z","avatar_url":"https://github.com/Chavaillaz.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Automated Browser\n\n![Quality Gate](https://github.com/chavaillaz/automated-browser/actions/workflows/sonarcloud.yml/badge.svg)\n![Dependency Check](https://github.com/chavaillaz/automated-browser/actions/workflows/snyk.yml/badge.svg)\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.chavaillaz/automated-browser/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.chavaillaz/automated-browser)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\nThis library allows to quickly do an automated application controlling a browser for multiple purposes. An example of\nusage is to automate the generation of reports for external parties by accessing internal services, highlighting\nelements, taking screenshots and creating documents with them.\n\n## Installation\n\nThe dependency is available in maven central (see badge for version):\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.chavaillaz\u003c/groupId\u003e\n    \u003cartifactId\u003eautomated-browser\u003c/artifactId\u003e\n\u003c/dependency\u003e\n```\n\n## Usage\n\nAn example of usage is available in the ```MavenCentralTest``` class. Its goal is to search the last version of a Maven \nartifact and take a screenshot of the code snippet to use.\n\n### Implementing your requirements\n\n#### Stateful\n\nIn order to benefit from this library, create new classes extending `AutomatedBrowser` and use the methods available in \nit to simplify the implementation of your requirements.\n\nAn example of extension available in the tests of the project is the `MavenCentral` class. It can be used with:\n\n```java\ntry (MavenCentral browser = new MavenCentral(driver)) {\n    browser.searchArtifact(\"org.slf4j:slf4j-api\");\n}\n```\n\n#### Stateful - Flow\n\nThere is also a possibility to have a flow with multiple steps defining your requirements, using the classes extending \n`AutomatedBrowser` you created:\n\n```java\ntry (MavenCentral browser = new MavenCentral(driver)) {\n    browser.setData(new MavenCentralData(\"org.slf4j:slf4j-api\"));\n    new AutomatedBrowserFlow\u003c\u003e(browser)\n        .withStep(MavenCentral::stepSearchArtifact)\n        .withStep(MavenCentral::stepLogLastVersion)\n        .withStep(MavenCentral::stepHighlightSnippet);\n}\n```\n\nNote that you can also give a default exception handler for all step or a specific one overriding it for some steps.\n\n#### Stateless - Flow\n\nAlso with the same flow system, you can have stateless calls to static methods. Those methods can have:\n- No parameter\n- One parameter: the class extending `AutomatedBrowser` you gave in the constructor (defaulting to `AutomatedBrowser`)\n- Two parameters: first same as above and second the context data instance you can set with `withContext` method\n\n```java\ntry (MavenCentral browser = new MavenCentral(driver)) {\n    new AutomatedBrowserFlow\u003cMavenCentral, MavenCentralData\u003e(browser)\n        .withContext(new MavenCentralData(\"org.slf4j:slf4j-api\"))\n        .withStep(MavenCentralStep::stepSearchArtifact)\n        .withStep(MavenCentralStep::stepLogLastVersion)\n        .withStep(MavenCentralStep::stepHighlightSnippet);\n}\n```\n\n### Running your application\n\n#### As a standalone application\n\nCreates your preferred the driver using the methods in `BrowserUtils`:\n\n- Chrome (`getChromeDriver`)\n- Firefox (`getFirefoxDriver`)\n- Edge (`getEdgeDriver`)\n\nThen pass it to the classes you created (see chapter above) and start using them directly. Note that this will use the\nbrowsers available on your computer, meaning when you choose a browser driver in the code, you need that browser\ninstalled on your computer to make it working.\n\n#### As a docker container\n\nThanks to test containers, you can also directly run it in a docker container containing the browser you want to use.\nFor that, include the following dependencies in your project:\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eorg.testcontainers\u003c/groupId\u003e\n    \u003cartifactId\u003eselenium\u003c/artifactId\u003e\n    \u003cversion\u003e${test-containers.version}\u003c/version\u003e\n\u003c/dependency\u003e\n\n\u003cdependency\u003e\n    \u003cgroupId\u003eorg.testcontainers\u003c/groupId\u003e\n    \u003cartifactId\u003ejunit-jupiter\u003c/artifactId\u003e\n    \u003cversion\u003e${test-containers.version}\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nWhen it's done, add the `@Testcontainers` annotation on your test classes and the following attribute for the\ncontainer (in this example Google Chrome):\n\n```java\n@Container\npublic BrowserWebDriverContainer\u003c?\u003e chrome = new BrowserWebDriverContainer\u003c\u003e()\n        .withCapabilities(getChromeOptions())\n        .withRecordingMode(SKIP, null);\n```\n\nYou can then access the driver with `chrome.getWebDriver()` and pass it when instantiating your classes.\n\n## Contributing\n\nIf you have a feature request or found a bug, you can:\n\n- Write an issue\n- Create a pull request\n\nIf you want to contribute then\n\n- Please write tests covering all your changes\n- Ensure you didn't break the build by running `mvn test`\n- Fork the repo and create a pull request\n\n## License\n\nThis project is under Apache 2.0 License.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchavaillaz%2Fautomated-browser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchavaillaz%2Fautomated-browser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchavaillaz%2Fautomated-browser/lists"}