A Maven-based Selenium automation framework with support for Selenium Grid (Docker Compose). Ready to open in VS Code or Eclipse and run tests locally or on a containerized Selenium Grid.
- Group ID:
com.w2a
- Artifact ID:
GridDocker
- Version:
0.0.1-SNAPSHOT
- Build tool: Apache Maven
- Main dependency:
selenium-java:2.53.1
- Java JDK 8 or higher
- Apache Maven
- Git (optional, for version control)
- Docker & Docker Compose (for Selenium Grid)
- IDE: VS Code (with Java & Maven extensions) or Eclipse
# Clone from Git (replace URL with your repo)
git clone https://github.com/<your-username>/GridDocker.git
cd GridDocker
# OR if you have GridDocker.zip: extract and cd into the folder
- VS Code:
code .
— Install Java Extension Pack and Maven for Java if prompted. - Eclipse: File → Import → Existing Maven Projects → select project root.
mvn clean install
mvn test
If you want distributed browser execution, use the included docker-compose.yml
.
docker-compose up -d
This should start the Selenium Hub and browser nodes (Chrome/Firefox). Hub typically available at http://localhost:4444
.
docker-compose down
In your Java test setup, point RemoteWebDriver
to the hub:
import org.openqa.selenium.remote.RemoteWebDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
import java.net.URL;
DesiredCapabilities caps = DesiredCapabilities.chrome(); // or firefox()
RemoteWebDriver driver = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"), caps);
GridDocker/
│── pom.xml
│── .project
│── docker-compose.yml
│── src/
│ ├── main/java/ # application code (if any)
│ └── test/java/ # selenium test classes
- Create a file
README.md
in project root and paste this content. - Open integrated terminal with Ctrl+` to run Maven commands.
- Preview Markdown with Ctrl+Shift+V (or Cmd+Shift+V on Mac).
Initialize and push:
git init
git add .
git commit -m "Initial commit — add project and README"
git branch -M main
git remote add origin https://github.com/<your-username>/GridDocker.git
git push -u origin main
-
Selenium version
2.53.1
is old; consider upgrading to a newer Selenium (3.x/4.x) for better browser support. -
If you want, I can add:
- a ready-to-run
SampleTest.java
undersrc/test/java
- a
.gitignore
- GitHub badges for the README
- a ready-to-run
MIT — use and modify freely.