Testleaf

2025 Top Automation Testing Infosys Interview Questions with Expert Answers from Testleaf for 2 to 5 Years’ Experience

Introduction:

In today’s competitive tech landscape, mastering core concepts in automation testing, software development, and agile methodologies is crucial for any aspiring professional. This document compiles a range of common Infosys interview questions and detailed answers that cover real-world challenges and best practices—from handling dynamic web elements in Selenium and integrating CI/CD pipelines to understanding object-oriented programming concepts and managing defects. Whether you are preparing for your next interview or looking to sharpen your technical skills, these topics not only help you demonstrate your expertise but also deepen your understanding of industry-standard frameworks and tools like TestNG, Maven, Jenkins, and Git. Read on to gain insights into practical solutions and techniques that can set you apart in your next interview.

Q1.What are the challenge’s did you faced in your last project? 

Ans: I initially explained my project and addressed the two major challenges I faced, along with the solutions I implemented. below explained those, 

Dynamic Web Elements Handling in Selenium

              Challenge: The application had dynamic elements where IDs and XPath values kept changing, making it difficult to locate elements. 

Solution: 

  • Used relative XPath and CSS selectors instead of absolute XPath. 
  • Implemented explicit waits (WebDriverWait) to handle synchronization issues. 
  • Used JavaScript Executor for elements that weren’t interactable using Selenium methods. 

CI/CD Integration for Automated Execution 

         Challenge: Running automation scripts manually delayed deployment. 

Solution: 

  • Integrated test scripts with Jenkins for automated execution on code commits. 
  • Configured Maven to generate reports after execution. 

Q2.Explain your framework 

Ans : My Automation Testing Framework (Hybrid Framework using Selenium & TestNG) 

I have worked on a Hybrid Framework, which is a combination of Data-Driven, Keyword-Driven, and Modular Frameworks. It is built using Selenium with Java, TestNG, Maven, and RestAssured for API testing. 

Framework Architecture 

The framework follows a layered approach with the following components:

  •  Test Scripts (Test Layer) → Contains actual test cases written in TestNG.
  • Page Object Model (POM) → Manages WebElements and page interactions.
  • Utility Layer → Contains reusable functions like Excel handling, logging, reporting, etc.
  • Test Data (Data-Driven) → Fetches input data from Excel/CSV/JSON.
  • Configuration (Config Layer) → Stores properties like URLs, browser settings.
  • Reporting & Logging → Uses Extent Reports and Log4j for debugging and tracking.
  • CI/CD Integration → Integrated with Jenkins for continuous execution. 
Tools & Technologies Used 
  • Programming Language: Java
  •  Automation Tool: Selenium WebDriver
  •  Unit Testing Framework: TestNG  
  • Build Tool: Maven
  • Test Execution: Jenkins
  • Reporting: Extent Reports
  • Logging: Log4j  
  • Data Handling: Apache POI (Excel), JSON, Properties files  
  • API Testing: RestAssured  
  • Version Control: Git/GitHub 

Key Features of My Framework 

  • Page Object Model (POM) → Separates test logic from UI locators.
  • Data-Driven Approach → Fetches test data from external sources (Excel/CSV/JSON).
  • Reusable Utility Methods → Methods for browser handling, waits, screenshots, etc.
  • Parallel Execution with TestNG → Runs multiple tests simultaneously.
  • Custom Reporting with Extent Reports → Generates HTML reports with test status.
  • Jenkins Integration → Automates execution on every code commit.

Q3. What stale element reference exception,how can you overcome it?

Ans : A StaleElementReferenceException occurs in Selenium when a WebElement is no longer attached to the DOM (Document Object Model). This typically happens in dynamic web applications where elements are refreshed, updated, or reloaded. 

