
What is the purpose of the static keyword in Java.
The static keyword in Java is used to define members that belong to the class rather than any instance. A static variable is shared across all instances of a class, and a static method can be called without creating an object. It's useful for utility methods, constants, or shared data.
static keyword is shared and class member
For example, Math.max() is a static method because it doesn't require an object to be use
Where static Can Be Used:
Use Case | Description |
| Shared by all instances of a class (also called class variables). |
| Can be called without creating an object of the class. |
| Executes once when the class is loaded (used for static initialization). |
| Inner classes can be declared static (called static nested classes). |
Examples:
1. Static Variable
2. Static Method
3. Static Block
What does the term "Velocity" refer to in Agile Testing?
What is Velocity in Agile Testing?
- Velocity refers to the amount of work a team completes during a sprint.
- It's usually measured in story points, hours, or number of user stories.
- It helps predict how much work the team can handle in future sprints.
How is Velocity Calculated?
At the end of each sprint:
For example, if your team completes 5 user stories totaling 30 story points in a 2-week sprint, the velocity is 30.
In Agile Testing, velocity refers to the number of story points or work items a team completes in a sprint. It helps gauge the team’s performance and is used to forecast how much work can be taken on in future sprints. For example, if we consistently complete around 25–30 story points per sprint, that becomes our average velocity and guides our planning.
What does the following statement mean
WebDriver driver = new FirefoxDriver();
Explanation of
WebDriveris an interface in Selenium that defines the methods for browser automation (likeget(),findElement(),click(), etc.).driveris the reference variable of typeWebDriver.new FirefoxDriver()creates an instance of the Firefox browser driver (the concrete class that implements theWebDriverinterface specifically for Firefox).- This line essentially launches a new Firefox browser window controlled by Selenium.
Why use this?
- By coding to the
WebDriverinterface, you can easily switch browsers by just changing the instantiation part (new ChromeDriver(),new EdgeDriver(), etc.) without changing the rest of your test code. - This promotes code flexibility and reusability.
Could you explain the difference between getWindowHandle() and getWindowHandles() in Selenium?
getWindowHandle()
- Returns a String representing the unique identifier (handle) of the current browser window that the WebDriver is controlling.
- Use this when you want to keep track of or switch back to the current window.
- Example use: Saving the parent window handle before opening a new window.
getWindowHandles()
- Returns a Set<String> containing the handles of all open browser windows/tabs initiated by the WebDriver session.
- Use this to get all available windows so you can switch between them.
- Helpful when a new window or tab opens, and you need to identify and switch to it.
Method | Returns | Use Case |
| String (current window) | Store or switch back to the current window |
| Set (all windows) | Iterate and switch between multiple windows |
getWindowHandle() returns the unique handle of the current window the driver is focused on, which is useful to store so you can switch back to it later. getWindowHandles() returns a set of all window handles opened by the WebDriver, allowing you to iterate through them and switch between multiple windows or tabs.
Could you write a Selenium snippet for performing below actions
Handling a child window,Performing operationsSwitching back to the parent window
Approach of the program:
getWindowHandle()returns the current window’s unique ID.getWindowHandles()returns a set of all open window handles.- We switch to the window handle that is not the parent to get the child window.
- After operations, we close the child window (optional) and switch back to the parent window.
What does the super() keyword do in Java?
What does super() do?
super() is used to call the constructor of the parent (super) class.
It allows a subclass to initialize the inherited fields or behavior by invoking the parent class constructor.
It must be the first statement in the subclass constructor if used.
If you don’t explicitly call super(), Java automatically inserts a no-argument call to the parent’s constructor.
Why use super()?
- To reuse the parent class constructor code.
- To ensure the parent class is properly initialized before the subclass adds its own initialization.
Example:
super() is a keyword in Java used to call the constructor of the parent class from the subclass constructor.
This allows the subclass to initialize the parent class before executing its own constructor logic.
It helps in code reuse and ensures proper object initialization in inheritance hierarchies.
Could you provide an example of a High Priority but Low Severity Bug?
Imagine your web application has a typo in the company logo text on the homepage.
- The typo does not affect functionality at all (so technically, the bug has low severity).
- However, since this page is visible to all users and affects the company’s brand image, the product owner wants it fixed immediately to avoid a bad impression — so it has high priority.
How would you define the Severity and Priority of a Bug?
What is Severity?
Severity refers to the impact of the bug on the system or application.
It indicates how serious the bug is from a technical perspective.
Usually assigned by testers or developers.
Example:
Severity Level | Description |
Critical | Crash or data loss, app unusable |
Major | Major functionality broken |
Minor | Minor impact, non-blocking bugs |
Trivial | Cosmetic issues, typos, UI glitches |
What is Priority?
Priority indicates how soon the bug should be fixed.
It’s a business decision, usually set by the product owner or manager.
Priority is about the order of fixing bugs based on business needs.
Example:
Priority Level | Description |
High | Must fix immediately |
Medium | Fix in upcoming releases |
Low | Can be fixed later |
Severity defines how badly a bug affects the application’s functionality or system, for example, a crash or data loss would be critical severity. Priority, on the other hand, indicates how quickly the bug should be fixed based on business needs. A cosmetic bug may have low severity but could have high priority if it affects customer perception. Severity is usually assigned by testers or developers, while priority is decided by product owners or project managers.
What is the Action class in Selenium, and could you mention a few of its methods?
What is the Actions Class?
- It’s a class provided by Selenium WebDriver for building a sequence of actions like drag-and-drop, mouse hover, right-click, double-click, and keyboard key presses.
- It helps automate advanced user gestures in web applications.
How to Use Actions Class:
You first create an Actions object and then build a chain of actions which can be performed together.
Commonly Used Methods in Actions Class:
Method | Description |
| Moves the mouse to the middle of the element (mouse hover) |
| Clicks at the current mouse location |
| Clicks on a specific element |
| Performs right-click |
| Performs double-click |
| Drags an element and drops it onto another element |
| Sends keyboard keys to the active element |
| Presses a keyboard key without releasing it |
| Releases a pressed keyboard key |
The Actions class in Selenium is used for performing advanced user interactions like mouse hover, drag and drop, right-click, and keyboard events which are not possible with regular WebDriver methods.
For example, to perform a mouse hover, we use moveToElement(), or to drag and drop elements, we use dragAndDrop(source, target). These actions are built as a sequence and executed using build().perform().
What are the advantages and disadvantages of using Automation Frameworks?
Automation frameworks offer significant advantages by providing a structured and reusable foundation for writing test scripts, which improves consistency, maintainability, and scalability of automated tests. They help teams achieve faster test execution, better coverage, and easier integration with CI/CD pipelines, ultimately accelerating the software delivery process. Frameworks also promote standard coding practices, enhance collaboration among testers and developers, and often come with built-in reporting and logging features that simplify defect tracking and debugging.
However, automation frameworks also have drawbacks, including the initial setup cost and the time required to design and implement them properly. They can introduce complexity, especially if over-engineered or not tailored to the project’s needs, making them harder for new team members to learn. Additionally, maintaining the framework alongside evolving applications may require continuous effort, and if the application under test changes frequently, it can lead to fragile scripts and higher maintenance overhead.
What factors should be considered when selecting an automation tool?
When selecting an automation tool, I consider several factors. First, the tool must support the type of application we’re testing — whether web, mobile, or desktop. It should be compatible with our technology stack and easy for the team to learn and use. Integration with CI/CD pipelines like Jenkins and test management tools like JIRA is also important for smooth workflows.
Additionally, cross-browser and cross-platform support ensures our tests cover all user environments. Maintenance ease and scalability matter since our application evolves frequently. Cost is also a factor — open-source tools like Selenium are popular for their zero licensing cost.
Finally, good reporting features, community support, and performance help ensure reliable and efficient automation.
What is an Abstract Class and an Abstract Method?
1. What is an Abstract Class?
An abstract class is a class that cannot be instantiated on its own — it’s meant to be inherited by other classes. It can contain:
- Abstract methods (no body — just declared)
- Concrete methods (with full implementation)
Purpose: To define a common base for other classes with shared behavior, while leaving some details to be defined in child classes.
Example in Java:
2. What is an Abstract Method?
An abstract method is a method that:
- Has no body (just a signature).
- Must be implemented in a subclass.
Only abstract classes can contain abstract methods.
Then, in a subclass:
An abstract class in Java is a class that can’t be instantiated and may contain both abstract and non-abstract methods. Abstract methods are declared without a body and must be implemented by the subclass.
In automation frameworks, we often use an abstract base class to define common setup or teardown logic, and leave methods like runTest() abstract.
That way, child classes implement their specific test logic, promoting reusability and structure.

