{"id":51528770,"url":"https://github.com/browserstack/ai-authoring-automate-demo-browserstack","last_synced_at":"2026-07-09T00:31:50.571Z","repository":{"id":318837158,"uuid":"1072945861","full_name":"browserstack/ai-authoring-automate-demo-browserstack","owner":"browserstack","description":"AI Authoring Automate Demo Repository for Browserstack","archived":false,"fork":false,"pushed_at":"2026-06-19T13:11:04.000Z","size":9287,"stargazers_count":1,"open_issues_count":1,"forks_count":5,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-06-28T23:02:22.397Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/browserstack.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":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-09T12:29:36.000Z","updated_at":"2026-06-19T13:11:30.000Z","dependencies_parsed_at":"2025-10-16T16:06:43.384Z","dependency_job_id":"fd1f1894-d6cd-416f-8d6e-469ee553eb27","html_url":"https://github.com/browserstack/ai-authoring-automate-demo-browserstack","commit_stats":null,"previous_names":["browserstack/ai-authoring-automate-demo-browserstack"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/browserstack/ai-authoring-automate-demo-browserstack","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browserstack%2Fai-authoring-automate-demo-browserstack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browserstack%2Fai-authoring-automate-demo-browserstack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browserstack%2Fai-authoring-automate-demo-browserstack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browserstack%2Fai-authoring-automate-demo-browserstack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/browserstack","download_url":"https://codeload.github.com/browserstack/ai-authoring-automate-demo-browserstack/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browserstack%2Fai-authoring-automate-demo-browserstack/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35282897,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-08T02:00:06.796Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2026-07-09T00:31:49.958Z","updated_at":"2026-07-09T00:31:50.527Z","avatar_url":"https://github.com/browserstack.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cross-Device Automation Agent Demo (BrowserStack Automate)\n\n[TestNG](http://testng.org) Integration with BrowserStack.\n\n![BrowserStack Logo](https://d98b8t1nnulk5.cloudfront.net/production/images/layout/logo-header.png?1469004780)\n\n## What Does This Repo Do?\n\nThis repository showcases the use of **BrowserStack's Cross-Device Automation Agent** for web automation using TestNG and Selenium. The key feature is the ability to write test steps in **Natural Language (Plain English)**, moving away from explicit Selenium locators and actions.\n\nIt contains a demo script:\n* **`BstackAIAuthoring.java`**: Runs complex test objectives (like selecting a product in a specific price range or navigating to a quote page) using simple English commands.\n\n---\n\n## How It Works\n\n1.  **Enablement:** The feature is enabled by declaring the capability `aiAuthoring: true` in your `browserstack.yml` configuration file.\n2.  **The Command:** Inside the test script (`BstackAIAuthoring.java`), the test uses a standard Selenium `JavascriptExecutor` to pass the Natural Language instruction to the BrowserStack environment:\n    ```java\n    // Example Objective: Find Google Pixel 3 phone on the website and add 5 of them to the cart\n    jse.executeScript(\"browserstack_executor: {\\\"action\\\": \\\"ai\\\", \\\"arguments\\\": [\\\" Click on the Google button and Add 5 Pixel 3 phones to cart\\\"]}\");\n    ```\n3.  **Execution:** The BrowserStack Cross-Device Automation Agent intercepts this command, interprets the natural language, and executes the equivalent low-level Selenium actions on the target web page.\n\n---\n\n## Running the Tests\n\n### Using Maven\n\n#### Run sample build\n\n-   Clone the repository\n-   Replace `YOUR_USERNAME` and `YOUR_ACCESS_KEY` with your BrowserStack access credentials in `browserstack.yml`.\n-   Declare capability **`aiAuthoring: true`** in `browserstack.yml` file (if not already present).\n-   Install dependencies `mvn compile`\n-   To run the test suite having cross-platform with parallelization, run **`mvn test -P sample-test`**.\n-   To run local tests, run **`mvn test -P sample-local-test`**.\n\nUnderstand how many parallel sessions you need by using our [Parallel Test Calculator](https://www.browserstack.com/automate/parallel-calculator?ref=github).\n\n#### Integrate your test suite\n\n* Add maven dependency of `browserstack-java-sdk` in your `pom.xml` file:\n    ```xml\n    \u003cdependency\u003e\n        \u003cgroupId\u003ecom.browserstack\u003c/groupId\u003e\n        \u003cartifactId\u003ebrowserstack-java-sdk\u003c/artifactId\u003e\n        \u003cversion\u003eLATEST\u003c/version\u003e\n        \u003cscope\u003ecompile\u003c/scope\u003e\n    \u003c/dependency\u003e\n    ```\n* Modify your build plugin to run tests by adding `argLine -javaagent:${com.browserstack:browserstack-java-sdk:jar}` in the Surefire plugin configuration.\n* Install dependencies `mvn compile`.\n\n### Using Gradle\n\n#### Prerequisites\n\n-   If using Gradle, Java v9+ is required.\n\n#### Run sample build\n\n-   Clone the repository\n-   Install dependencies `gradle build`\n-   To run the test suite having cross-platform with parallelization, run **`gradle sampleTest`**.\n-   To run local tests, run **`gradle sampleLocalTest`**.\n\n#### Integrate your test suite\n\n* Add `compileOnly 'com.browserstack:browserstack-java-sdk:latest.release'` in dependencies in your `gradle.build`.\n* Fetch Artifact Information and add `jvmArgs` property in tasks *SampleTest* and *SampleLocalTest*.\n* Install dependencies `gradle build`.\n\n---\n\n## Notes\n\n* You can view your test results on the [BrowserStack Automate dashboard](https://www.browserstack.com/automate).\n* For detailed documentation on general Selenium and Java setup with BrowserStack Automate, please refer to the [official documentation](https://www.browserstack.com/docs/automate/selenium?fw-lang=java).\n\n## Getting Help\n\nIf you are running into any issues or have any queries, please check [Browserstack Support page](https://www.browserstack.com/support/automate) or [get in touch with us](https://www.browserstack.com/contact?ref=help).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrowserstack%2Fai-authoring-automate-demo-browserstack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrowserstack%2Fai-authoring-automate-demo-browserstack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrowserstack%2Fai-authoring-automate-demo-browserstack/lists"}