Posts

Showing posts from May, 2025

Detailed Selenium with Java syllabus

 Here’s a detailed Selenium with Java syllabus , perfect for automation testers aiming to master Selenium end-to-end with Java. This includes core Java concepts, Selenium WebDriver basics and advanced topics, frameworks, and integration tools. ✅ 1. Core Java for Selenium (Foundational knowledge required for Selenium scripting) Variables, Data Types Operators and Control Statements (if-else, loops) Arrays and Strings Methods and Constructors Object-Oriented Programming Classes & Objects Inheritance Polymorphism Abstraction & Encapsulation Exception Handling Collections Framework (List, Set, Map, Iterator) File Handling (FileReader, FileWriter, etc.) ✅ 2. Selenium WebDriver Basics (Hands-on browser automation using Java) Introduction to Selenium (Selenium vs QTP) Setting up Selenium with Java in Eclipse/IntelliJ WebDriver Architecture Locators: ID, Name, ClassName, LinkText, PartialLinkText XPath (absolute ...

30 real-time Java + Selenium programs

 Here are 30 real-time Java + Selenium programs that are practical and useful for testing real-world web applications. These tasks simulate actions like extracting product details, validating content, handling dynamic elements, and working with data. ๐Ÿ”น 30 Java + Selenium Real-Time Programs Visit Flipkart – Get product discount % – Convert "19% Off" to 19 (int). Search for a product on Amazon – Extract title, price, and rating. Open MakeMyTrip – Select source and destination cities – Print available flights. Visit IRCTC – Check available trains between two stations. Login to Facebook – Validate error message on wrong password. Search on Google – Count number of result links on the first page. Go to YouTube – Search a video – Play the first video. Visit RedBus – Select cities and date – Extract available buses and prices. Open Myntra – Filter products by brand and price – Count results. Go to Snapdeal – Add a product to the cart – Check if it’...

Selenium WebDriver commands grouped by Browser Commands, WebElement Commands, and Navigation Commands.

Here’s a more comprehensive list of all major Selenium WebDriver commands grouped by Browser Commands , WebElement Commands , and Navigation Commands .  This includes both commonly used and less frequent ones. ✅ 1. Browser Commands (For browser-level actions) Command Description driver.get("url") Opens a webpage. driver.getTitle() Gets the page title. driver.getCurrentUrl() Gets current URL. driver.getPageSource() Gets full HTML source. driver.getWindowHandle() Gets window handle of current window. driver.getWindowHandles() Gets handles of all open windows/tabs. driver.close() Closes current window. driver.quit() Quits all windows and ends session. driver.manage().window().maximize() Maximizes the window. driver.manage().window().minimize() Minimizes the window. driver.manage().window().fullscreen() Fullscreen the window. driver.manage().window().setSize(new Dimension(w, h)) Sets custom window size. driver.manage(...

Java programs for interviews,

Java programs for interviews ,  ✅ String-Based Programs Reverse each word in a sentence Check if a string is a palindrome Count vowels and consonants in a string Remove duplicate characters from a string Find the first non-repeated character Check if two strings are anagrams Count frequency of characters in a string Convert string to title case (capitalize first letter) Check for substring without using in-built methods Replace all spaces with hyphens ( - ) ✅ Array-Based Programs Find the largest and smallest number in an array Find duplicate elements in an array Sort an array without using built-in methods Remove duplicates from an array Reverse an array Find the second largest number Count the frequency of each element Merge two arrays Find the common elements between two arrays Rotate an array to the left/right ✅ Number-Based Programs Check if a number is prime Generate Fibonacci series Check if a num...

Small Java project ideas that stick strictly to loops, if-else, methods, and arrays

 Here are some small Java project ideas that stick strictly to loops, if-else, methods, and arrays, without using OOP or collections like ArrayList, HashMap, etc.: --- 1. Student Marks Calculator Features: Input marks for 5 subjects using an array. Calculate total, average, and grade using if-else. Concepts: Arrays, methods, if-else, for loop. --- 2. Simple ATM Simulation Features: Balance check, withdraw, deposit. Use if-else for logic and a loop for repeated menu display. Concepts: Methods, loops, if-else. --- 3. Number Guessing Game Features: Random number (use Math.random()). User tries to guess it with hints (higher/lower). Concepts: Loops, if-else, methods. --- 4. Prime Numbers in Range Features: Input a range and print all prime numbers in it. Concepts: Loops, if-else, methods. --- 5. Simple Calculator Features: Menu for add, subtract, multiply, divide. Call a separate method for each operation. Concepts: Methods, if-else. --- 6. Array Sorting (Bubble Sort) Features: Input a...

Simple Java project themes based on your Step 1: Java Basics – The Foundation

 Here are some simple Java project themes based on your Step 1: Java Basics – The Foundation , without using OOP, Collections, Exception Handling, or File Handling. These projects rely purely on core syntax , arrays , strings , loops , and conditions . ๐Ÿ”น 1. Number Guessing Game User guesses a number generated by the program. Uses if-else , loops , random number generation , and input handling . ๐Ÿ”น 2. Simple Calculator Performs operations: + , - , * , / , % . Uses switch-case and operators. ๐Ÿ”น 3. Grade Calculator User enters marks for 5 subjects. Calculates average and assigns grade using if-else . ๐Ÿ”น 4. Palindrome Checker Checks if a string is the same forwards and backwards. Uses strings , loops , and conditions . ๐Ÿ”น 5. Vowel and Consonant Counter Takes a string input and counts vowels and consonants. ๐Ÿ”น 6. Even or Odd Number Finder Takes a number and checks if it’s even or odd using % . ๐Ÿ”น 7. Multiplication Table Generato...

Mastering XPath in Selenium 4 ๐Ÿš€ – Supported Functions & Axes Explained

 Absolutely! Here's a complete list of XPath functions and axes supported by Selenium 4 (which uses XPath 1.0), with descriptions and examples . ๐ŸŸข XPath Features Supported by Selenium 4 ๐Ÿงญ ALL XPath Axes (13 Total) Axis Name Description ancestor:: All ancestors (parent, grandparent, etc.) of the current node ancestor-or-self:: All ancestors + the current node attribute:: All attributes of the current node (usually @attribute shorthand is used) child:: All direct children of the current node descendant:: All descendants (children, grandchildren, etc.) of the current node descendant-or-self:: All descendants + the current node following:: All nodes after the current node in the document following-sibling:: All sibling nodes after the current one namespace:: All namespace nodes of the current node (rarely used in HTML) parent:: Immediate parent of the current node preceding:: All nodes that come before the current node prece...

๐Ÿงญ Complete Guide to Selenium Locators & Element Finding Strategies

 In Selenium, locating strategies are techniques used to identify web elements on a page so that actions (like click, type, etc.) can be performed on them. Selenium provides multiple locators to interact with HTML elements. Below is a complete list of Selenium locators, with details , HTML examples , and code snippets for each. ๐Ÿ” 1. ID ✅ Best when the element has a unique ID. ๐Ÿ”ง HTML: <input id="username" type="text"> ๐Ÿงช Selenium (Java): driver.findElement(By.id("username")).sendKeys("testuser"); ๐Ÿ” 2. Name ✅ Useful when the element has a unique name attribute. ๐Ÿ”ง HTML: <input name="password" type="password"> ๐Ÿงช Selenium: driver.findElement(By.name("password")).sendKeys("mypassword"); ๐Ÿ” 3. Class Name ⚠️ Use only when class is unique or combined with other locators. ๐Ÿ”ง HTML: <button class="login-button">Login</button> ๐Ÿงช Selenium: driver.findEleme...

10 automation test cases for https://www.saucedemo.com/ (Sauce Demo)

 Here are 10 automation test cases for https://www.saucedemo.com/ (Sauce Demo), each with detailed steps and expected results . These are designed to simulate realistic user scenarios and we would be implemented using tools like Selenium, Cypress, or Playwright later. ๐Ÿ”น Test Case 1: Valid Login Objective : Verify successful login with valid credentials. Steps : Navigate to https://www.saucedemo.com/ Enter Username : standard_user Enter Password : secret_sauce Click the Login button Expected Result : User is redirected to the inventory page ( /inventory.html ) with a list of products displayed. ๐Ÿ”น Test Case 2: Invalid Login Objective : Validate error handling with incorrect credentials. Steps : Navigate to the login page Enter Username : invalid_user Enter Password : wrong_password Click the Login button Expected Result : Error message displayed: "Epic sadface: Username and password do not match any user in this service...

HTML 8 : Full HTML Web Page with All Common Elements

 Full HTML Web Page with All Common Elements ALL major HTML form and page elements typically found in modern web pages. This example includes: Headings Paragraphs Line breaks Horizontal lines Images Links Lists (ordered and unordered) Tables Form elements (text box, password, radio, checkbox, dropdown, textarea, button) Semantic HTML (header, nav, footer, article, section) ๐ŸŒ Full HTML Web Page with All Common Elements <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Complete HTML Web Page Elements</title> </head> <body> <!-- Header --> <header> <h1>Welcome to My HTML Demo Page</h1> <p>This page shows all the basic HTML elements used in a typical website.</p> </header> <!-- Navigation Menu --> <nav> <a href="#home">Home</a> | <a href="#about"...

HTML : 7 : HTML Elements

 HTML Elements ✅ 1. Text Box (Input field) Used to accept user input (like name, email, etc.) <label for="name">Name:</label> <input type="text" id="name" name="name"> Other types: <input type="email"> <input type="password"> <input type="number"> <input type="date"> ✅ 2. Button Used to submit a form, reset it, or trigger JavaScript. <!-- Submit button --> <button type="submit">Submit</button> <!-- Regular clickable button --> <button type="button" onclick="alert('Button clicked!')">Click Me</button> <!-- Reset button --> <button type="reset">Reset</button> ✅ 3. Dropdown / Select Box Used to choose one option from a list. <label for="country">Select your country:</label> <select id="country" name="country...

HTML 6 : ๐ŸŒ How HTML Web Page Hosting Works: Server, Domain, URL & Database Explained

  ๐ŸŒ How HTML Web Page Hosting Works: Server, Domain, URL & Database Explained Creating a website is more than just writing HTML code. Behind every page you see on the internet, there's a network of servers, domain names, and often a database managing content. Let’s break it down step by step. ๐Ÿงพ 1. What is Web Hosting? Web hosting is a service that stores your website’s files (HTML, CSS, JavaScript, images, etc.) on a server , making them accessible on the internet. ๐Ÿ’ก Think of it like this: Your HTML files are like the furniture in a house. A web host (server) is the house. The internet is the road system that connects people to your house. ๐Ÿ–ฅ️ 2. What is a Web Server? A web server is a computer that: Stores website files (HTML, CSS, images, etc.). Responds to requests from browsers. Sends back the right content via HTTP/HTTPS protocols . Example: When you visit https://example.com/about.html , here's what happens: The browser con...

HTML 5 : Understanding HTML for Locating Elements in Selenium

 To help you understand locators in Selenium , it's crucial to grasp more detailed HTML concepts. Selenium uses HTML tags and attributes to find (or "locate") elements on a web page. Below is an expanded article section with HTML knowledge specifically useful for identifying and locating elements in Selenium . ๐Ÿ” Understanding HTML for Locating Elements in Selenium Selenium interacts with web elements using locators , which are based on HTML structure and attributes. Here's what you need to know about HTML to use Selenium effectively: 1. ๐Ÿ†” Using the id Attribute id is a unique identifier for an HTML element — the most preferred locator. <input type="text" id="username"> Selenium Locator Example: driver.findElement(By.id("username")); 2. ๐Ÿ‘จ‍๐Ÿ‘จ‍๐Ÿ‘ง‍๐Ÿ‘ฆ Using the class Attribute class is used to apply styles, and can also be used to locate elements (but it's not unique). <button class="btn login">Log...

HTML 4 : Building a Basic HTML Web Page: Paragraphs, Formatting, Images, Links, and Tables

๐Ÿ“„ Building a Basic HTML Web Page: Paragraphs, Formatting, Images, Links, and Tables Creating a web page with HTML involves combining various elements to structure and display content effectively. Below are the essential features you can add to an HTML page, each explained with code examples. 1. ✅ Adding Paragraphs to the HTML Web Page Paragraphs are added using the <p> tag. <p>This is a paragraph of text on a web page.</p> <p>Here is another paragraph explaining a new topic.</p> 2. ๐Ÿ’ฌ Adding Bold Text Bold text helps highlight important words or phrases. Use the <b> or <strong> tag. <p>This is a <b>bold</b> word.</p> <p>This is also <strong>strongly emphasized</strong> text.</p> 3. ๐Ÿ”  Displaying Headings (H1 to H6) HTML provides six heading levels, from <h1> (largest) to <h6> (smallest). <h1>Main Heading</h1> <h2>Sub Heading</h2> <h3>S...

HTML 3 : HTML Structure

Image
HTML for Selenium (Part 3) – HTML Structure   In the previous posts, we have understood the below HTML basics: > What is HTML? > HTML Elements, Tags, Attributes & Enclosed Text In this article, I am going to explain the structure of HTML. Before I start explaining the structure of HTML, you need to first understand that, almost all tags in HTML have both Start and End Tags. Start Tag: > Syntax: <TagName> > Example: <h1> End Tag: > Syntax: </TagName> > Example: </h1> Both Start and End Tags are used together in HTML as shown below: Example:  <h1>  This is a Bigger Size Heading Text  </h1> In the above example, <h1> is the start tag which starts before the heading text starts and </h1> is the end tag which starts after the heading text. Now, you understood the start and end tags. Let’s move to the structure of HTML. HTML for Selenium – HTML Structure Follow the below steps to understand the...