When Does It Occur? 

  • DOM Updates After Page Refresh: The element reference becomes invalid after a page reload or navigation. 
  • JavaScript Modifications: If the element is updated dynamically via JavaScript, Selenium may lose reference.  
  • Re-rendering of Elements: Some frameworks (like React, Angular) reload elements frequently.  
  • Elements Inside IFrames: If an iframe is refreshed, the referenced elements become stale. 

How to Overcome StaleElementReferenceException? 

  • Use Explicit Waits (ExpectedConditions.refreshed()).
  • Re-locate the element before performing an action.
  • Use a try-catch block for retrying actions.
  • Use JavaScript Executor as a last resort.
  • Re-switch to the iframe if the element is inside one. 

Q4. Explain oops concept and related to your framework 

Ans: Object-Oriented Programming (OOPs) consists of four main pillars:

  • Encapsulation → Used in POM to keep locators private.
  • Abstraction → Hides browser setup logic using base classes.
  • Inheritance → Test classes inherit from BaseTest for common functions.
  • Polymorphism → Method overloading for flexible interactions with elements. 

Encapsulation (Data Hiding & Access Control) 

  • Definition: Encapsulation means wrapping data (variables) and code (methods) together in a class and restricting direct access to them. 
How It’s Used in Selenium Framework?
  •  Page Object Model (POM) follows encapsulation by keeping locators private and providing public getter methods.
  • Prevents direct modification of WebElements outside the class. 

 Abstraction (Hiding Implementation Details) 

  • Definition: Abstraction means exposing only the necessary details while hiding the complex logic. 
How It’s Used in Selenium Framework?
  •  We create Base Classes (e.g., BaseTest, BasePage) that handle browser setup, waits, and common methods, so test cases don’t have to deal with them. 

Inheritance (Code Reusability) 

  • Definition: Inheritance allows one class to acquire properties and methods of another class. 
How It’s Used in Selenium Framework?
  • Test classes inherit from the BaseTest class to use common browser methods.
  • Page classes inherit from a BasePage class to reuse common methods. 

Polymorphism (Method Overloading & Overriding) 

  • Definition: Polymorphism allows multiple methods to have the same name but different behavior. 
How It’s Used in Selenium Framework?
  • Method Overloading: Same method name but different parameters (e.g., handling clicks differently).
  •  Method Overriding: A subclass modifies the behavior of a method inherited from the parent class. 

selenium training in chennai

Q5. Difference between throw and throws ?

Ans: Both throw and throws are used for exception handling, but they have different purposes. 

Feature  throw  throws 
Definition  Used to explicitly throw an exception.  Used to declare exceptions that a method might throw. 
Where It Is Used?  Inside a method or block.  In the method signature. 
Type of Exception  Can throw a single instance of an exception.  Can declare multiple exceptions. 
Follows Which Concept?  Used for creating custom exceptions or propagating exceptions.  Used for exception propagation from a method. 
Keyword Followed By?  Exception object (new ExceptionType).  Exception class name. 
Handling Requirement  Must be handled using try-catch or propagate further.  No immediate handling is required, just informs the caller about possible exceptions. 
  • Use throw when you want to explicitly throw an exception inside a method.
  • Use throws when you want to declare exceptions in a method signature for the caller to handle. 

Q6. Write a snippet for webdriverwait ?

Ans :

WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(5));  wait.until(ExpectedConditions.alertIsPresent()).accept(); 

Q7. Write a snippet for windowhandling ?

Ans :

import org.openqa.selenium.By; 

import org.openqa.selenium.WebDriver; 

import org.openqa.selenium.WebElement; 

import org.openqa.selenium.chrome.ChromeDriver; 

import java.util.Set; 

public class WindowHandlingExample { 

