Video summary

Session 55: Selenium with Java | Hybrid Framework | Git & GitHub Workflow

Main summary

Key takeaways

Technology

Technological concepts / framework execution (Selenium + Java)

Moving from framework development to test execution

  • Framework building is largely complete (~80–90%) with:
    • utility files
    • page objects
    • test data/resources
  • Next steps to complete the setup:
    • add more test cases
    • add more Page Object classes
  • Example existing test cases:
    • Login
    • Account Registration

How tests are executed using TestNG XML suites

  • Multiple TestNG XML files are maintained for different execution modes:
    • Grouping suite XML
    • Parallel testing XML
    • Remote execution XML (for Docker/grid scenarios)
  • Execution generates external reports and logs (already wired into the framework).

Maven (pom.xml) as the execution mechanism (CI-friendly)

Maven runs the TestNG suites outside Eclipse and later integrates with Jenkins/CI.

In pom.xml, two main parts are emphasized:

  1. <dependencies>: downloads required JARs (Selenium, TestNG, reporting libraries, etc.)
  2. <plugins>: compiles/runs the automation

Key Maven plugins mentioned for execution:

  • maven-compiler-plugin
    • compiles project code
  • maven-surefire-plugin
    • executes tests
    • runs TestNG XML suites
    • configured by specifying the TestNG XML suite file(s) to execute via XML name(s)

Running pom.xml inside Eclipse

  • Eclipse Run Configurations show Maven goals such as:
    • clean, install, test, verify
  • The relevant goal for execution is: mvn test
  • Terminology note:
    • “Build Success” is treated as “automation execution success”.

Running Maven tests from Command Prompt (outside Eclipse)

  • Requires Maven installed at the OS level (not only Eclipse’s built-in Maven).
  • Command structure:
    • Go to project directory: cd <project-path>
    • Execute tests: mvn test
  • Optional cleanup:
    • mvn clean test (removes leftover execution artifacts first)

Automation of command execution using scripts

  • Use a script to avoid typing commands repeatedly:
    • Windows batch file: run.bat
    • Mac shell script
  • Script typically contains:
    • cd to the project folder
    • mvn test
  • Mentioned for CI usage: workflow can involve pom.xml plus scripts like run.bat.

Execution hierarchy (single entrypoint)

The intended chain is:

  • pom.xml → executes TestNG XML (e.g., test.xml, master.xml) → runs test cases using:

    • Page Object classes
    • utility files
    • test data and other configurations

Emphasis: pom.xml becomes the single source for executing chosen suites across environments (Eclipse, CMD, Jenkins, etc.).


CI process overview + Git/GitHub/Jenkins workflow (high-level)

Why CI is needed

  • After code is committed, CI runs automation to validate builds continuously.
  • Collaboration roles mentioned:
    • Developers
    • QA/Testers (maintain automation/scripts and commit/push changes)
    • DevOps (create builds, run automation, certify builds)

Nightly build lifecycle (conceptual timeline)

  • Developers work during the day:
    • commit locally
    • push to GitHub by a cutoff time (e.g., 5 PM)
  • DevOps runs during the night using Maven goals:
    • build creation
    • run automation
    • build certification
  • QA downloads the certified build next morning and continues testing.
  • Jenkins is described as the tool that runs automation based on code from GitHub.

Where GitHub fits

  • Git: local version control repository on developer/tester machines
  • GitHub: shared remote repository accessed by CI tools and team members

Git/GitHub practical workflow (commands and states)

Prerequisites

  • Install Git
  • Create a GitHub account
  • Notes:
    • Git is required to create local repositories
    • GitHub is required to create remote repositories

File state model

  • Untracked: present in workspace but not staged
  • Staged/Tracked: after git add, in staging/index
  • Committed: after git commit, saved in local repo
  • Pushed/Remote files: after git push, available on GitHub

Core Git commands (repeated daily)

One-time setup

  • Initialize local repo: git init
  • Set identity (one-time):
    • git config --global user.name ...
    • git config --global user.email ...

Daily update loop

  • git status (check changes)
  • git add . (stage all changes) or selective staging:
    • git add <file>
    • git add <folder>
  • git commit -m "<message>"
  • git push origin master (push to remote; authentication via token when needed)

Remote repository setup

  • In GitHub:
    • create a repository (generate remote URL)
  • One-time connect local repo to remote:
    • git remote add origin <github-url>
  • Upload local commits:
    • git push origin master

Authentication for pushing

  • Push authentication can use a Personal Access Token instead of browser/device flow.
  • Token creation steps mentioned:
    • GitHub Settings → Developer settings → Personal access tokens → generate token
    • Choose required scopes/privileges (repo/admin-related mentioned)

Reverse direction: pulling remote changes

  • If the remote has updates not in local:
    • git pull <remote-url>
  • Then continue with local changes:
    • add → commit → push

Cloning an existing repo (new team onboarding scenario)

  • If a project exists on GitHub and you want it locally:
    • git clone <repo-url>
  • Key distinction:
    • Clone when local repo doesn’t exist
    • Pull when local repo exists but remote has new changes

Advanced concept preview: branching and conflicts (high-level)

  • For real teamwork, people work in separate branches (e.g., B1/B2/B3).
  • Branches are merged into master.
  • Conflicts are resolved during merge by admins/senior GitHub managers.
  • Details of branching/merging/Pull Requests are deferred to later/other sessions.

Key practical “guide/tutorial” deliverables mentioned

Maven setup and execution

  • Add Maven plugins to pom.xml:
    • maven-compiler-plugin
    • maven-surefire-plugin configured to run selected TestNG XML suite(s)
  • Execution methods:
    • Eclipse: run pom.xml via Maven goal test
    • Command Prompt: run mvn test
    • Automation: use run.bat (Windows) or a shell script (Mac)
  • OS-level Maven installation:
    • download Maven binary (zip/tar) from Apache Maven
    • set MAVEN_HOME / PATH (especially PATH to bin)
    • verify with: mvn -version
  • Java prerequisites:
    • Maven requires Java (17+ referenced)

Git/GitHub setup and workflow

  • Install Git
  • Create GitHub account + remote repo
  • Daily loop: add → commit → push
  • Sync remote → local: pull
  • Onboarding: clone

Main speakers / sources

  • Main speaker/source: the course instructor (no specific name provided in subtitles)
  • Primary external references:
    • Apache Maven official documentation
    • Apache Maven project download pages
    • GitHub (account/repo/token and remote workflow steps)

Original video