Automation Flashcards

1
Q

What is QA automation and why is it important?

A
  • 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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Which test cases to automate?

A
  • 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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Which test cases should not be automated?

A
  • 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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How many tests do you automate per day?

A
  • 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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is a test script and how do you create one using JS?

A

A set of actions performed on a system to determine if it satisfies software requirements and functions correctly, organized as a script with code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are the advantages of using JS for automation?

A
  • 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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the role of assertions in automation testing?

A

They verify you have landed on the correct page, and see the elements you need to see

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Challenges you have faced when implementing test automation?

A
  • Finding selectors
  • Waits
  • Choosing what to automate
  • Creating test automation framework from scratch
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How do you deal with test flakiness?

A
  • 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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the difference between before and beforeEach and after

A
  • 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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How do you keep tests organized while automating?

A

By using the POM, where you can keep selectors and methods separate

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the difference between unit tests and end-to-end test?

A
  • 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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are the steps for implementing automation

A
  • 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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What automation stack do you use?

A
  • NodeJS which is based on JS
  • Cypress for UI and API test automation
  • Github actions for running CI/CD
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are the best candidates for test automation/ Which tests would you automate first?

A
  • regression tests
  • The most repetitive tests
  • most complicated tests to do manually, but easy to automate
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Does it matter what stack/language is used for the application when you write test automation?

A
  • Not really, but it might be helpful to use the same language as the devs in case you need their help
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What tests cannot be automated, or should not be automated?

A
  • UX
  • one-time tests
  • exploratory testing
  • audio and video are too difficult to automate
  • fast changing application, as it would be inefficient
18
Q

How do you know what to automate?

A

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

19
Q

How do you structure your automation?

A
  • 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
20
Q

What’s your strategy for an automation test plan?

A
  • 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
21
Q

What is your biggest challenge in automation?

A

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

22
Q

How many tests do you automate?

A

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

23
Q

How many test cases do you have and how many are automated?

A
  • 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
24
Q

How do you deal with flaky tests?

A
  • 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
25
Q

How do you ensure that the automation that you’re writing doesn’t break/ How do you write reliable and maintainable automated tests/ How do you write robust automated tests?

A

Implementation of best practices
* Make to use static selectors, with custom attributes if possible
* Make tests isolated, should not have dependencies
* Write reusable code - create functions when there is code duplication
* Use the POM to keep code well organized, readable, and maintainable
* Create data over API if possible - use API helper methods in the UI framework to prepare test data
* Use retry library instead of sleep
* From time to time, review the growing code base

26
Q

How are the requirements for automation cases communicated to you?

A
  • In the form of test cases
  • Well write test cases and automate them
  • Test cases are written from requirements in the tickets
27
Q

What was the most difficult automation task you worked on?

A
  • Starting automation process from scratch
28
Q

Why do you use CSS classes?

A

The classes and IDs probably are the most common test web elements. I use them through the dot or square brackets as CSS selectors for my UI automation if there is nothing else more unique than class

29
Q

What’s the different between tag and attribute?

A
  • An attribute is any key/value pair in the DOM, and a tag is where the attributes live
  • From a QA perspective, there is not a significant difference in usage. We could use one or the other to create a unique selector path
30
Q

When is a good time to automate a test?

A
  • When we have stable functionality/interface, and nothing is on fire at the moment
31
Q

What are the different parts of a test automation framework?

A

A framework will have multiple layers such as:
* Configuration - first part to get executed in order to organize further code execution
* Tests - in the POM it will be something like a specs folder
* Page_objects - the folder where all the helper methods and selectors live in order to keep code organized and maintainable
* Possibly lowest level client - for example, API client page where we import and specify each API call type so we would easily switch from one client to another on one page if we ever need to

32
Q

How will you automate the basic login in a web application?

A

With the help of one of the UI testing tools, such as Cypress, by clicking on the web elements as a real user

33
Q

How would I implement automation?

A
  1. Identify which type of testing/test cases you want to automate
  2. Identify the tool
  3. Design the framework
  4. Create utility files and environment files
  5. Start scripting
  6. Identify reporting metrics and build reporting functionality or using existing metrics
  7. Allocate time for enhancing and maintaining scripts
34
Q

What is an XPATH?

A

Basic level for QA team: another way of selecting locators on the page. It is more powerful than CSS. For example, not only can we move from parent to parent to child, but also from child to parent

XPATH is a major element in the XSLT standard. It can be used to navigate through elements and attributes in an XML/HTML DOM

35
Q

What kind of selectors do you prefer and why?

A

Whatever fits the need. Ideally custom attributes created by devs, as they are less likely to change

36
Q

What are the types of tests you would automate most?

A
  • Regression
  • Smoke
  • Performance
  • Sanity
37
Q

How do you deal with tech debt?

A

Allocate a sprint during every quarter for it

38
Q

Describe the automation testing lifecycle

A
  1. Prioritize
  2. Automate test cases
  3. Run test cases
  4. File bugs if necessary
  5. Do maintenance
39
Q

What is a framework?

A

A framework is a set of the structure of the entire automation suite. It is also a guideline, which if followed can result in a structure that is easy to maintain and enhance

40
Q

What do framework guidelines include?

A
  • Coding standards
  • Handling the test data
  • Maintaining and handling the elements
  • Handling of environment files and properties file
  • Reporting of data
  • handling logs