QA WBA 2 Sprint Summary

Modified on Mon, 24 Jul, 2023 at 10:34 AM

Index:

  1. Tracking tools

  2. Synchronization and alerts

  3. Windows and screenshots




Topic 1: Tracking tools


Defect Tracking & Tools



Defect Tracking Tool



What is it?

A defect tracking tool is a software application that records, manages, and tracks software defects to help in planning, reporting, and managing work.



Need for a Defect Tracking Tool

A defect tracking tool is essential to manage and maintain records of issues/bugs identified during the testing process. It aids in prioritizing bug fixing based on severity, assigning responsibility for resolution, tracking bug status, and producing statistical data for project evaluation.



Features of a Defect Tracking Tool



  • Reporting and logging of defects

  • Ability to assign and prioritize defects

  • Workflow to track the status of defects

  • Notification mechanism for updating stakeholders about defect status

  • Reports and statistical data for analysis

  • Integration with other software like version control and test management tools


Different Defect Tracking Tools in the Market



  • Bugzilla

  • Jira

  • MantisBT

  • Redmine

  • Trac


Introduction to Bugzilla

Bugzilla is a widely used defect tracking tool that is web-based and open-source. It allows individual or groups of developers to keep track of outstanding bugs in their products and effectively resolve them.



Practicals with Bugzilla

Steps on how to use Bugzilla would be too extensive to detail here, but it generally involves logging in, creating a new bug report, providing necessary details such as product, component, version, severity, description, etc., then submitting the report. Users can then update the bug report as the bug gets resolved.



Test Case Management Tool



What is a Test Case Management Tool?

A test case management tool is software used to manage, organize, and maintain all test cases and testing activities to ensure maximum test coverage.



Need for a Test Case Management Tool

Test case management tools help in planning, tracking, and managing testing activities, ensuring all requirements are tested, reducing duplication, and providing a centralized repository for all testing assets.



Difference from a Defect Tracking Tool

While a defect tracking tool focuses on tracking and managing defects, a test case management tool focuses on managing and organizing all testing activities, including managing test cases, mapping them to requirements, managing test runs, and tracking testing progress.



Different Test Case Management Tools in the Market


  • TestRail

  • Zephyr

  • qTest

  • TestLink

  • PractiTest

  • Features of TestRail


TestRail is a comprehensive web-based test case management software to efficiently manage, track, and organize software testing efforts. Key features include:



  • Ability to create, manage, and organize test cases

  • Track testing progress and provide detailed reports

  • Integration with bug tracking tools like Jira, Bugzilla

  • Support for Agile testing

  • Role-based access control



Practice with TestRail

Steps on how to use TestRail would be extensive to detail here but generally involve creating a project, adding test cases to the project, organizing test cases into runs, executing these runs, and then examining the reports TestRail generates.



Takeaways / Best Practices:


  • Always keep the defect tracking tool and test case management tool up-to-date with the latest information to ensure everyone involved has the latest information.

  • Make sure to set up proper integrations between the tools for seamless tracking and management of testing activities.

  • The choice of tools should depend on the specific needs and context of the project. There's no one-size-fits-all solution.

  • Be thorough in documenting all details while reporting a defect or writing a test case to ensure effective communication and understanding.

  • Proper usage of these tools can significantly enhance the productivity and effectiveness of your QA efforts.



Topic 2: Synchronization and alerts


Synchronization Issues



What are synchronization issues?



What is it?

Synchronization issues in automated testing occur when the test script does not run in sync with the web application, meaning that the application responds slower than the test script, leading to element not found errors or similar issues.



Where is it used?

Synchronization issues primarily occur in automation testing of web applications, especially in situations where web elements are dynamically loaded, web pages are being refreshed, or when dealing with multi-threaded execution.



How can we solve synchronization issues?



What is it?

Synchronization issues can be solved by employing wait statements in your automation scripts. This makes the script wait for a certain condition to be met before proceeding.



Where is it used?

Wait statements are used wherever there's a possibility of synchronization issues, for instance when a web element is not immediately available due to asynchronous loading.



How is it used?


There are three types of waits in Selenium WebDriver:



Implicit Wait: This makes WebDriver poll the DOM for a certain amount of time when trying to find an element or elements if they are not immediately available. Here's how you use it:


// WebDriver will wait for 10 seconds for an element to be present before throwing a NoSuchElementException

driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);


Explicit Wait: This is code you define to wait for a certain condition to occur before proceeding further in the code. Here's how you use it:



// WebDriver will wait up to 10 seconds for the element to be present. It will proceed as soon as the element is found within these 10 seconds.

WebDriverWait wait = new WebDriverWait(driver, 10);

WebElement element = wait.until(ExpectedConditions.presenceOfElementLocated(By.id("element-id")));




Fluent Wait: This is used to tell the WebDriver to wait for a condition, as well as the frequency with which we want to check the condition before throwing an "ElementNotVisibleException". Here's how you use it:



// The WebDriver will check the condition every 5 seconds until the timeout of 30 seconds is reached.

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

.withTimeout(Duration.ofSeconds(30))

.pollingEvery(Duration.ofSeconds(5))

.ignoring(NoSuchElementException.class);

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

