{"id":13806943,"url":"https://github.com/sukgu/shadow-automation-selenium","last_synced_at":"2025-10-25T14:14:13.036Z","repository":{"id":36923744,"uuid":"173431787","full_name":"sukgu/shadow-automation-selenium","owner":"sukgu","description":"This project focuses on automation of multi-level shadow root dom using java selenium. You can embed this plugin in your java selenium project.","archived":false,"fork":false,"pushed_at":"2025-05-15T18:12:39.000Z","size":88,"stargazers_count":113,"open_issues_count":5,"forks_count":34,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-07-17T14:09:35.938Z","etag":null,"topics":["automation","custom-elements","custom-tag","polymer","selenium","selenium-java","selenium-webdriver","shadow-dom","testing-tools"],"latest_commit_sha":null,"homepage":"https://search.maven.org/artifact/io.github.sukgu/automation","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/sukgu.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":"2019-03-02T10:02:22.000Z","updated_at":"2025-03-31T10:10:17.000Z","dependencies_parsed_at":"2024-05-03T11:14:26.961Z","dependency_job_id":"fb172713-bd5e-4c6e-9ce1-df93768a40a1","html_url":"https://github.com/sukgu/shadow-automation-selenium","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/sukgu/shadow-automation-selenium","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sukgu%2Fshadow-automation-selenium","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sukgu%2Fshadow-automation-selenium/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sukgu%2Fshadow-automation-selenium/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sukgu%2Fshadow-automation-selenium/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sukgu","download_url":"https://codeload.github.com/sukgu/shadow-automation-selenium/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sukgu%2Fshadow-automation-selenium/sbom","scorecard":{"id":857940,"data":{"date":"2025-08-11","repo":{"name":"github.com/sukgu/shadow-automation-selenium","commit":"3376e822173d3d62f8d3c4ce4513d785f5cbb659"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 1/19 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v0.1.5 not signed: https://api.github.com/repos/sukgu/shadow-automation-selenium/releases/135179252","Warn: release artifact v0.1.4 not signed: https://api.github.com/repos/sukgu/shadow-automation-selenium/releases/58812768","Warn: release artifact v0.1.3 not signed: https://api.github.com/repos/sukgu/shadow-automation-selenium/releases/45694280","Warn: release artifact v0.1.2 not signed: https://api.github.com/repos/sukgu/shadow-automation-selenium/releases/44152537","Warn: release artifact v0.1.1 not signed: https://api.github.com/repos/sukgu/shadow-automation-selenium/releases/40604161","Warn: release artifact v0.1.5 does not have provenance: https://api.github.com/repos/sukgu/shadow-automation-selenium/releases/135179252","Warn: release artifact v0.1.4 does not have provenance: https://api.github.com/repos/sukgu/shadow-automation-selenium/releases/58812768","Warn: release artifact v0.1.3 does not have provenance: https://api.github.com/repos/sukgu/shadow-automation-selenium/releases/45694280","Warn: release artifact v0.1.2 does not have provenance: https://api.github.com/repos/sukgu/shadow-automation-selenium/releases/44152537","Warn: release artifact v0.1.1 does not have provenance: https://api.github.com/repos/sukgu/shadow-automation-selenium/releases/40604161"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 18 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"18 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-h46c-h94j-95f3","Warn: Project is vulnerable to: GHSA-wf8f-6423-gfxg","Warn: Project is vulnerable to: GHSA-288c-cq4h-88gq","Warn: Project is vulnerable to: GHSA-3x8x-79m2-3w2w","Warn: Project is vulnerable to: GHSA-57j2-w4cx-62h2","Warn: Project is vulnerable to: GHSA-jjjh-jjxp-wpff","Warn: Project is vulnerable to: GHSA-rgv9-q543-rqg4","Warn: Project is vulnerable to: GHSA-78wr-2p64-hpwj","Warn: Project is vulnerable to: GHSA-pwm3-776c-8q7q","Warn: Project is vulnerable to: GHSA-4265-ccf5-phj5","Warn: Project is vulnerable to: GHSA-4g9r-vxhx-9pgx","Warn: Project is vulnerable to: GHSA-j288-q9x7-2f5v","Warn: Project is vulnerable to: GHSA-4cx2-fc23-5wg6","Warn: Project is vulnerable to: GHSA-4h8f-2wvx-gg5w","Warn: Project is vulnerable to: GHSA-67mf-3cr5-8w23","Warn: Project is vulnerable to: GHSA-8xfc-gm6g-vgpv","Warn: Project is vulnerable to: GHSA-m44j-cfrm-g8qc","Warn: Project is vulnerable to: GHSA-v435-xc8x-wvr9"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-24T00:24:53.743Z","repository_id":36923744,"created_at":"2025-08-24T00:24:53.743Z","updated_at":"2025-08-24T00:24:53.743Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280965552,"owners_count":26421660,"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","status":"online","status_checked_at":"2025-10-25T02:00:06.499Z","response_time":81,"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":["automation","custom-elements","custom-tag","polymer","selenium","selenium-java","selenium-webdriver","shadow-dom","testing-tools"],"created_at":"2024-08-04T01:01:18.358Z","updated_at":"2025-10-25T14:14:12.990Z","avatar_url":"https://github.com/sukgu.png","language":"Java","funding_links":[],"categories":["Meta Frameworks"],"sub_categories":["Testing Solutions"],"readme":"# Shadow root DOM automation using selenium\n\n[![Build Status](https://travis-ci.org/sukgu/shadow-automation-selenium.svg?branch=master)](https://travis-ci.org/sukgu/shadow-automation-selenium \"Travis CI\")\n[![codecov](https://codecov.io/gh/sukgu/shadow-automation-selenium/branch/master/graph/badge.svg)](https://codecov.io/gh/sukgu/shadow-automation-selenium)\n[![Maven Central](https://img.shields.io/maven-central/v/io.github.sukgu/automation.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22io.github.sukgu%22%20AND%20a:%22automation%22)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n## Shadow DOM:\nShadow DOM is a web standard that offers component style and markup encapsulation. It is a critically important piece of the Web Components story as it ensures that a component will work in any environment even if other CSS or JavaScript is at play on the page.\n\n## Custom HTML Tags:\nCustom HTML tags can't be directly identified with selenium tools. Using this plugin you can handle any custom HTML tags.\n\n## Problem Statement:\n- You have already developed your web-based automation framework in java selenium. Your frontend application uses Polymer that uses shadow dom. Selenium doesn't provide any way to deal with shadow-dom elements.\n- Your application page contains custom HTML tags that can't be identified directly using selenium.\n\n## Solution:\nYou can use this plugin by adding jar file or by including maven dependency in your java selenium project.\n\n## How it works:\n\n## Methods:\n  `WebElement findElement(String cssSelector)` : use this method if want single element from DOM\n\n  `List\u003cWebElement\u003e findElements(String cssSelector)` : use this if you want to find all elements from DOM\n  \n  `WebElement findElement(WebElement parent, String cssSelector)` : use this if you want to find a single elements from parent object DOM\n  \n  `List\u003cWebElement\u003e findElements(WebElement parent, String cssSelector)` : use this if you want to find all elements from parent object DOM\n  \n  `WebElement findElementByXPath(String XPath)` : use this method if want single element from DOM\n\n  `List\u003cWebElement\u003e findElementsByXPath(String XPath)` : use this if you want to find all elements from DOM\n  \n  `WebElement findElementByXPath(WebElement parent, String XPath)` : use this if you want to find a single elements from parent object DOM\n  \n  `List\u003cWebElement\u003e findElementsByXPath(WebElement parent, String XPath)` : use this if you want to find all elements from parent object DOM\n  \n   `void setImplicitWait(int seconds)` : use this method for implicit wait\n    \n   `void setExplicitWait(int seconds, int pollingTime) throws Exception` : use this method for explicit wait\n  \n  `WebElement getShadowElement(WebElement parent,String selector)` : use this if you want to find a single element from parent DOM\n  \n  `List\u003cWebElement\u003e getAllShadowElement(WebElement parent,String selector)` : use this if you want to find all elements from parent DOM\n  \n  `WebElement getParentElement(WebElement element)` : use this to get the parent element if web element.\n  \n  `List\u003cWebElement\u003e getChildElements(WebElement parent)` : use this to get all the child elements of parent element.\n  \n  `List\u003cWebElement\u003e getSiblingElements(WebElement element)` : use this to get all adjacent (sibling) elements.\n  \n  `WebElement getSiblingElement(WebElement element, String selector)` : use this to get adjacent(sibling) element using css selector.\n  \n  `WebElement getNextSiblingElement(WebElement element)` : use this to get next adjacent(sibling) element.\n  \n  `WebElement getPreviousSiblingElement(WebElement element)` : use this to get previous adjacent(sibling) element..\n  \n  `boolean isVisible(WebElement element)` : use this if you want to find visibility of element\n  \n  `boolean isChecked(WebElement element)` : use this if you want to check if checkbox is selected \n  \n  `boolean isDisabled(WebElement element)` : use this if you want to check if element is disabled\n  \n  `String getAttribute(WebElement element,String attribute)` : use this if you want to get attribute like aria-selected and other custom attributes of elements.\n  \n  `void selectCheckbox(String label)` : use this to select checkbox element using label.\n  \n  `void selectCheckbox(WebElement parentElement, String label)` : use this to select checkbox element using label.\n  \n  `void selectRadio(String label)` : use this to select radio element using label.\n  \n  `void selectRadio(WebElement parentElement, String label)` : use this to select radio element from parent DOM using label.\n  \n  `void selectDropdown(String label)` : use this to select dropdown list item using label (use this if only one dropdown is present or loaded on UI).\n  \n  `void selectDropdown(WebElement parentElement, String label)` : use this to select dropdown list item from parent DOM using label.\n  \n  `void scrollTo(WebElement element)` : use this to scroll to web element.\n  \n  `public void highlight(WebElement element, String color, Integer timeInMiliSeconds)` : highlight method.\n  \n  `public void highlight(WebElement element)` : highlight method highlight in red color.\n\n### What's New \n##### We support now Selenium version 4 with release of Shadow version 0.1.5\n##### Java 11 and Selenium 4.16.1 to be used with Shadow 0.1.5\n\n###### How to use this plugin:\n  You will have to dependency in your project.\n  \n  **Maven**\n  ```\n  \u003cdependency\u003e\n\t\u003cgroupId\u003eio.github.sukgu\u003c/groupId\u003e\n\t\u003cartifactId\u003eautomation\u003c/artifactId\u003e\n\t\u003cversion\u003e0.1.5\u003c/version\u003e\n  \u003c/dependency\u003e\n  ```\n  \n  **Gradle**\n  ```\n  implementation 'io.github.sukgu:automation:0.1.5'\n  ```\n  \n  \n You can download the jar file from repository http://central.maven.org/maven2/io/github/sukgu/automation/0.1.5/automation-0.1.5.jar\n  \n## Selector:\n  ###### Examples: \n  for html tag ``` \u003cpaper-tab title=\"Settings\"\u003e ```\n  You can use this code in your framework to grab the paper-tab element Object.\n  ```java\n    import io.github.sukgu.*;\n\t\n\tShadow shadow = new Shadow(driver);\n\tWebElement element = shadow.findElement(\"paper-tab[title='Settings']\");\n\tList\u003cWebElement\u003e element = shadow.findElements(\"paper-tab[title='Settings']\");\n    String text = element.getText();\n  ```\n  for html tag that resides under a shadow-root dom element ``` \u003cinput title=\"The name of the employee\"\u003e ```\n  You can use this code in your framework to grab the paper-tab element Object.\n  ```java\n    import io.github.sukgu.*;\n\t\n\tShadow shadow = new Shadow(driver);\n\tWebElement element = shadow.findElement(\"input[title='The name of the employee']\");\n    String text = element.getText();\n  ```\n  for html tag that resides under a shadow-root dom element \n  ``` \n  \u003cproperties-page id=\"settingsPage\"\u003e \n    \u003ctextarea id=\"textarea\"\u003e\n  \u003c/properties-page\u003e\n  ```\n  You can use this code in your framework to grab the textarea element Object.\n  ```java\n    import io.github.sukgu.*;\n\t\n\tShadow shadow = new Shadow(driver);\n\tWebElement element = shadow.findElement(\"properties-page#settingsPage\u003etextarea#textarea\");\n    String text = element.getText();\n  ```\n  \n## Note for XPath:\n\n* 🟩 The findElementByXPath or findElementsByXPath takes XPath only with double slash internally for intermediate selections\n* 🟩 //div[@id='container']//h2[text()='Inside Shadow DOM'] is **correct**\n* 🟩 //div[@id='container']/h2[text()='Inside Shadow DOM'] is **correct**\n* 🟩 For examples on XPath follow the [link](https://github.com/sukgu/shadow-automation-selenium/wiki/Examples-for-XPath-selector)\n  \n## Wait: Implicit and Explicit\nIf you want to use wait to synchronize your scripts then you should use the implicit or explicit wait feature.\n\n* For Implicit wait, you can use **shadow.setImplicitWait(int seconds)** method.\n* For Explicit wait, you can use **shadow.setExplicitWait(int seconds, int pollingTime)** method.\n\n* In Implicit wait, the driver will wait for at least n seconds as set in **shadow.setImplicitWait(n)**.\n* In Explicit wait, the driver will wait for at max n seconds as set in **shadow.setImplicitWait(n,m)**. In between driver will check for presence of WebElement every m seconds.\n\n## PageFactory:\n* @FindElementBy annotation can be used with PageFactory model to find elements based on css_selector or xpath.\n* To achieve this you will need to modify page initialization method as `PageFactory.initElements(new ElementFieldDecorator(new DefaultElementLocatorFactory(driver), this)`.\n* For more example on PageFactory see this [page](https://github.com/sukgu/shadow-automation-selenium/wiki/PageFactory-Annotations).\n#### PageFactory Example:\n``` java\nimport org.openqa.selenium.WebDriver;\nimport org.openqa.selenium.WebElement;\nimport org.openqa.selenium.support.FindBy;\nimport org.openqa.selenium.support.PageFactory;\nimport org.openqa.selenium.support.pagefactory.DefaultElementLocatorFactory;\nimport io.github.sukgu.support.ElementFieldDecorator;\nimport io.github.sukgu.support.FindElementBy;\n\npublic class LocalTestPage {\n\t\n\tWebDriver driver;\n\t\n\t@FindElementBy(css = \"#container\")\n\tWebElement container;\n\t\n\t@FindBy(css = \"#h3\")\n\tWebElement h3;\n\t\n\t@FindBy(css = \"#h3\")\n\tList\u003cWebElement\u003e allH3;\n\t\n\t@FindElementBy(css = \"#inside\")\n\tList\u003cWebElement\u003e insides;\n\t\n\t@FindElementBy(xpath = \"//body\")\n\tWebElement bodyByXPath;\n\t\n\t@FindElementBy(xpath = \"//body//div[1]\")\n\tWebElement divByIndex;\n\t\n    public LocalTestPage(WebDriver driver) {\n    \tthis.driver = driver;\n    \tElementFieldDecorator decorator = new ElementFieldDecorator(new DefaultElementLocatorFactory(driver));\n    \t// need to use decorator if you want to use @FindElementBy in your PageFactory model.\n    \tPageFactory.initElements(decorator, this);\n    }\n    //... \n}\n```\n  \n  **Documentation** [Link](https://github.com/sukgu/shadow-automation-selenium/wiki)\n  \n  **Library for Python Selenium** [Link](https://pypi.org/project/pyshadow/)\n  **Git Repo for Python Selenium** [Link](https://github.com/sukgu/pyshadow/)\n  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsukgu%2Fshadow-automation-selenium","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsukgu%2Fshadow-automation-selenium","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsukgu%2Fshadow-automation-selenium/lists"}