Automation Flashcards
What is QA automation and why is it important?
- Using scripts to automatically run test cases
- To handle time-consuming tasks
- To handle repetitive tasks
- To eliminate human error
- To test load and performance
- Saves time and money
Which test cases to automate?
- Main functionalities - login, checkout, search
- Test cases that take the longest time to go through manually, like regression
- Functional Tests
- Smoke tests
- Regression tests
- Performance tests
- API tests
- unit tests, but this is mostly for devs
Which test cases should not be automated?
- Tests that are already covered
- Captcha
- When working on new UI, which possibly might not stick after a while
- Test cases that are easy to run manually, but would be difficult to automate
- Initial development stage - sometimes impractical to invest resources during the unstable phase of product development
- Short-term projects
- Non-automatable cases, such as Captcha
How many tests do you automate per day?
- Depends on the test
- If tests are very similar, you can automate like 10 per day
- Sometimes it can take a whole week to automate a test
What is a test script and how do you create one using JS?
A set of actions performed on a system to determine if it satisfies software requirements and functions correctly, organized as a script with code
What are the advantages of using JS for automation?
- JS is the most used language right, so there are many resources for learning
- It is relatively easy to learn compared to other languages
- it can be useful for both back-end and front-end
What is the role of assertions in automation testing?
They verify you have landed on the correct page, and see the elements you need to see
Challenges you have faced when implementing test automation?
- Finding selectors
- Waits
- Choosing what to automate
- Creating test automation framework from scratch
How do you deal with test flakiness?
- The best thing to do is to dig into the issue, rewrite the code. Debug and find out why its failing
- Add waiting for elements to be visible
- Sometimes tests fail because its too fast, so you can make it so for example in a text field, it types slowly like an actual user would
- Good to use unique selectors
What is the difference between before and beforeEach and after
- With just ‘before’, code gets executed just once before the tests
- with ‘beforeEach’, code gets executed before every test
- with ‘after’, you can write commands to clean up data
How do you keep tests organized while automating?
By using the POM, where you can keep selectors and methods separate
What is the difference between unit tests and end-to-end test?
- Unit tests are usually written by devs, testing just a single component
- End-to-end tests are written by QA automation engineers, they verify the whole flow a user would go through to get to that function
What are the steps for implementing automation
- Identify which test cases to automate
- Identify the tool
- Create the framework
- Create utility files and environment files
- Start scripting
- Identify reporting metrics
- Allocate time for maintaining and enhancing scripts
What automation stack do you use?
- NodeJS which is based on JS
- Cypress for UI and API test automation
- Github actions for running CI/CD
What are the best candidates for test automation/ Which tests would you automate first?
- regression tests
- The most repetitive tests
- most complicated tests to do manually, but easy to automate
Does it matter what stack/language is used for the application when you write test automation?
- Not really, but it might be helpful to use the same language as the devs in case you need their help
What tests cannot be automated, or should not be automated?
- UX
- one-time tests
- exploratory testing
- audio and video are too difficult to automate
- fast changing application, as it would be inefficient
How do you know what to automate?
After release, I go through all the tickets went to production and write tests cases for those. Then I try to automate all of them until the next release. I set priorities based on the business value
How do you structure your automation?
- I utilize the POM to make my framework readable, maintainable, and scalable
- page_object folder contains all the page objects classes with selectors and helper methods inside it
- The E2E folder contains all of the specifications, aka the tests
- I also keep all of the reusable data in the data folder in multiple JSON files for easy import
- Test files import both page object and data JSON files
What’s your strategy for an automation test plan?
- It depends on the company
- Currently, we have a big backlog of tests to catch up with, so we release first then automate.
- Ideally I want us to automate features while devs are creating them, so we would not have to spend too much time on manual testing
What is your biggest challenge in automation?
It’s hard to isolate one issue in particular, as there is always something happening, and you spend a certain amount of time fixing it. At the end of the day, if there is something that is outside my scope, I reach out to the people who would know
How many tests do you automate?
When the complexity was limited, I could 5 or 6 test cases per day. Sometimes I was only able to automate 1 test case over week because it was more complex
How many test cases do you have and how many are automated?
- We have about 800 total, and around 200 automated. * We are trying to follow the test pyramid and we didn’t cover each feature by UI automation test.
- We should keep the balance between needed and redundant because you need to support all these tests
How do you deal with flaky tests?
- One of the solutions is to handle them by handle them by having additional waiters check or change the test flow
- Otherwise you need to implement the logic of retries
- I try to dig into them when I have time to fix them