{"id":23507684,"url":"https://github.com/troywalshprof/seleniumbazelpoc","last_synced_at":"2025-05-13T00:40:53.144Z","repository":{"id":49772723,"uuid":"375506644","full_name":"TroyWalshProf/SeleniumBazelPOC","owner":"TroyWalshProf","description":null,"archived":false,"fork":false,"pushed_at":"2021-06-23T01:04:26.000Z","size":76691,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"trunk","last_synced_at":"2025-02-16T19:22:48.267Z","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TroyWalshProf.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":"SECURITY.md","support":null}},"created_at":"2021-06-09T22:43:00.000Z","updated_at":"2021-06-23T01:04:29.000Z","dependencies_parsed_at":"2022-08-02T14:45:35.530Z","dependency_job_id":null,"html_url":"https://github.com/TroyWalshProf/SeleniumBazelPOC","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TroyWalshProf%2FSeleniumBazelPOC","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TroyWalshProf%2FSeleniumBazelPOC/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TroyWalshProf%2FSeleniumBazelPOC/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TroyWalshProf%2FSeleniumBazelPOC/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TroyWalshProf","download_url":"https://codeload.github.com/TroyWalshProf/SeleniumBazelPOC/tar.gz/refs/heads/trunk","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253850841,"owners_count":21973667,"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":[],"created_at":"2024-12-25T10:34:01.748Z","updated_at":"2025-05-13T00:40:53.115Z","avatar_url":"https://github.com/TroyWalshProf.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Selenium\n\n[![Python workflow](https://github.com/SeleniumHQ/selenium/workflows/Python%20workflow/badge.svg)](https://github.com/SeleniumHQ/selenium/actions?query=workflow%3A%22Python+workflow%22)\n[![Ruby workflow](https://github.com/SeleniumHQ/selenium/workflows/Ruby%20workflow/badge.svg)](https://github.com/SeleniumHQ/selenium/actions?query=workflow%3A%22Ruby+workflow%22)\n[![JavaScript workflow](https://github.com/SeleniumHQ/selenium/workflows/JavaScript%20workflow/badge.svg)](https://github.com/SeleniumHQ/selenium/actions?query=workflow%3A%22JavaScript+workflow%22)\n[![Java workflow](https://github.com/SeleniumHQ/selenium/workflows/Java%20workflow/badge.svg)](https://github.com/SeleniumHQ/selenium/actions?query=workflow%3A%22Java+workflow%22)\n\n\n\u003ca href=\"https://selenium.dev\"\u003e\u003cimg src=\"https://selenium.dev/images/selenium_logo_square_green.png\" width=\"180\" alt=\"Selenium\"/\u003e\u003c/a\u003e\n\nSelenium is an umbrella project encapsulating a variety of tools and\nlibraries enabling web browser automation. Selenium specifically\nprovides an infrastructure for the [W3C WebDriver specification](https://w3c.github.io/webdriver/)\n— a platform and language-neutral coding interface compatible with all\nmajor web browsers.\n\nThe project is made possible by volunteer contributors who've\ngenerously donated thousands of hours in code development and upkeep.\n\nSelenium's source code is made available under the [Apache 2.0 license](https://github.com/SeleniumHQ/selenium/blob/trunk/LICENSE).\n\n## Documentation\n\nNarrative documentation:\n\n* [User Manual](https://selenium.dev/documentation/)\n\nAPI documentation:\n\n* [C#](https://seleniumhq.github.io/selenium/docs/api/dotnet/)\n* [JavaScript](https://seleniumhq.github.io/selenium/docs/api/javascript/)\n* [Java](https://seleniumhq.github.io/selenium/docs/api/java/index.html)\n* [Python](https://seleniumhq.github.io/selenium/docs/api/py/)\n* [Ruby](https://seleniumhq.github.io/selenium/docs/api/rb/)\n\n## Pull Requests\n\nPlease read [CONTRIBUTING.md](https://github.com/SeleniumHQ/selenium/blob/trunk/CONTRIBUTING.md)\nbefore submitting your pull requests.\n\n## Requirements\n\n* [Bazelisk](https://github.com/bazelbuild/bazelisk), a Bazel wrapper that automatically downloads\n  the version of Bazel specified in `.bazelversion` file and transparently passes through all\n  command-line arguments to the real Bazel binary.\n* The latest version of the [Java 11 OpenJDK](https://openjdk.java.net/)\n* `java` and `jar` on the PATH (make sure you use `java` executable from JDK but not JRE).\n  * To test this, try running the command `javac`. This command won't exist if you only have the JRE\n  installed. If you're met with a list of command-line options, you're referencing the JDK properly.\n* [Python 3.7+](https://www.python.org/downloads/)\n* `python` on the PATH\n* [The tox automation project](http://tox.readthedocs.org/) for Python: `pip install tox`\n* MacOS users should have the latest version of Xcode installed, including the command-line tools.\nThe following command should work:\n\n```bash\nxcode-select --install\n```\n\n* Users of Apple Silicon Macs should add `build\n  --host_platform=//:rosetta` to their `.bazelrc.local` file. We are working\n  to make sure this isn't required in the long run.\n\n* Windows users should have the latest version of Visual Studio command line tools and build tools installed\n  * `BAZEL_VS` environment variable should point to the location of the build tools,\n     e.g. `C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools`\n  * `BAZEL_VC` environment variable should point to the location of the command line tools,\n     e.g. `C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC`\n  * `BAZEL_VC_FULL_VERSION` environment variable should contain the version of the installed command line tools,\n     e.g. `14.27.29110`\n\n### Optional Requirements\n\n* Ruby 2.0\n\n### Internet Explorer Driver\n\nIf you plan to compile the\n[IE driver](https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver),\nyou also need:\n\n* [Visual Studio 2008](https://www.visualstudio.com/)\n* 32 and 64-bit cross compilers\n\nThe build will work on any platform, but the tests for IE will be\nskipped silently if you are not building on Windows.\n\n## Building\n\n### Bazel\n\n[Bazel](https://bazel.build/) was built by the fine folks at Google. Bazel manages dependency\ndownloads, generates the Selenium binaries, executes tests, and does it all rather quickly.\n\nMore detailed instructions for getting Bazel running are below, but if you can successfully get\nthe java and javascript folders to build without errors, you should be confident that you have the\ncorrect binaries on your system.\n\n### Before Building\n\nEnsure that you have Firefox installed and the latest\n[`geckodriver`](https://github.com/mozilla/geckodriver/releases/) on your `$PATH`.\nYou may have to update this from time to time.\n\n### Common Build Targets\n\nTo build the most commonly-used modules of Selenium from source, execute this command from the root\nproject folder:\n\n```sh\nbazel build java/...\n```\n\nIf you have some extra time on your hands, you can run this command to get extra confidence\nthat your build is successful. This will do a lot more work to build all the javascript artifacts:\n\n```sh\nbazel build java/... javascript/...\n```\n\nIf you're making changes to the java/ or javascript/ folders in this project, and this command\nexecutes without errors, you should be able to create a PR of your changes. (See also CONTRIBUTING.md)\n\n### Build Details\n\n* Bazel files are called BUILD.bazel\n* [crazyfun](https://github.com/SeleniumHQ/selenium/wiki/Crazy-Fun-Build) build files are called\n*build.desc*. This is an older build system, still in use in the project for Ruby bindings mostly.\n\nThe order the modules are built is determined by the build system. If you want to build an\nindividual module (assuming all dependent modules have previously been built), try the following:\n\n```sh\nbazel test javascript/atoms:test\n```\n\nIn this case, `javascript/atoms` is the module directory,\n`test` is a target in that directory's `BUILD.bazel` file.\n\nAs you see *build targets* scroll past in the log,\nyou may want to run them individually.\n\n\n\n## Common Tasks (Bazel)\n\nTo build the bulk of the Selenium binaries from source, run the\nfollowing command from the root folder:\n\n```sh\nbazel build java/... javascript/...\n```\n\nTo build the grid deployment jar, run this command:\n\n```sh\nbazel build grid\n```\n\nTo run tests within a particular area of the project, use the \"test\" command, followed\nby the folder or target. Tests are tagged with \"small\", \"medium\", or \"large\", and can be filtered\nwith the `--test_size_filters` option:\n\n```sh\nbazel test --test_size_filters=small,medium java/...\n```\n\nBazel's \"test\" command will run *all* tests in the package, including integration tests. Expect\nthe ```test java/...``` to launch browsers and consume a considerable amount of time and resources.\n\n## Editing Code\n\nMost of the team use either Intellij IDEA or VS.Code for their day-to-day editing. If you're\nworking in IntelliJ, then we highly recommend installing the [Bazel IJ\nplugin](https://plugins.jetbrains.com/plugin/8609-bazel) which is documented on\n[its own site](https://plugins.jetbrains.com/plugin/8609-bazel).\n\nIf you do use IntelliJ and the Bazel plugin, there is a project view checked into the tree\nin [scripts/ij.bazelproject](scripts/ij.bazelproject) which will make it easier to get up\nrunning, and editing code :)\n\n\n## Tour\n\nThe codebase is generally segmented around the languages used to\nwrite the component.  Selenium makes extensive use of JavaScript, so\nlet's start there.  Working on the JavaScript is easy.  First of all,\nstart the development server:\n\n```sh\nbazel run debug-server\n```\n\nNow, navigate to\n[http://localhost:2310/javascript](http://localhost:2310/javascript).\nYou'll find the contents of the `javascript/` directory being shown.\nWe use the [Closure\nLibrary](https://developers.google.com/closure/library/) for\ndeveloping much of the JavaScript, so now navigate to\n[http://localhost:2310/javascript/atoms/test](http://localhost:2310/javascript/atoms/test).\n\nThe tests in this directory are normal HTML files with names ending\nwith `_test.html`.  Click on one to load the page and run the test.\n\n## Maven POM files\n\nHere is the [public Selenium Maven\nrepository](https://repo1.maven.org/maven2/org/seleniumhq/selenium/).\n\n## Build Output\n\n`bazel` makes a top-level group of directories with the  `bazel-` prefix on each directory.\n\n## Help with `go`\n\nMore general, but basic, help for `go`…\n\n```sh\n./go --help\n```\n\n`go` is just a wrapper around\n[Rake](http://rake.rubyforge.org/), so you can use the standard\ncommands such as `rake -T` to get more information about available\ntargets.\n\n## Maven _per se_\n\nIf it is not clear already, Selenium is not built with Maven. It is\nbuilt with `bazel`, though that is invoked with `go` as outlined above,\nso you do not have to learn too much about that.\n\nThat said, it is possible to relatively quickly build Selenium pieces\nfor Maven to use. You are only really going to want to do this when\nyou are testing the cutting-edge of Selenium development (which we\nwelcome) against your application.  Here is the quickest way to build\nand deploy into your local maven repository (`~/.m2/repository`), while\nskipping Selenium's own tests.\n\n```sh\n./go maven-install\n```\n\nThe maven jars should now be in your local `~/.m2/repository`.\n\n## Useful Resources\n\nRefer to the [Build Instructions](https://github.com/SeleniumHQ/selenium/wiki/Build-Instructions)\nwiki page for the last word on building the bits and pieces of Selenium.\n\n## Running Browser Tests on Linux\n\nIn order to run Browser tests, you first need to install the browser-specific drivers,\nsuch as [`geckodriver`](https://github.com/mozilla/geckodriver/releases),\n[`chromedriver`](https://chromedriver.chromium.org/), or\n[`edgedriver`](https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/).\nThese need to be on your `PATH`.\n\nBy default, Bazel runs these tests in your current X-server UI. If you prefer, you can\nalternatively run them in a virtual or nested X-server.\n\n1. Run the X server `Xvfb :99` or `Xnest :99`\n2. Run a window manager, for example, `DISPLAY=:99 jwm`\n3. Run the tests you are interested in:\n```sh\nbazel test --test_env=DISPLAY=:99 //java/... --test_tag_filters=chrome\n```\n\nAn easy way to run tests in a virtual X-server is to use Bazel's `--run_under`\nfunctionality:\n```\nbazel test --run_under=\"xvfb-run -a\" //java/... --test_tag_filters=chrome\n```\n\n## Bazel Installation/Troubleshooting\n\n### MacOS\n\n#### bazelisk\n\nBazelisk is a Mac-friendly launcher for Bazel. To install, follow these steps:\n\n```sh\nbrew tap bazelbuild/tap \u0026\u0026 \\\nbrew uninstall bazel; \\\nbrew install bazelbuild/tap/bazelisk\n```\n\n#### Xcode\n\nIf you're getting errors that mention Xcode, you'll need to install the command-line tools.\n\nBazel for Mac requires some additional steps to configure properly. First things first: use\nthe Bazelisk project (courtesy of philwo), a pure golang implementation of Bazel. In order to\ninstall Bazelisk, first verify that your Xcode will cooperate: execute the following command:\n\n`xcode-select -p`\n\nIf the value is `/Applications/Xcode.app/Contents/Developer/`, you can proceed with bazelisk\ninstallation. If, however, the return value is `/Library/Developer/CommandLineTools/`, you'll\nneed to redirect the Xcode system to the correct value.\n\n```\nsudo xcode-select -s /Applications/Xcode.app/Contents/Developer/\nsudo xcodebuild -license\n```\n\nThe first command will prompt you for a password. The second step requires you to read a new Xcode\nlicense, and then accept it by typing \"agree\".\n\n(Thanks to [this thread](https://github.com/bazelbuild/bazel/issues/4314) for these steps)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftroywalshprof%2Fseleniumbazelpoc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftroywalshprof%2Fseleniumbazelpoc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftroywalshprof%2Fseleniumbazelpoc/lists"}