API, SQL, AUTOMATION Flashcards

1
Q

WHAT IS POSTMAN

A

POSTMAN IS A TOOL THAT YOU CAN USE TO TEST YOUR OWN OR EXTERNAL REST API’S

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

WHAT IS REST API

A

REST APIs use standard HTTP methods to perform CRUD (Create, Read, Update, Delete) operations

GET: Retrieve information about a resource.
POST: Create a new resource.
PUT: Update an existing resource.
DELETE: Remove a resource.

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

HOW DO YOU MAKE A POST IN POSTMAN

A

A POST IS MADE IN JSON FORMAT. INSIDE CURLY BRACKETS YOU WRITE THE VALUES AND NAMES INSIDE DOUBLE QUOTES AND ADD A COMMA AFTER EVERY ENTRY

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

WHAT IS A 405 STATUS

A

A 405 status code, also known as “Method Not Allowed,” is an HTTP response status code indicating that the request method is known by the server but has been disabled and cannot be used for the requested resource

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

WHAT IS A 200 STATUS

A

A 200 status code, known as “OK,” is an HTTP response status code indicating that the request has succeeded

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

WHAT IS A 400 STATUS

A

A 400 status code, known as “Bad Request,” is an HTTP response status code indicating that the server could not understand the request due to invalid syntax

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

WHAT IS A WAY TO CHECK PERFORMANCE WITH POSTMAN

A

ONE WAY TO CHECK PERFORMANCE IN POSTMAN IS BY CHECKING THE RESPONSE TIME OF A REQUEST.

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

TELL US ABOUT A BUG YOU FOUND THAT YOU WERE PROUD OF

A

The Bug
During one of my exploratory testing sessions, I discovered an issue where applying multiple discount codes in a specific sequence would incorrectly calculate the total discount, leading to a significantly higher discount than intended. This was a major issue because it could result in substantial financial losses and affect the integrity of our pricing model.

Discovery Process
To pinpoint the problem, I began by reproducing the bug consistently in a controlled environment. I meticulously documented each step and noted that the issue occurred only when certain types of discount codes were combined. I then used debugging tools to trace the application’s behavior and discovered that the discount calculation algorithm had a flaw when handling overlapping discount rules.

Resolution
I documented the bug in our tracking system with detailed steps to reproduce, screenshots, and logs. I then collaborated with the development team to provide additional insights from my testing. Together, we modified the discount calculation logic to ensure that it accurately applied discounts without overlap. I also designed and implemented new test cases to cover various combinations of discount codes to prevent similar issues in the future.

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

WHAT ARE SOME THINGS YOU TEST IN POSTMAN

A

ONE THING TO TEST IS THE PERFORMANCE. YOU CAN SIMPLY DOING THIS IN POSTMAN BY CHECKING THE RESPONSE TIME OF A REQUEST. ANOTHER THING WE CAN TEST IS TO SEE IF THE JSON DATA MATCHES A REQUEST SIMPLY BY CHECKING FOR INSTANCE IF LETS SAY YOU WANT TO CHECK A PAGE NUMBER YOU’D DO SOMETHING LIKE JSONDATA.PAGE TO EQ AND THEN THE NUMBER IT ITS SUPPOSED TO BE

Validation testting
functional testing

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

What kinds of bugs that API testing would often find?

A

Missing or duplicate functionality
Fails to handle error conditions gracefully
Stress
Reliability
Security
Unused flags
Not implemented errors
Inconsistent error handling
Performance
Multi-threading issues
Improper errors

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

Give me an example of how you test api at your current company

A

Recently, we introduced a new Order Management API to handle order creation, updates, and cancellations.

Create Order: I tested the POST /orders endpoint with valid order data and verified that the API returned a 201 Created status with the correct order details in the response. I also tested edge cases, such as placing orders with maximum allowed items.
Update Order: I tested the PUT /orders/{orderId} endpoint to update order details, ensuring that only valid updates were accepted and reflected correctly in the database.
Cancel Order: I tested the DELETE /orders/{orderId} endpoint to ensure that orders could be canceled and appropriate status codes (e.g., 204 No Content) were returned.

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

WHAT IS SQL

A

SQL OR STRUCTURED QUERY LANGUAGE IS A MANAGEMENT LANGUAGE USED TO COMMUNICATE WITH A DATABASE. IT IS USED FOR QUERYING, UPDATING, AND MANAGING DATA.

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

WHY DO WE USE SQL IN TESTING

A

WELL LETS SAY YOUR APPLICATION HAS A SIGN UP PAGE, EVERY PERSON WHO SIGNS UP USING THE PROVIDED FIELDS WILL BE ADDED TO A DATABASE. WELL US AS TESTERS WOULD NEED TO GO INTO THE DATABASE AND MAKE SURE ALL THOSE FIELDS ARE ADDED CORRECTLY AND WE CAN DO THAT BY LOOKING FOR A USER, AND THEN OK FIRST NAME IS IN THE CORRECT FIELD, LAST NAME IS TOO, AND EMAIL.

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

TELL US HOW YOU USE SQL AT YOUR CURRENT COMPANY

