🚀 Day 21 of My 45-Day Selenium Challenge! Today, we’re diving into something super powerful in TestNG — Listeners 🎧 Yes, the silent observers that can completely change how you handle events in your test suite! 🔍 What are Listeners in TestNG? Listeners in TestNG are used to listen to events occurring during the test execution lifecycle — like test start, success, failure, or skip — and allow you to hook custom logic accordingly. 📌 Some Key Listener Interfaces: ✅ ITestListener – Ideal for logging, taking screenshots on failure, reporting ✅ ISuiteListener – Works at suite level, useful for setup/teardown logic ✅ IInvokedMethodListener – Used to intercept before/after a method is invoked 💡 You can use them for: Generating custom reports Capturing screenshots on failure Logging test start and end times Sending notifications and much more! 📓 I’ve also attached my handwritten notes and example code snippets to help visualize the concept better. 💬 Let’s discuss: Have you implemented Listeners in your framework yet? What’s your favorite use case for them? #Selenium #TestNG #AutomationTesting #Java #SoftwareTesting #Listeners #SDET #LearningInPublic #45DayChallenge #TestAutomation #RahulShetty #LinkedInTech
How to use Listeners in TestNG for Selenium
More Relevant Posts
-
🚀 Day 20: TestNG Basics in Selenium Today I explored TestNG, one of the most powerful frameworks for Selenium automation! 💻 It helps us: ✅ Structure test cases ✅ Run tests in parallel ✅ Prioritize test execution ✅ Generate detailed HTML reports 🧩 Common Annotations: A. @BeforeMethod & @AfterMethod – Setup and teardown B. @Test – Marks a test case C. @BeforeClass / @AfterClass – Execute once per class 💡 Example: @Test public void testLogin() { System.out.println("Login Test Executed"); } TestNG makes automation organized, faster, and more efficient! ⚡ #Day20 #100DaysOfTesting #Selenium #TestNG #AutomationTesting #Java #QALearning #TestingCommunity #SoftwareTesting #LearnSelenium #AutomationEngineer #QATraining #ManualToAutomation #SDET #TestAutomation #QualityAssurance #CodingInJava #TestingTools #CareerInTesting #TechJourney #TestersLife #SoftwareQuality #AutomationFramework #BugHunter #TestingWorld
To view or add a comment, sign in
-
🚀 Excited to Share My Selenium Automation Demo! 🐍💻 I’ve been working on enhancing my QA Automation skills using Selenium with Python, and I just completed a full automation test for the Sauce Demo website. In this demo video, you’ll see Selenium in action: ✅ Automating login ✅ Adding products to cart ✅ Checkout process automation ✅ End-to-end browser interaction This was a great hands-on practice project to strengthen my automation workflow and improve my understanding of real-world test scenarios. 💻 You can also check out the complete source code on my GitHub repo: 🔗 Link: https://lnkd.in/dAbNyWwJ I’m continuously learning and building more automation scenarios — next up, I’ll be diving deeper into advanced Selenium features and test frameworks. #Selenium #Python #Automation #QA #SoftwareTesting #GitHub #LearningJourney
To view or add a comment, sign in
-
🚀 Day 14 of Learning: Handling Broken Links in Selenium! Today, I explored how to identify and handle broken links in Selenium, and it was really insightful! 💻 🔹 What I learned: A broken link is a hyperlink that leads to a non-existent page or returns an error (like 404, 500, etc.) when clicked. Types of broken links: 1. Client-side broken links – Usually due to wrong URLs in HTML (404 Not Found). 2. Server-side broken links – When the server fails or returns errors (500 Internal Server Error). 🔹 How to handle them in Selenium: 1. Use Selenium to find all links on a web page: List<WebElement> links = driver.findElements(By.tagName("a")); 2. Loop through each link and get its URL: String url = link.getAttribute("href"); 3. Open a connection and check the HTTP response code: HttpURLConnection conn = (HttpURLConnection) new URL(url).openConnection(); conn.setRequestMethod("HEAD"); conn.connect(); int respCode = conn.getResponseCode(); if(respCode >= 400){ System.out.println(url + " is broken"); } else { System.out.println(url + " is valid"); } ✅ This helps automate the detection of broken links across your website and ensures a smooth user experience! 💡 Key takeaway: Automation isn’t just about testing functionalities—it’s also about improving website quality and user trust! #Selenium #AutomationTesting #QALearning #BrokenLinks #WebTesting #Java #SeleniumWebDriver #ContinuousLearning
To view or add a comment, sign in
-
-
🚀 Day 28: Synchronization in Selenium (Waits) 🚀 Today, I explored one of the most important topics in Selenium — Synchronization 🕒 Synchronization ensures that our test scripts wait for web elements to load properly before performing any action. Without it, automation scripts may fail due to timing issues. 🔹 Types of Waits in Selenium: 1️⃣ Implicit Wait: Sets a default wait time for all elements. driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(10)); 2️⃣ Explicit Wait: Waits for specific conditions like visibility, clickability, etc. WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(15)); wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("submitBtn"))); 3️⃣ Fluent Wait: Used for dynamic conditions with polling frequency. Wait<WebDriver> wait = new FluentWait<>(driver) .withTimeout(Duration.ofSeconds(20)) .pollingEvery(Duration.ofSeconds(2)) .ignoring(NoSuchElementException.class); 🌟 Key Takeaway: Effective synchronization ensures stable and reliable test execution by handling dynamic page loads smartly. #Day28 #100DaysOfTesting #Selenium #AutomationTesting #Synchronization #WaitsInSelenium #ExplicitWait #ImplicitWait #FluentWait #SeleniumWebDriver #TestingCommunity #Java #QATraining #SoftwareTesting #LearnSelenium #AutomationEngineer #ManualToAutomation #TestAutomation #QualityAssurance #TestingTools #SDET #TestingJourney #TechLearning
To view or add a comment, sign in
-
-
Important facts to know about Selenium! Selenium WebDriver: Control browsers with code—click, type, navigate, and simulate user actions. Selenium IDE: Record actions and generate test scripts automatically—perfect for beginners. Selenium Grid: Run tests on multiple browsers and systems for true cross-browser coverage. Supports Multiple Languages: Compatible with Python, Java, C#, Ruby, and JavaScript. Integrates with Frameworks: Works seamlessly with pytest, JUnit, TestNG, and more for robust testing workflows. Curious to see how Selenium can fit into your automation toolkit? Explore, experiment, and level up your browser automation! 🚀 #Selenium #Automation #WebTesting #CrossBrowserTesting #TechTools
To view or add a comment, sign in
-
📘 Selenium Day 2 — Understanding WebDriver! Today I explored how Selenium actually connects with browsers and executes our automation scripts 🔄 ✨ Key Learnings: 🔹 Selenium WebDriver is an interface 🔹 Each browser has its own driver (like ChromeDriver, GeckoDriver). 🔹 Selenium 4+, no more System.setProperty() hassles! 🔹 driver.get() vs driver.navigate().to() 🔹 driver.close(), driver.quit() 🧩 Code Example: 💡 Troubleshooting tip Next up — Selenium Locators 🔍 Stay tuned for Day 3! #Selenium #AutomationTesting #LearningJourney #Java #WebDriver #TestAutomation #SDET
To view or add a comment, sign in
-
🚫 Stop using Thread.sleep() in Selenium! It looks simple, but it’s actually one of the most common mistakes that makes your test scripts slow and unstable. Instead, use WebDriverWait — it’s smarter, faster, and waits only as long as needed. Here’s the better way 👇 WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(10)); wait.until(ExpectedConditions.visibilityOf(element)); > ✅ Faster > ✅ More reliable > ✅ Industry best practice > > If you’re still using `Thread.sleep()`, it’s time to upgrade your skills 💪 > > What’s your favorite Selenium optimization trick? Comment below 👇 > > #selenium #automationtesting #softwaretesting #qaengineer #java #testingtips #testautomation
To view or add a comment, sign in
-
🚀 Mastering Selenium Waits: Explicit vs Fluent Wait — Real-Time Examples! Synchronization is one of the most important (and tricky) parts of Selenium automation. Today, I worked on two practical scenarios 👇 ✅ Login & Checkout Flow – handled with Explicit Wait (WebDriverWait) ✅ Dynamic Loading Page – handled with Fluent Wait for visibility conditions Both approaches show how to deal with elements that appear dynamically after an action — like delayed page loads or async UI updates. 🧠 Key takeaway: Choosing the right wait strategy improves both stability and speed of automation tests. #Selenium #AutomationTesting #Java #Testing #QA #ExplicitWait #FluentWait #WebDriver #TestAutomation #SoftwareTesting #LearningJourney
To view or add a comment, sign in
-
🚀 Mastering Selenium Waits: Explicit vs Fluent Wait — Real-Time Examples! Synchronization is one of the most important (and tricky) parts of Selenium automation. Today, I worked on two practical scenarios 👇 ✅ Login & Checkout Flow – handled with Explicit Wait (WebDriverWait) ✅ Dynamic Loading Page – handled with Fluent Wait for visibility conditions Both approaches show how to deal with elements that appear dynamically after an action — like delayed page loads or async UI updates. 🧠 Key takeaway: Choosing the right wait strategy improves both stability and speed of automation tests. #Selenium #AutomationTesting #Java #Testing #QA #ExplicitWait #FluentWait #WebDriver #TestAutomation #SoftwareTesting #LearningJourney
To view or add a comment, sign in
-
🚀 Mastering Selenium Waits: Explicit vs Fluent Wait — Real-Time Examples! Synchronization is one of the most important (and tricky) parts of Selenium automation. Today, I worked on two practical scenarios 👇 ✅ Login & Checkout Flow – handled with Explicit Wait (WebDriverWait) ✅ Dynamic Loading Page – handled with Fluent Wait for visibility conditions Both approaches show how to deal with elements that appear dynamically after an action — like delayed page loads or async UI updates. 🧠 Key takeaway: Choosing the right wait strategy improves both stability and speed of automation tests. #Selenium #AutomationTesting #Java #Testing #QA #ExplicitWait #FluentWait #WebDriver #TestAutomation #SoftwareTesting #LearningJourney
To view or add a comment, sign in
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development
Helpful