    public static void main(String[] args) { 

        WebDriver driver = new ChromeDriver(); 

        driver.get(“https://example.com”); 

         // Store the main window handle 

        String mainWindow = driver.getWindowHandle(); 

         // Click a link that opens a new window 

        WebElement newTabLink = driver.findElement(By.id(“newTab”)); 

        newTabLink.click(); 

         // Get all open window handles 

        Set<String> allWindows = driver.getWindowHandles(); 

         // Switch to the new window 

        for (String window : allWindows) { 

            if (!window.equals(mainWindow)) { 

                driver.switchTo().window(window); 

                break; 

            } 

        } 

         System.out.println(“Title of new window: ” + driver.getTitle()); 

         // Close the new window and switch back to the main window 

        driver.close(); 

        driver.switchTo().window(mainWindow); 

         driver.quit(); 

    } 

 

Q8. Write a program for palindrome ?

Ans:

import java.util.Scanner; 

public class PalindromeString { 

    public static boolean isPalindrome(String str) { 

        String reversed = new StringBuilder(str).reverse().toString(); 

        return str.equalsIgnoreCase(reversed); 

    } 

     public static void main(String[] args) { 

        Scanner scanner = new Scanner(System.in); 

        System.out.print(“Enter a string: “); 

        String input = scanner.nextLine(); 

             if (isPalindrome(input)) { 

            System.out.println(input + ” is a palindrome.”); 

        } else { 

            System.out.println(input + ” is not a palindrome.”); 

        } 

           scanner.close(); 

    } 

Q9. Explain defect life cycle ?

Ans:  The Defect Life Cycle (also called the Bug Life Cycle) is the process that a defect goes through from discovery to closure. It helps in tracking, managing, and resolving defects efficiently. 

Phases of the Defect Life Cycle 

New: 

  • The defect is identified and logged by a tester in a defect tracking tool (like JIRA, Bugzilla, or ALM). 
  • It includes details like severity, priority, environment, steps to reproduce, screenshots, and logs. 

Assigned: 

  • The defect is assigned to a developer or development lead for further investigation. 

Open: 

  • The developer starts analyzing the defect and tries to reproduce it. 
  • The defect may be:
    1. Accepted – If it is a valid defect, it moves to the “In Progress” phase.
    2. Rejected – If the defect is invalid or works as expected, it is marked as “Rejected”.
    3. Deferred – If the defect is not a priority or planned for a future release, it is deferred. 

In Progress / Fixing: 

  • The developer starts working on fixing the defect. 
  • Once fixed, it is moved to “Fixed” status. 

Fixed: 

  • The developer fixes the defect and updates the status. 

Retest: 

  • The tester verifies the fix by retesting the defect in the same environment. 
  • If it passes, the defect is marked as “Verified”. 

Reopen (if needed): 

  • If the defect is not fixed properly, it is reopened and assigned back to the developer. 

Verified: 

  • If the defect is fixed correctly and no issues are found, it is marked as “Verified”. 

Closed: 

  • Once verified, the defect is closed by the testing team. 

Q10. what is testplan and strategy ?

Ans : Both Test Plan and Test Strategy are crucial documents in software testing, but they serve different purposes.  

  • Test Plan is project-specific, focusing on execution.
  • Test Strategy is a high-level document that guides the testing approach.

What is a Test Plan? 

A Test Plan is a detailed document that outlines how testing will be performed in a specific project. It includes objectives, scope, approach, resources, schedule, and deliverables. 

Key Elements of a Test Plan 
  • Test Plan ID – Unique identifier for the test plan. 
  • Introduction – Overview of the project and test objectives. 
  • Scope – Features to be tested and not tested. 
  • Test Approach – Manual or automation testing strategy. 
  • Test Environment – Hardware, software, network setup. 
  • Test Deliverables – Reports, logs, test cases, automation scripts.
  • Entry & Exit Criteria – When to start and stop testing. 
  • Schedule – Timeline for testing activities. 
  • Risk & Mitigation – Possible risks and how to handle them. 
 Example: 
  • Scope: Login, Registration, Payment, and Checkout modules. 
  • Test Approach: Automation using Selenium with Java for UI testing, Postman for API testing. 
  • Test Environment: Windows 11, Chrome v120, Test Database. 

What is a Test Strategy? 

A Test Strategy is a high-level document that defines the overall testing approach and principles followed across multiple projects in an organization. 

Key Elements of a Test Strategy 
  • Testing Scope – What needs to be tested. 
  • Testing Types – Unit, Integration, System, Performance, Security testing. 
  • Test Levels – Smoke, Sanity, Regression, UAT. 
  • Test Tools – Selenium, JUnit, TestNG, JIRA, Postman, etc. 
  • Defect Management – How defects are logged, tracked, and closed. 
  • Test Metrics & Reporting – How testing progress will be measured. 
  • Automation Strategy – When and what to automate. 
  • Risk Analysis – Identifying risks and mitigation plans. 

Example: 

  • Testing Types: Functional, Performance, Security, UI, API. 
  • Automation Strategy: Automate regression tests using Selenium + TestNG. 
  • Defect Tracking Tool: JIRA. 

 

Online Classes 

Q11. Write a program for character occurance using map? 

Ans:

import java.util.HashMap; 

import java.util.Map; 

import java.util.Scanner; 

public class CharacterOccurrence { 

    public static void countCharacterOccurrences(String str) { 

        Map<Character, Integer> charCountMap = new HashMap<>(); 

         // Convert string to character array and count occurrences 

        for (char ch : str.toCharArray()) { 

            charCountMap.put(ch, charCountMap.getOrDefault(ch, 0) + 1); 

        } 

         // Print character counts 

        System.out.println(“Character Occurrences:”); 

        for (Map.Entry<Character, Integer> entry : charCountMap.entrySet()) { 

            System.out.println(“‘” + entry.getKey() + “‘ : ” + entry.getValue()); 

        } 

    } 

     public static void main(String[] args) { 

        Scanner scanner = new Scanner(System.in); 

        System.out.print(“Enter a string: “); 

        String input = scanner.nextLine(); 

        countCharacterOccurrences(input); 

        scanner.close(); 

    } 

Q12. can you tell some git comments, did you faced any merge conflict, how will you overcome that ?

Ans : Common Git Commands 

Basic Git Commands 

  • git init → Initialize a new Git repository. 
  • git clone <repo_url> → Clone an existing repository. 
  • git status → Check the current status of the working directory. 
  • git add <file> → Stage a file for commit. 
  • git add . → Stage all changes. 
  • git commit -m “Commit message” → Commit staged changes. 
  • git push origin <branch> → Push commits to the remote repository. 
  • git pull origin <branch> → Pull latest changes from the remote repository. 

 Branching and Merging 

  • git branch → List all branches. 
  • git branch <branch_name> → Create a new branch. 
  • git checkout <branch_name> → Switch to another branch. 
  • git checkout -b <branch_name> → Create and switch to a new branch.
  • git merge <branch_name> → Merge another branch into the current branch. 

 Handling Merge Conflicts 

  • Have I Faced a Merge Conflict?  : Yes! Merge conflicts occur when multiple developers modify the same file in different branches, and Git cannot decide which changes to keep. 
How to Overcome Merge Conflicts? 
  • Scenario: I was working on the “login feature”, and another developer modified the same file. When I tried to merge, Git showed a merge conflict. 
Steps to Resolve Merge Conflict 
  • Identify the conflicted files using:  git status 
  • Open the file, and you will see conflict markers:  <<<<<<< HEAD My changes (from my branch) ======= Other developer’s changes (from merged branch) >>>>>>> feature-branch 
  • Manually edit the file to keep the correct version. 
  • Mark the conflict as resolved by adding the file:  git add <file>
  • Commit the resolved changes:  git commit -m “Resolved merge conflict in <file>” 
  • Push the changes: git push origin <branch> 
Undo & Reset 
  • git checkout — <file> → Discard changes in a file. 
  • git reset –hard HEAD → Reset to the last committed state. 
  • git revert <commit_hash> → Undo a specific commit but keep history.
  • git stash → Temporarily save changes without committing. 

Q13. How to raise defect in jira , explain that flow ?

 Ans

Steps to Raise a Defect in JIRA 

Login to JIRA 
  • Open JIRA URL in a web browser (e.g., https://yourcompany.atlassian.net). 
  • Enter your username/email and password to log in. 
 Navigate to the Project 
  • Select the project where you want to log the defect. 
  • Click on “Create” (usually at the top navigation bar). 
Fill in the Bug Details 
  • When the Create Issue form appears, fill in the required details: 
Field  Description  Example 
Project  Select the project where the defect belongs.  E-commerce Website 
Issue Type  Choose Bug (since it’s a defect).  Bug 
Summary  A short, clear title of the defect.  Login button not working in Chrome 
Description  Detailed explanation of the issue.  Steps to reproduce, Expected vs Actual Results 
Priority  Define the severity of the defect.  Critical / High / Medium / Low 
Environment  Mention browser, OS, or device details.  Chrome v120, Windows 11 
Assignee  Assign to a developer or leave as Unassigned.  John Doe (Developer) 
Attachments  Upload screenshots, logs, or videos (if applicable).  Screenshot of error message 
Labels  Tags to help in searching/filtering.  Login, UI-Bug 
 Click “Create” 
  • After filling in all the details, click “Create” to log the defect in JIRA. 

 Defect Life Cycle in JIRA: 

      Once a defect is logged, it follows a lifecycle: 

  • Open → Tester logs the defect.
  • Assigned → Developer is assigned to fix it.
  • In Progress → Developer starts working on the fix.
  •  Fixed → Developer resolves the issue and marks it as “Fixed.”
  • Ready for Retest → Tester verifies the fix.
  • Reopened → If the issue still exists, it is reopened.
  • Closed → If the defect is fixed successfully, it is marked as Closed. 

Example Scenario: You are testing a login page, and after entering valid credentials, clicking the login button does nothing. 

Defect Logged in JIRA: 

  • Summary: Login button unresponsive on Chrome v120. 
  • Description: 
  • Steps to Reproduce: 
    • Open the website in Chrome.
    • Enter valid credentials. 
    • Click the “Login” button. 
  • Expected Result: User should be redirected to the homepage. 
  • Actual Result: Nothing happens, and no error message is displayed.

Q14. How to schedule the pipeline in jenkins?

Ans :  Jenkins provides multiple ways to schedule a pipeline job, such as cron expressions, build triggers, and polling SCM. Below are the different methods you can use to schedule a pipeline in Jenkins. 

Using Cron Expression (Build Periodically)  Jenkins allows you to schedule jobs using cron syntax. 

Steps to Schedule a Pipeline Job 
  • Open Jenkins Dashboard. 
  • Go to your Pipeline Job. 
  • Click “Configure”. 
  • Scroll to “Build Triggers” section. 
  • Check “Build periodically”.
  • Enter a cron expression in the schedule field. 
  • Click “Save”. 
Cron Expression Examples 
Cron Expression  Execution Frequency 
H/15 * * * *  Every 15 minutes 
0 * * * *  Every hour 
0 9 * * *  Every day at 9 AM 
0 12 * * 1-5  Every weekday (Mon-Fri) at 12 PM 
0 2 1 * *  On the 1st of every month at 2 AM 

 Using SCM Polling (Poll SCM) 

This method schedules builds based on changes in Git or other source control systems. 

Steps to Enable Poll SCM 
  • Open Jenkins Dashboard. 
  • Go to your Pipeline Job. 
  • Click “Configure”. 
  • Scroll to “Build Triggers”. 
  • Check “Poll SCM”. 
  • Enter a cron expression (e.g., H/5 * * * * to check for updates every 5 minutes). 
  • Click “Save”. 

💡 Note: This method only triggers a build if there are changes in the repository. 

 Using a Scripted Pipeline 

If you’re using a Jenkinsfile, you can schedule builds inside your script. 

Example of Scheduling Inside a Declarative Pipeline 

pipeline { 

    triggers { 

        cron(‘H 12 * * 1-5’) // Runs every weekday at 12 PM 

    } 

    agent any 

    stages { 

        stage(‘Build’) { 

            steps { 

                echo ‘Building…’ 

            } 

        } 

    } 

 Using Parameterized Scheduler Plugin 

If you need dynamic scheduling, you can use the Parameterized Scheduler Plugin. 

Steps to Use Parameterized Scheduler 
  • Install the Parameterized Scheduler Plugin from Jenkins Plugin Manager. 
  • Open Jenkins Job > Configure. 
  • Under “Build Triggers”, select “Parameterized Scheduler”. 
  • Define parameters like TIME=0 18 * * * (Runs daily at 6 PM). 
  • Click “Save”. 

 Conclusion :

For fixed time schedules → Use Build Periodically (Cron Expressions).
For Git-based triggers → Use Poll SCM.
For Jenkinsfiles → Use cron inside a declarative pipeline.
For dynamic scheduling → Use Parameterized Scheduler Plugin.

Affordable fees

 Q15. If you are facing lot of bugs while deployment how will address it?

Ans : When encountering a high number of bugs during deployment, it’s crucial to take a structured approach to identify, analyze, and resolve issues efficiently. Here’s how you can address and minimize bugs during deployment: 

1. Immediate Actions (During Deployment) 

Stop Deployment (If Critical Bugs Exist) 
  • If there are showstopper or high-severity defects, halt the deployment immediately.
  • Roll back to the last stable version if needed. 
Categorize the Bugs 
  • Prioritize defects based on Severity & Priority: 
  • Critical – Fix immediately before proceeding. 
  • High – Address before moving to production. 
  • Medium – Can be patched post-deployment if needed. 
  • Low – Minor issues; schedule fixes in future releases. 
Check Logs & Debug Information 
  • Analyze server logs, application logs, and Jenkins logs for error traces.
  • Check database & API connectivity issues. 
Test in Staging Before Proceeding 
  • Run a quick sanity test on staging/UAT before proceeding further. 
  • If needed, revert to the previous stable release. 

 2. Root Cause Analysis (After Identifying Bugs) 

Analyze the Source of Bugs 
  • Are they due to new code changes or environment issues? 
  • Use JIRA/Git history to check recent commits. 
  • Identify patterns – Are most bugs UI, API, database-related? 
Check for Regression Issues 
  • Verify if previously working features broke due to new changes. 
  • Run automated regression tests to confirm. 
Review Code Changes & Deployment Process 
  • Conduct a code review to find problematic commits. 
  • Check CI/CD pipelines for misconfigurations. 

 3. Preventive Measures for Future Deployments 

Enhance Automated Testing 
  • Implement unit tests, integration tests, and regression tests. 
  • Increase test coverage with Selenium for UI & API automation. 
Use Canary or Blue-Green Deployments 
  • Deploy new changes to a small set of users first before full deployment. 
  • If issues arise, rollback without impacting all users. 
Improve Logging & Monitoring 
  • Implement real-time monitoring with tools like ELK Stack, Datadog, or Splunk. 
  • Set up alert notifications in case of deployment failures. 
Conduct Post-Deployment Review 
  • Hold a retrospective meeting to discuss what went wrong and improve the next release cycle. 
Conclusion 
  • During deployment: Stop if critical, analyze logs, and categorize defects.
  • After deployment: Perform root cause analysis, check regressions, and improve testing.
  • For future releases: Strengthen automation testing, monitoring, and deployment strategies. 

Q16. Write syntax for webdriverwait,implicitlywait,Fluentwait ?

Ans :

1. Implicit Wait (Global Wait) 

Implicit Wait applies globally and waits for a specified time before throwing NoSuchElementException. 

java 

import org.openqa.selenium.WebDriver; 

import org.openqa.selenium.chrome.ChromeDriver; 

import java.time.Duration; 

public class ImplicitWaitExample { 

    public static void main(String[] args) { 

        WebDriver driver = new ChromeDriver(); 

        driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(10)); // Waits up to 10 sec 

        driver.get(“https://example.com”); 

        driver.quit(); 

    } 

Explanation 
  •  This wait is applied globally for all elements.
  • If an element is not found immediately, it keeps checking until the timeout expires. 

2. Explicit Wait (WebDriverWait) 

WebDriverWait is used to wait for a specific condition before proceeding. 

java 

import org.openqa.selenium.WebDriver; 

import org.openqa.selenium.WebElement; 

import org.openqa.selenium.By; 

import org.openqa.selenium.chrome.ChromeDriver; 

import org.openqa.selenium.support.ui.ExpectedConditions; 

import org.openqa.selenium.support.ui.WebDriverWait; 

import java.time.Duration; 

public class ExplicitWaitExample { 

    public static void main(String[] args) { 

        WebDriver driver = new ChromeDriver(); 

        driver.get(“https://example.com”); 

        WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(10)); 

        WebElement element = wait.until(ExpectedConditions.visibilityOfElementLocated(By.id(“submitBtn”))); 

        element.click(); 

        driver.quit(); 

    } 

Explanation 

  • Waits for a specific condition (e.g., element to be visible).
  • Helps when dealing with dynamic elements.
  • More efficient than Implicit Wait as it waits only when necessary. 

 3. Fluent Wait (More Flexible) 

Fluent Wait allows polling intervals and ignoring exceptions. 

java 

import org.openqa.selenium.WebDriver; 

import org.openqa.selenium.WebElement; 

import org.openqa.selenium.By; 

import org.openqa.selenium.chrome.ChromeDriver; 

import org.openqa.selenium.support.ui.FluentWait; 

import java.time.Duration; 

import java.util.function.Function; 

public class FluentWaitExample { 

    public static void main(String[] args) { 

        WebDriver driver = new ChromeDriver(); 

        driver.get(“https://example.com”); 

        FluentWait<WebDriver> wait = new FluentWait<>(driver) 

            .withTimeout(Duration.ofSeconds(20))  // Maximum wait time 

            .pollingEvery(Duration.ofSeconds(2))  // Checks every 2 seconds 

            .ignoring(Exception.class);        // Ignores exceptions like NoSuchElementException 

        WebElement element = wait.until(new Function<WebDriver, WebElement>() { 

            public WebElement apply(WebDriver driver) { 

                return driver.findElement(By.id(“submitBtn”)); 

            } 

        }); 

        element.click(); 

        driver.quit(); 

    } 

Explanation 

  • Fluent Wait is more advanced – You can set a polling frequency.
  • Useful for dynamic elements that appear after an unpredictable delay.
  • Handles exceptions like NoSuchElementException automatically.

Q17. Agile ceremonies?

Agile Ceremonies in Scrum 

Agile follows an iterative approach to software development, and Scrum defines five key ceremonies (meetings) to enhance collaboration, transparency, and delivery efficiency. 

1. Sprint Planning 

Purpose: Plan the work to be completed in the upcoming sprint.
Who Attends: Scrum Master, Product Owner, Development Team.
Duration: ~2 hours per week of Sprint (e.g., 4 hours for a 2-week sprint). 

Activities in Sprint Planning 
  • Product Owner prioritizes the Product Backlog.
  • Development Team selects User Stories for the sprint.
  • Define the Sprint Goal. 
  • Break stories into tasks (optional). 
  • Define the Definition of Done (DoD). 

Example 

Suppose a team is developing an e-commerce website. In Sprint Planning, they might select:

  • Implement Login functionality
  • Develop Cart feature
  • Integrate Payment Gateway 

2. Daily Stand-up (Daily Scrum) 

Purpose: A short, time-boxed meeting to update progress and identify blockers.
Who Attends: Scrum Team (Scrum Master, Developers, QA, etc.).
Duration: 15 minutes (same time, same place). 

Three Key Questions in Daily Stand-up 
  • What did I do yesterday?
  • What will I do today?
  • Are there any blockers? 

Example 

Developer: “Yesterday, I completed the login API. Today, I will work on UI integration. No blockers.”
Tester: “I tested the checkout flow. I found a bug in the payment process. Need help from Dev.” 

 3. Sprint Review (Demo Day) 

Purpose: Showcase the completed work to stakeholders & gather feedback.
Who Attends: Scrum Team, Product Owner, Stakeholders, Business Team.
Duration: 1-2 hours at the end of the sprint. 

Activities in Sprint Review 
  • Team demonstrates completed user stories.
  • Product Owner validates acceptance criteria. 
  • Stakeholders provide feedback for improvement.
  • Any unfinished work goes back to the Product Backlog. 

Example: 

Team Demoing a Feature: “We have implemented the cart functionality. Users can now add, remove, and update items.”
Stakeholder Feedback: “Can we add a ‘Save for Later’ button?” 

 4. Sprint Retrospective (Retro) 

Purpose: Inspect the last sprint and improve processes for the next one.
Who Attends: Scrum Team (No stakeholders).
Duration: 1 hour after Sprint Review. 

What Happens in a Retro? 
  • What went well? 
  • What didn’t go well? 
  • What can we improve? 

Example 

Good: “Collaboration between Dev & QA improved.”
Bad: “We had too many unplanned tasks.”
Action Item: “Define clear sprint scope to reduce last-minute work.” 

5. Product Backlog Refinement (Grooming) 

Purpose: Continuously improve & refine the backlog for future sprints.
Who Attends: Product Owner, Scrum Master, Developers.
Duration: 1-2 hours per sprint (usually mid-sprint). 

Activities in Backlog Grooming 
  • Prioritize & estimate backlog items. 
  • Break down large stories into smaller, manageable ones. 
  • Remove outdated or unnecessary tasks. 

Example 

Before Grooming: “Develop Payment Module”

After Grooming:

  • “Create Payment API”
  • “Design UI for Payment Page”
  • “IntegrateRazor pay with Checkout” 

Conclusion: 

Preparing for an interview at a company like Infosys means having a solid grasp of both theoretical knowledge and hands-on experience with modern automation testing practices and agile processes. This document has explored everything from the challenges of dynamic element handling and CI/CD integration to the nuances of exception management, OOP principles in framework design, and even agile ceremonies. By understanding these key areas, you can confidently tackle real-world problems, optimize your testing strategies, and articulate your technical skills effectively during interviews. Use these insights as a springboard to refine your approach, continue learning, and ultimately excel in your professional journey. Good luck, and happy coding! 

Also Read: https://blog.testleaf.com/capgemini-interview-guide-questions-and-tips-to-ace-interview/ 

Also Read: https://blog.testleaf.com/selenium-accenture-interview-questions/ 

Also Read: https://blog.testleaf.com/top-20-interview-questions-in-software-testing/ 

Also Read: https://blog.testleaf.com/top-framework-interview-questions/ 

Author’s Bio:

As CEO of TestLeaf, I’m dedicated to transforming software testing by empowering individuals with real-world skills and advanced technology. With 24+ years in software engineering, I lead our mission to shape local talent into global software professionals. Join us in redefining the future of test engineering and making a lasting impact in the tech world.

Babu Manickam
CEO – Testleaf

                                                                         LinkedIn Logo

 

Accelerate Your Salary with Expert-Level Selenium Training

X