A

One of my key responsibilities is to validate that the order processing system is working correctly. This involves verifying that orders are accurately recorded in the database and that all related data is consistent.

Validating New Orders

When a new order is placed, I use SQL to ensure that the order details are correctly stored in the orders table.

After an order is placed, the inventory for the ordered products should be updated. I verify this by querying the inventory table.

Customer Order History

To ensure that a customer’s order history is accurately maintained, I query the customer_orders view.

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

WHAT IS THE DIFFERENCE BETWEEN A PRIMARY KEY AND A FOREIGN KEY

A

Primary Key:

Uniquely identifies each record in a table.
Must contain unique values.
Cannot contain NULL values.
Ensures each record is unique and can be identified.

Foreign Key:

Establishes a relationship between two tables.
Values must match values in the referenced primary key column.
Can contain NULL values (depending on the design).
Ensures referential integrity between tables.

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

What are the differences between joins

A

Inner join – matching info from two tables
b. Right join – matching and all info from right table, (N/A)
c. Left join – matching and all info from left table
d. Full outer join – all data

17
Q

What is your automation framework

A

a. Selenium webdriver – automation tool
b. Java – coding language
c. IntelliJ – IDE – editor
d. Maven – built tool, dependencies and archives, jars, maven’s live repository to
access and implement the dependencies directly into our projects
e. TestNG – testing Framework, organize, structure, and execute test (annotations,
xml suite, execute tests in parallel or cross browser)

18
Q

What is maven and what is the advantage of it when compared to a java project

A

Maven – plugin that could be used across all projects, dependencies and archives
are located in a live repository, POM file (add you dependencies and the
components of your project)

18
Q

What is the most ideal locator to use when locating an element

A

must be a unique locator (lD, Name), Xpath (dynamic and you can locate using
relative or absolute xpath)
b. Relative and absolute xpath:
i. Relative – you are locating a unique element closer to the element you
are trying to locate. And then you can go down the HTTP hierarchy to
your element
ii. Absolute- you are starting from the beginning of the http hierarchy to
your element

19
Q

What is the difference between static and non static methods

A

Static Methods: Belong to the class, can be called without creating an instance, cannot access instance variables or methods, and are used for tasks that do not depend on instance-specific data.

Non-Static Methods: Belong to an instance of the class, require an instance to be called, can access instance variables and methods, and are used for tasks that involve the state of the object.

20
Q

What are the different types of waits available and when do you use them

A

a. Thread.sleep (implicit wait, hard coded), pauses the execution of the code for
the specified time
b. Implicit wait – if action is not executed within the time frame provided or
designated (hard coded time) it will throw an exception – beginning after
navigating to a site.
c. Explicit wait – wait until the expected condition is met. The code will execute
when the specified condition is fulfilled, you provide a maximum wait time.
More dynamic, allows your test to execute faster
d. Fluent wait

21
Q

What is a primary key

A

A primary key in SQL is a column or a set of columns in a table that uniquely identifies each row in that table. The primary key ensures that the data within the column(s) is unique and not null, which means no two rows can have the same primary key value, and the primary key column(s) cannot contain null values.

22
Q

When should tests be automated?

A

The tested feature requires minimal change
The tested feature has a high business priority
The test requires sets of test cases that run simultaneously
The test executes frequently and is repeatable

23
Q

What kind of tests should not be automated?

A

The test feature changes frequently
Testing involves user experience and usability
Tests do not offer pass or fail conditions
Tests rely on the tester’s discretion to determine results

24
Q

What are the stages of the automated testing process

A

Planning, design, and development of any automation test strategy and its required environment
Test scripting and execution
Test analysis, reporting, and continued maintenance

25
Q

What are implicit and explicit waits in Selenium

A

Automation tests rely on wait commands to locate and fix web elements that lag. Selenium has two types of waits: implicit and explicit. Explicit waits allow your code to halt execution until a specific condition resolves. Implicit waits poll the DOM (the structure of an HTML element) for a certain period of time, effectively delaying execution so that elements can have more time to load.

26
Q

What is CI/CD

A

CI/CD stands for continuous integration and continuous deployment. and it’s a process to ensure efficient and reliable software delivery. It can automate the building, testing, and deployment of an application replacing the need to have to go back and do all those things manually over again, saving time and preventing errors.

27
Q

how does your company use automation testing

A

In my current role in the e-commerce department, automation testing plays a critical role in ensuring the quality and reliability of our software. We use Selenium for browser-based end-to-end testing, which allows us to automate user interactions with the website. For example we automate end to end user transactions from browsing products to complete purchases and automating the entire checkout process.

We use automated regression tests to ensure new code does not introduce any new bugs and re-running a suite of automated tests on the entire application after a new feature is added to ensure that existing features still work as expected.

28
Q

What kind of tests do you run in the CI/CD?

A

We run various types of tests in the CI/CD such as

integration tests to ensure the application is working properly together

functional tests to ensure the functionalities of the application are working according to the requirements

end to end testing to verify the applications flow from start to finish

regression testing to ensure new code does not introduce any new bugs or adversity to the application.