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

When using Postman for API testing, several aspects of an API’s functionality, performance, and reliability are evaluated. Here are key areas to test:

Functional Testing
GET Requests: Ensure the API retrieves data correctly.
POST Requests: Validate data creation.
PUT/PATCH Requests: Test data updates.
DELETE Requests: Verify data deletion

Response Status Codes
Check for appropriate HTTP status codes (e.g., 200 OK, 201 Created, 400 Bad Request, 404 Not Found, 500 Internal Server Error).

Performance Testing
Measure response times and ensure they are within acceptable limits.

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

Functional Bugs
Incorrect Data Handling: The API returns incorrect data or fails to process valid inputs correctly.
Incorrect HTTP Methods: Using the wrong method (e.g., GET instead of POST).
Missing or Invalid Parameters: The API does not handle required or optional parameters correctly.

Slow Response Times: The API takes too long to respond.

Error Handling Failures: The API does not return appropriate error codes or messages.

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

Data Validation and Integrity
Purpose: Ensure that the data stored in the database is accurate and consistent with the application’s functionality.

Data Retrieval for Testing Scenarios
Purpose: Extract specific data needed to set up or verify test cases.

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 is a build automation and project management tool primarily used for Java projects. It simplifies the process of managing a project’s build lifecycle, dependencies, and documentation through a standardized approach.

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

Implicit Wait
Description: Instructs the WebDriver to wait for a certain amount of time when searching for an element if it is not immediately available.
Use Case: When you want a general wait applied to all elements in the test.

Explicit Wait
Description: Waits for a specific condition to be met before proceeding further in the code. It allows you to target a specific element or condition.
Use Case: When you need to wait for a particular element to become visible, clickable, or present in the DOM.

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

Test Planning
Objective: Define the scope, goals, tools, and resources for automated testing.

Test Design and Development
Objective: Create automated test scripts and prepare the testing environment.

Test Environment Setup
Objective: Ensure a stable and reliable test environment.

Test Execution
Objective: Run automated tests and collect results.

Test Result Analysis
Objective: Review and interpret test outcomes.

Bug Reporting

Test Maintenance
Objective: Keep test scripts up-to-date with application changes.

Continuous Improvement
Objective: Enhance the automation framework and process.

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.