- Test nulls and empty strings, these have a habitat of causing issues ;).
- Test with Unicode characters, ensure they are correctly saved to the database.
- Test mandatory and optional parameters, in particular test with just mandatory values.
- Ensure correct status codes are returned, you will find false positives e.g a 500 being returned as a 200.
- Functionality Bugs: the test looks for missing functionality bugs
- Reliability Bugs: API testing helps identify bugs pertaining to integration across different systems
- Performance Bugs: The tests help determine how much traffic the system can handle before being overloaded, and how to expand - infrastructure to meet rising demand at the core, but also are very effective at pinpointing weak points in the API
- Security Bugs
class Calc: | |
def __int__(self): | |
print("DC") | |
def sum(self, a, b): | |
return a + b | |
def sub(self, a, b): | |
return a - b |
class Calculator: | |
def __init__(self, a, b): | |
self.a = a | |
self.b = b | |
self.add = self.addition() | |
self.sub = self.subtraction() | |
self.mul = self.multiplication() | |
self.div = self.division() | |
def addition(self): |
class MyClass: | |
# Public variable | |
public_var = "I am public." | |
# Protected variable | |
_protected_var = "I am protected." | |
# Private variable | |
__private_var = "I am private." |
Shallow and deep copies are two methods of duplicating objects in Python, particularly useful when dealing with complex data structures like lists and dictionaries. Here’s a detailed comparison between the two:
-
Definition: A shallow copy creates a new object but does not create copies of nested objects within the original object. Instead, it copies references to those nested objects.
-
Behavior: Changes made to nested objects in the shallow copy will affect the original object and vice versa because both share the same references to the nested objects.
-
Implementation: You can create a shallow copy using the
copy()
method or thecopy
module'scopy()
function.
<?xml version="1.0" encoding="UTF-8"?> | |
<Configuration status="WARN"> | |
<Appenders> | |
<Console name="Console" target="SYSTEM_OUT"> | |
<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1} - %m%n"/> | |
</Console> | |
<File name="FileLogger" fileName="logs/test.log"> | |
<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1} - %m%n"/> | |
</File> | |
</Appenders> |
- Can we write all the code in single python file and this is what we call automation?
- No
- High Maintenance
- Code duplicated.
- Properly Maintenance code it will difficult to maintain such a large files /files.
- Not scalable -> TC 10, tc 100, TC 1000, TC 10,000 -> Impossible to maintain this.
A framework is a **structure **that provides a foundation for developing software applications / testAutomation.
package com.thetestingacademy.tests; | |
import org.openqa.selenium.By; | |
import org.openqa.selenium.WebDriver; | |
import org.openqa.selenium.WebElement; | |
import org.openqa.selenium.edge.EdgeDriver; | |
import org.openqa.selenium.support.ui.ExpectedConditions; | |
import org.openqa.selenium.support.ui.WebDriverWait; | |
import java.time.Duration; |
pm.test("TC1 Verify the booking Id is not Null",function(){ | |
var response = pm.response.json() | |
console.log(response) | |
// Expected Result = Actual Result | |
//response["bookingid"] = null; | |
pm.expect(response["bookingid"]).not.equal(null) | |
}); |
// // Javascript - Overview | |
// // console.log("Hello Wolrd, JS"); | |
// // // ; is optional in JS | |
// // console.log("Without the semi colon") | |
// // console.log(2+2) | |
// // console.log(2-2) | |
// // console.log(2*2) | |
// // console.log(2/2) |