
Develop a simple math microservice with Spring Boot by exposing a REST endpoint /add that takes two numbers and returns a JSON result, illustrating rapid Spring Boot web app creation.
Dependency injection in spring boot is introduced, illustrating constructor, setter, and field injection for page objects and webdriver waits in a test automation framework.
Create an empty Spring Boot project using start.spring.io with a Maven setup, Java 11, and jar packaging, then set group com.udemy.spring and artifact Spring Selenium and generate.
Explore dependency injection without spring boot by building user, address, and salary objects, printing details, and showing tight versus loose coupling before adopting spring approaches.
Apply Spring dependency injection to auto-wire a user object with address and salary, enabling Spring to create and inject dependencies and print user details.
Discover field injection in Spring by autowiring a local field, removing constructors and setters, and seeing injected values print automatically when the bean runs.
Ensure that Spring manages your objects by annotating with @Component to enable autowiring and avoid no qualifying bean errors and null pointer exceptions.
Understand how spring manages components and uses autowiring to inject dependencies into test classes, and how @Value provides primitive and property values.
Use the value annotation to access environment variables and properties such as path and fruits from application.properties, while Spring auto converts types like a list, integers, and booleans.
Learn to inject default configuration values in Spring Boot when environment variables are absent, using colon syntax in value annotations to prevent exceptions.
Use setter-based value injection to populate user and address objects from property files, with default values, and see Spring Boot wire the objects into tests.
Learn how to autowire objects from external libraries like Java Faker in a Spring Boot test framework, turning third-party classes into beans and resolving no qualifying bean errors.
Discover how spring autowires objects from external libraries by creating a minimal config that returns a faker bean, enabling auto configuration and correct component scanning.
Compare @Component and @Bean in Spring: component scan auto-detects components, while @Bean enables manual configuration for third-party objects like faker; Spring autowires both when requested.
Dear All,
There is a recent change as part of Spring 3 version. Any "javax" package to be replaced with "jakarta".
For example, in the following lecture, I will import a package.
import javax.annotation.PostConstruct;
This is changed to
import jakarta.annotation.PostConstruct;
Thanks.
Demonstrates the spring bean lifecycle by creating a tv component, injecting a name, using post construct to turn on and play scenes, and pre destroy to shut down.
Learn how Spring enables loosely coupled apps through dependency injection and bean management, with Spring Boot for automatic configuration and autowiring, plus lifecycle annotations like post construct and pre destroy.
Build a simple test automation framework with Spring Boot, Selenium, and WebDriverManager by creating a WebDriver bean, configuring dependencies, and building a page object to run JUnit tests.
Create a base abstract page class that autowires WebDriver, initializes elements with the page factory, and defines an isAt check for loaded pages, enabling Chrome-based page objects and components.
Create a Google search component extending base page, use webdriver wait to confirm loading, locate the search box by name q, and click the first enabled, displayed button among duplicates.
Enhance test robustness for the Google page search component by handling Ajax suggestions with Selenium, adding a click or tab to dismiss suggestions, improving cross-browser reliability in Chrome and Firefox.
Build the Google page object by composing page components such as the search component and search result, extending the base class and following the single responsibility principle.
Create a Google test class in spring boot, extend spring base test, autowire Google page, launch the site with TestNG, and assert search results exceed two.
Implement dynamic screenshot saving in the ScreenShotUtil Spring component by resolving a given image name against a path to generate unique file names, avoiding hard-coded image.png.
Add firefox driver to the web driver config, handle a bean injection conflict where both chrome and firefox drivers exist, and ensure a unique webdriver bean before proceeding.
learn how to inject a unique bean with spring boot by using the @Primary annotation to resolve multiple webdriver implementations, ensuring Firefox launches without errors.
Explore injecting a unique bean with conditional on missing bean in Spring Boot, using Chrome as default and Firefox as explicit, and learn how bean order decides which browser launches.
Demonstrate how to inject a single Spring Boot bean based on runtime conditions using Spring Boot's ConditionalOnExpression, illustrated with a car interface and two implementations, Civic and another car, wired as components and selected by expression in tests.
Explore how to inject a unique bean in Spring using the qualifier annotation, with practical examples of card and civic beans, and discuss best practices over property-based control.
Discover how spring profiles let you override application.properties per environment (default, staging, qa) by activating a specific profile with spring.profiles.active.
Activate the spring profiles by setting spring.profiles.active to run tests in dev, qa, stg, and prd environments, and run maven tests with the profile.
Use Spring profiles to run tests across dev, staging, QA, and production with lazy beans and remote or local webdriver configurations via a grid URL and Firefox or Chrome drivers.
Learn to run tests across local and remote Selenium grids by using Spring profiles, dockerized grids, and multi-profile configurations to target Firefox or Chrome.
Refactor the test framework by extracting the webdriver wait into its own configuration, enabling consistent webdriver bean creation for remote Selenium Grid and local profiles and preventing code duplication.
Learn bean scope and parallel testing within a spring boot based test automation framework, building two simple selenium tests and a test suite to run them.
Investigate parallel testing in a Java Spring Boot and Selenium setup by running two Google tests with a test suite XML, uncovering shared browser issues and why parallel runs fail.
Demonstrate a bean scope issue with a simple demo, showing how a single salary bean autowired into junior and senior engineers overwrites amounts during tests, and what’s behind it.
Compare singleton scope, which shares a single salary bean across all roles, with prototype scope, which creates a new salary instance for each use to avoid sharing.
Explore managing WebDriver lifecycles in a SDET framework by comparing singleton, prototype, and thread scope, and learn how a custom thread-local scope enables parallel testing with page objects.
Create a custom browser scope by extending the thread scope, override get and remove to manage WebDriver sessions, and register the scope with a browser scope post-processor and config.
Learn how to configure a browser scope bean in Spring Boot for test automation, run parallel and sequential tests, manage thread counts, and simulate browser quit during WebDriver testing.
Understand how the Spring IoC container creates and manages beans, including singleton and prototype scopes, and how the application context fetches webdriver and screenshot util on demand.
Demonstrate using the Spring application context to obtain a fresh WebDriver via context.getBean, ensuring on-demand bean creation for reliable screenshot tests.
Demonstrates a simple webdriver factory using the application context to retrieve Chrome and Firefox drivers via getBean for multi-browser tests in Spring Boot.
Refactor the webdriver factory using the application context and introduce thread scope beans with lazy wiring. Rename screenshot util to screenshot service and organize under the Kelvin framework.
Refactor the webdriver wait by setting its scope to prototype, ensuring a fresh instance per webdriver, since singleton or thread scopes are inappropriate; configure via a configurable bean factory.
Master beam scope concepts, including singleton, prototype, and custom thread scope, to enable parallel browser testing and on-demand bean creation via application context and webdriver factory.
Explore methods to access files in test automation, prioritizing classpath for project resources, using the file system for external files, and Http for external sites.
Access project resources from the local disk by creating a resources directory with a csv file, then read its contents via classpath resources using read all lines.
Learn how to download resources in a Spring Boot app by using file copy utils with input and output streams to read an external URL and save the file locally.
Access AWS S3 bucket resources via the Spring Boot resource interface to perform object put and get operations easily, with proper credentials or roles.
Use Spring core resource loader to access runtime resources from a test data CSV, download each URL, and save content to local text files.
Load dynamic properties at runtime with PropertiesLoaderUtils in Spring, accessing default and profile properties, reading external my.properties from classpath or disk, which returns a map for easy use.
Centralize Spring Boot configuration by modeling properties in a single class and using the PropertySource annotation to avoid repeated string injections and misspellings.
Demonstrate using a property source to validate multilingual content in a flight app. Launch in English, switch to Indonesian, and verify translations against a property file and the UI.
Create a page object by treating five web elements as a list and locate the correct tab text with a css locator, extracting inner text from the anchor elements.
Develop a Google flight page object in a Java Selenium framework, placing a flight page under flights, locating headers by CSS, and extracting trimmed labels into a list.
Create and organize language property files for a flight application, including English and Indonesian properties for labels and urls. Validate localization with a test class.
Model a single properties class to inject flight app details for a Google flight application test in Spring Boot, using property source and value annotations to drive actions and assertions.
Dive into a Google flight test demo within a Java + Spring Boot SDET framework, resolving resource path issues, handling fullscreen mode, and validating multi-language labels and command-line parameterization.
Explore localization testing by parameterizing language via the command line, loading language-specific property files in Spring Boot, and modeling properties for centralized access to URLs, labels, and credentials.
Learn to run multi-language validations in a Spring Boot test using @TestPropertySource and property loader utils, switching English and Indonesian properties at runtime within flight test extensions.
Explore how Spring Boot's @TestPropertySource enables runtime property overrides for tests, such as locale and browser, demonstrating running specific tests in Firefox while others use Chrome.
Access resources from classpath, files, http, and s3 with a simple annotation and the resource loader; copy them with Spring Boot utilities and use property sources for localization and testing.
Automate a main window plus three additional windows with data-driven inputs and window switching, transforming numbers by two and by three in a Spring Boot framework.
Implement a window switch service in a Spring Boot context to switch between windows by title or by index, using the current thread's WebDriver and window handles.
Create page objects for the Windows Switch service, extending the base page, implement the main page with link collection, and automate launching the site and clicking each link.
Create page objects for multiple windows in a Java and Spring Boot test automation framework, implement shared elements and wait conditions, and build a window switch service.
Create a test class for window switch in a Java Spring Boot SDET framework, wiring main page and window switch service to validate switch by title and index.
Demonstrates a selenium-based test in a Java + Spring Boot SDET framework, comparing Chrome and Firefox for window switching, with waits for new windows and switching by title or index.
Learn to implement an aspect oriented window switch using @Aspect in a spring selenium framework, applying a before advice to switch windows by title and return to the main window.
Demonstrates aspect oriented programming by auto switching windows around test steps using a before/after annotation, with Spring Boot handling the cross-cutting concern across Firefox tests.
Implement an aspect oriented programming solution to automatically capture a screenshot when the get labels method is invoked, and store the image with a defined name at a chosen location.
Implement an aspect-oriented screenshot mechanism in a Spring Boot test framework by creating a take screenshot annotation, wiring the screenshot service, and triggering it on annotated methods.
Explore aspect oriented programming to separate cross-cutting concerns from core logic using annotations, enabling reusable features like window switching, take screenshot, logging, and conditional re-execution across projects.
Introduce Spring Data JPA as an abstraction over JPA with Hibernate behind the scenes, enabling database operations without SQL and seamless database switching.
Use spring data in testing with CSV data to drive tests and run only matching cases, while spring loads the CSV into a table at startup.
Explore how relational databases map tables to entity classes and columns to fields in Java, and how Spring Data repositories manage user and user order entities.
Define the repository interface as an extension of JpaRepository, parameterized by the entity class and its primary key type, and annotate it with @Repository for Spring integration.
Create a test class for the user repository, autowire it, and exercise Spring Data JPA methods such as find all, find by id, save, and delete, noting optional returns.
Autowire the visa registration page, fetch the first three users, fill the form with each user's details, submit, and print the confirmation number to demonstrate test automation.
Handle null comments in a selenium visa test using objects.toString as a default, then validate with CSV user data and obtain three confirmation numbers.
Discover how Spring Data JPA auto generates queries from repository method names, such as find by first name starting with, to fetch users without writing SQL.
Demonstrates data driven testing by querying users born within a DOB range of 1995-01-01 to 1999-01-01 using a find by DOB between repository method.
Dive into Spring Data JPA and its large scope, including CRUD operations, joining multiple tables, invoking procedures, and pagination with sorting. The lecture points to Udemy courses for deeper learning.
Use a private static final logger in test classes and page objects with a simple logging facade. Log at debug, info, warn, and error levels to track events and exceptions.
Learn how to control log output by setting log levels in application.properties, enabling debug locally while showing only warnings or errors on remote machines, with package-level overrides and profiles.
Route all logging information into a file by setting the level to info and using the logging.file.name property to create a test execution log.
Learn to configure logging in a Spring Boot SDET framework by setting logging level and package scope, enabling file logging, and controlling log size and history.
Integrate Cucumber into the test framework and provide a 10,000ft overview of BDD and Cucumber, then demonstrate with a Google page test.
Learn how behavior driven development extends tdd by using feature files and scenarios to align the three amigos, qa, va, and dev, through given when then steps, reducing miscommunication early.
Add cucumber related dependencies to your pom file after the webdriver manager, including cucumber Java, cucumber spring, and cucumber testing library for dependency injection with JUnit.
Create a cucumber feature file under src/test/resources/features to test Google search, using a scenario outline with keyword and result count parameterization, and provide data via examples.
Learn to create Java step definitions for a feature file in a bdd framework, map steps to Java class methods, and organize definitions in a dedicated Google steps package.
Rename step definitions for Google Test, convert inputs from string to integer, and refine actions like launch site, enter keyword, and click search, then verify results by count.
Create a feature file for the visa registration page, modeling the submission workflow from country selection to a confirmation number, and refactor steps into visa steps within the SDET framework.
Consolidate the glue class to a single step definition class to fix spring context configuration with cucumber, enabling autowiring and successful visa, google, and search tests.
Create a cucumber runner for command line execution, with features on classpath and glue code in the base package. Enable pretty and html plugins to generate reports for the tests.
Enable parallel test execution by turning on the data provider’s parallel option and overriding the cucumber runner to run scenarios across multiple browsers.
Limit scenario parallelism by configuring the maven surefire plugin and data provider thread count to two in the pom.xml. Run only cucumber tests in mvn test with two threads.
Learn to group thousands of cucumber scenarios with tags, and run only smoke or regression tests using the cucumber runner and feature-level tag inheritance.
Learn to run Cucumber features from the command line using --tags or -t, parameterize browser, and adjust path, glue, and plugin to execute Google tests in parallel.
integrate cucumber with spring boot, auto wire dependencies and services (screenshot service, google page), and manage webdriver lifecycles with hooks, including parallel runs and shutdown hooks.
Unlock the potential of Spring Boot in your Test Automation Framework and achieve more with less code. In this course, you'll harness Spring Boot's power to create a robust test automation framework for functional tests using Selenium and Cucumber.
Key Learning Points:
Dependency Injection: Automate object creation in Page Objects and test classes effortlessly with Spring's support.
WebDriver Manager: Seamlessly manage web driver life cycles using Spring Boot.
Page Objects & Page Fragments: Create reusable page components and inject them into Page Objects.
Parallel Test Execution: Implement multi-threading, web driver management, and parallel test execution with clear thread-specific scope.
Test Execution in Multiple Environments: Manage environment-specific properties like URLs and user credentials via property files.
Localization Testing: Validate language keywords for applications supporting multiple languages with Spring Boot.
Data Driven Testing using Spring Data JPA: Execute tests by reading data from spreadsheets with ease using Spring Data JPA.
Cucumber Feature Files: Embrace Behavior-Driven Development (BDD) by writing Cucumber feature files to drive tests.
Handling External Resources: Access external resources such as properties and files within the framework.
Automatic Window/Frame Switching: Effortlessly switch between windows/frames using annotations like @Window.
Aspect-Oriented Programming (AOP): Automatically capture screenshots in your tests using AOP.
Local vs. Remote Grid: Execute tests locally or on remote Selenium grids by easily switching Spring profiles.
And much more to supercharge your test automation capabilities!