public WebElement apply(WebDriver driver) {

return driver.findElement(By.id("element-id"));

}

});


Takeaways / best practices :


  • Using wait statements helps improve the stability and reliability of your automated tests by avoiding synchronization issues.

  • However, overusing wait statements can lead to slow test execution. Always use them judiciously, only when necessary.

  • When using Explicit and Fluent waits, be sure to remove the Implicit wait as mixing these two can lead to unpredictable wait times.

  • Use Fluent wait when you need to check for a condition frequently over a period of time. In cases where you need to wait for a specific element to appear, disappear, or be clickable, etc., you should use Explicit wait.


Fluent Waits & Alerts



Fluent Waits



What is it?

Fluent Wait in Selenium is a type of wait that allows you to specify the polling frequency for a certain condition to be met before throwing an exception.



Where is it used?

Fluent wait is used when you need to wait for a specific element to appear or disappear in a web page and want to check the condition frequently within a specified period.



How is it used?

Here's how you use Fluent Wait:

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

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

.pollingEvery(Duration.ofSeconds(5)) // Frequency of checking

.ignoring(NoSuchElementException.class); // Exception to ignore



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

public WebElement apply(WebDriver driver) {

return driver.findElement(By.id("element-id")); // Element to be waited for

}

});


Takeaways / best practices

Use Fluent wait when you need to check for a condition frequently over a period of time. Remember to choose your maximum wait time and polling frequency wisely to prevent slowing down your tests unnecessarily.



Alerts



What is it?

Alerts are a type of pop-up that display messages to the user, usually for confirmation or to provide a warning or information.



Where is it used?

In Selenium, alerts are used when a web application pops up an alert, confirmation, or prompt dialog that needs to be interacted with to proceed.



How is it used?

Here's how you handle alerts using Selenium:


// Switch to the alert

Alert alert = driver.switchTo().alert();


// Get the text from the alert

String alertText = alert.getText();


// Accept the alert

alert.accept();


// Or dismiss the alert

alert.dismiss();


Takeaways / best practices

Always handle alerts in your automation script as they can block further execution if not interacted with. Be sure to switch back to the main window or the correct frame after handling the alert.



Frames



What is it?

A frame is a part of a web page in which an independent HTML document can be loaded.



Where is it used?

In Selenium, frames are used when you need to interact with elements inside a frame, which requires switching to that frame first.



How is it used?

Here's how you handle frames using Selenium:


// Switch to a frame by index

driver.switchTo().frame(0);


// Or by name or ID

driver.switchTo().frame("frameNameOrId");


// Or by WebElement

WebElement frameElement = driver.findElement(By.tagName("iframe"));

driver.switchTo().frame(frameElement);


// Switch back to the main document

driver.switchTo().defaultContent();


Takeaways / best practices

Be aware that to interact with elements within a frame, you must switch to it first. After you're done with the frame, always remember to switch back to the main document or the parent frame.



Topic 3: Windows and screenshots


Windows



What is it?

In the context of Selenium WebDriver, a window is a specific browser instance that the WebDriver is interacting with.



Where is it used?

Window handling in Selenium comes into play when a web application opens another window or tab upon a user action, and there is a need to switch between them to interact with the web elements within.



How is it used?

Here's how you handle multiple windows using Selenium:


Store the initial window handle:

String originalWindow = driver.getWindowHandle();

```
Perform the action that opens a new window, then switch to the new window:

```

for (String windowHandle : driver.getWindowHandles()) {

if(!originalWindow.contentEquals(windowHandle)) {

driver.switchTo().window(windowHandle);

break;

}

}


When finished with the new window, close it and switch back to the original window:

driver.close();

driver.switchTo().window(originalWindow);


Takeaways / best practices


  • Always store the original window handle so you can switch back to it later.

  • Be careful when interacting with multiple windows. Ensure you're always in the correct window before performing any actions.

  • Close any unnecessary windows as soon as you're done with them to free up system resources.

  • Remember that window handling is different from frame handling. While frames exist within a single page, each window is a completely separate instance.


Screenshots




What is it?

In the context of QA automation, taking screenshots is the process of capturing the current state of the application's user interface at a specific point in time.



Where is it used?

Screenshots are typically used in QA automation for debugging and reporting purposes. They are often taken when a test fails, providing a visual reference of the UI state at the moment of failure.



How is it used?

Here's how you capture screenshots using Selenium WebDriver in Java:


Cast the driver object to TakesScreenshot:


TakesScreenshot screenshot = (TakesScreenshot) driver;


Capture the screenshot as a file:

File screenshotFile = screenshot.getScreenshotAs(OutputType.FILE);


Copy the screenshot file to the desired location:


FileUtils.copyFile(screenshotFile, new File("path/to/screenshot.png"));


Takeaways / best practices


  • Taking screenshots can be an invaluable tool for understanding the state of the application at the moment a test fails.

  • However, use this feature judiciously as capturing screenshots can slow down your tests, particularly if done frequently.

  • Be sure to manage your screenshots appropriately to avoid consuming excessive disk space. Consider strategies like overwriting old screenshots, or automatically deleting screenshots older than a certain date.

  • Remember that screenshots are typically used as a supplement to proper logging and error reporting, not as a replacement.


All the best and Happy Learning!

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article