DAY 5 - Industry Connect
a. What is test automation?
Test automation is the practice of running tests automatically, managing test data, and utilizing results to improve software quality.
b. What are the benefits of automating a test case?
1. Faster Feedback Cycle
Without test automation, feedback for newly developed features can take a while. Test automation helps you reduce the feedback cycle and bring faster validation for phases in the development of your product.
Test automation is especially useful because it helps you detect problems or bugs early on during the development phase, which increases the team’s efficiency.
2. Team Saves Time
By automating your testing procedure, your team has to spend less time validating newly developed features. It also improves communication with other departments like marketing, design, or product owners who rely on the results of these tests. These departments can easily check the logs of the automated tests and see what’s happening.
3. Reduced Business Expenses
When using an automated test environment, your company will save money as fewer resources are spent on testing your product. The idea is that you should not be doing any manual testing. Over the course of a whole project, this can make a big difference.
Of course, installing and setting up an automated testing environment takes time and resources. Also, chances are that you’ll pay for a proper test automation tool that can assist you in creating a stable test automation environment.
4. Higher Test Coverage
Manual testing puts limits on how many tests you can verify. Automation allows you to spend time writing new tests and adding them to your automated test suite. This increases the test coverage for your product, so more features are properly tested resulting in a higher quality application.
Also, automated testing allows developers to write more in-depth tests that test complex use cases. Lengthy tests that are often avoided during manual testing can be run unattended.
5. Reusability of Test Suite
At first, building your automated test suite is a challenge. However, once you have defined your suite, it’s very straightforward to reuse tests for other use cases or even other projects. The advantage is that you can easily hook up another project to your automated test suite.
You’ve already gained a thorough understanding of setting up an automated test suite and all related tools such as continuous integration (CI) pipeline. Therefore, you can easily replicate this knowledge to set up your test automation for a new project.
6. Faster Time to Market
As I said earlier, newly developed features can be continuously tested and validated with test automation. This reduces the feedback and testing cycle and allows companies to bring their products to the market faster.
7. Better Insights
Automated testing provides better insights than manual testing when some tests fail. Automated software testing not only gives insights into the application but also shows you the memory contents, data tables, file contents, and other internal program states. This helps developers determine what’s gone wrong.
8. Improved Accuracy
Even the best testing engineer will make mistakes during manual testing. Especially when testing a complex use case, faults can occur. On the other side, automated tests can execute tests with 100-per cent accuracy as they produce the same result every time you run them.
9. Automated Testing Provides More Features
An automated test suite can help you with more features—for example, simulating thousands of virtual users interacting with your web application in order to see how the application behaves. It’s impossible to simulate this kind of behavior by doing manual testing. Features like this save developers a lot of time!
10. Less Stress on QA Team
By implementing an automated testing strategy, you allow your QA team to spend time on tasks other than manual testing. Besides that, the job description of a QA engineer gets more interesting once you remove the repetitive element of manual testing.
For many QA engineers, testing automation creates the opportunity to build new tools to further optimize the current testing suite or extend it with new features.
Now that you know what the benefits of automated testing are, let’s take a deeper look at what kind of tests exist.
11. Quickly Determine the Stability of Your Build
Test automation helps you to automate tests to determine the stability of your build. Often, smoke testing is used to validate stability. However, smoke testing is slow and requires manual input from the testing engineer such as setting up databases with test data.
Furthermore, smoke testing can be automated through test automation. You can automatically generate and prepare the right databases in order to run smoke tests. Therefore, you can quickly determine the stability of the build.
In summary, the goal is to be able to release a build as fast as possible and automatically validate its stability.
12. Eliminate Human Error
Manual testing opens up the opportunity for humans to make mistakes. Especially for complex scenarios, it makes sense to use test automation to avoid mistakes. You can still make mistakes, even with test automation. However, the rate of mistakes is significantly lower when using test automation for your test suite.
Different Types of Automated Testing
There are different types of testing which can be added to your automated testing setup. Let’s take a look at the possibilities and what they are meant for.
Unit Testing
A unit is the smallest piece of code that can be logically isolated in the system. For most programming languages, that’s a function. A unit test shouldn’t touch other code or make any interactions with a database, config file, or network. If the function holds such interactions, these interactions should be stubbed (faking the interaction and returning data).
The ultimate goal is to test if the logic is correct. It is not about testing interactions.
Functional Testing
Whereas unit testing focuses on testing isolated logic, functional testing aims at testing the function with all its integrations. So, no stubbing or faking calls whenever you’re writing functional tests.
In short, a functional test takes input and converts it to output. This output is used to compare with the expected results.
Regression Testing
Regression testing is an important task for detecting if the quality of an application has decreased (or increased).
For example, a particular API endpoint can handle 1500 requests per minute with the given code. Whenever a new feature gets added to the product regression tests will be run. Regression tests help the QA engineer detect if the API endpoint can still handle the same amount of requests or even more.
Smoke Testing
A smoke test helps a QA engineer determine whether the deployed build is stable or not. Often, this is seen as the confirmation step before proceeding with further testing.
A smoke test holds a limited number of tests just to determine the stability of the build. It acts as a quick verification check before proceeding.
Black Box Testing
Black box testing doesn’t consider the internal code structure. With black box testing, only the inputs and outputs matter. A tester should not have prior knowledge about the application and should not be given any form of documentation. The goal is to see how useable the application is when somebody tries to use the application for the first time.
Black box testing aims to find errors in the following categories:
- Incorrect or missing functions
- Interface errors
- Behavior or performance errors
- Startup and termination errors
In short, black box testing is hard to automate but still a very useful type of testing to include.
Integration Testing
A testing engineer who performs an integration test wants to know if two or more systems can work together (integrate). A system can be anything ranging from a database to an API.
To give you an example, an integration tester wants to find out if the TweetDeck tool can still work on top of the Twitter API. If both products seem to work together, the integration test has succeeded.
c. When do you automate a test case?
- Repetitive tests that run for multiple builds
- Tests that tend to cause human error
- Tests that require multiple data sets
- Frequently used functionality that introduces high risk conditions
- Tests that are impossible to perform manually
- Tests that run on several different hardware or software platforms and configurations
- Tests that take a lot of effort and time when manual testing
d. how do you choose which test case to automate?
A test case should be automated if:
- The task is going to be repeated.
- It’s going to save time.
- The requirements, the test, or the task are low risk, stable, and unlikely to change often.
- The test is subject to human error.
- The test is time consuming.
- The test has significant downtime between steps.
- The test is repetitive.
e. What is IWebDriver and IWebElement?
IWebDriver
Defines the user’s interface for controlling the browser.
The IWebDriver interface, which represents an idealized web browser, is the key interface to utilize for testing. There are three types of methods in this class:
- Control over the web browser
- IWebElements Selection
- Aids for debugging
Url, which is used to load a new web page by setting the property, and the different methods comparable to FindElement(By), which are used to find IWebElements, are important properties and methods.
IWebElement
An HTML element is represented by WebElement. HTML elements are the building blocks of HTML documents. A start tag, an end tag, and the content in between are used to create HTML elements: <tagname> content </tagname>
Everything from the start tag to the end tag is considered an HTML element:<p> My first HTML paragraph. </p>
HTML elements can be nested, which means they can be stacked on top of each other (elements can contain elements). Nested HTML elements can be found in any HTML document.
Example:
<html>
<body>
<h1> My First Heading </h1>
<p> My first paragraph. </p>
</body>
</html>
Advanced tasks to automate the below test cases:
a. Check if a user is able to create time/material record successfully
b. Check if a user is able to edit the time/material record created in the previous test
c. Check if a user is able to delete the time/material record updated in the previous test
评论
发表评论