TESTING
TESTING
[agile is a software development methodology using which you can deliever the
product faster to your client and more frequently to the client and you
get the feedback from the customer in imporving the quality of software.agile
promotes team collabration it promotes continuos delivery and better effecient
quality]
Verify the type of pen, whether it is a ballpoint pen, ink pen, or gel pen.
Verify that the user is able to write clearly over different types of papers.
Check the weight of the pen.
Verify if the pen is with a cap or without a cap.
Verify the color of the ink on the pen.
smoke testing - wheneevr we get a new build we will check the major
functionality of an application is working fine or not for example login
functionality if we are unableto login then there will be difficult to perfom
further actions so thats where we perform smoke testing
sanity testing which is used to perform whenever we get a build with that
build there will be a default fix so we will test that defect fix thoroughly for
example there is a test box which is having some defect the developer has fixed it
and given you the build and now its our resposibilty to test that so that
particular testing is known as sanity testing
Regression
we know that regression testing is perfomed to make sure the existing feature
of applicationis working fine even after adding a new feature or some of the defect
fixes,so at that particular point some exsiting feature has been broken that will
be the huge loss to company so fro that reason making sure the exsisting feature is
working fine is very much important.suppose we can say phone pay if they added some
new feature to the application that shoukd work fine along with the existing
feature otherwise there will be a huge loss for company
Retesting
in retesting we will execute the already written test case which is already
written again and it is a part of defect life cycle if the defect is fixed and
working fine we will close it otherwise we will be reopening it.
Test Cases for Gmail:
Adhoc Testing:
Exploratory Testing:
UAT Testing:
[There are the parts in uat testing alpha testing and beta.alpha testing is
done by internal testers in your team.this will be done before the product is
launched into the market.
Beta testing is done by real users in real time environment to catch the
defects beta testing is very effective to get the feedback and you have to work
on it]
• findElement(): This method in Selenium searches for the first web element
that matches the specified criteria and returns it. If no matching element is
found, it throws a NoSuchElementException.
• findElements(): This method also searches for web elements matching the
specified criteria, but it returns a list of all matching elements. If no
matching elements are found, it returns an empty list.
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
// findElement() example
WebElement singleElement = driver.findElement(By.id("elementId"));
// findElements() example
List<WebElement> multipleElements = driver.findElements(By.tagName("a"));
driver.quit();
}
}
Initiating a Browser:
In Selenium, to start a browser session, you use the appropriate WebDriver class
(like ChromeDriver for Chrome) and instantiate it.
Example Java Code:
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
1. Linear Scripting Framework: Basic automation where test scripts are executed
sequentially.
2. Data-Driven Testing Framework: Tests are executed using different sets of
input data from external sources.
3. Keyword-Driven Testing Framework: Tests are written using keywords that
represent test actions and logic.
4. Hybrid Testing Framework: A combination of different frameworks to leverage
their strengths.
5. Modular Testing Framework: Tests are divided into smaller, manageable modules
for reusability.
6. Behavior-Driven Development (BDD) Framework: Integrates business requirements
into test cases for better collaboration.
7. Page Object Model (POM) Framework: Organizes tests and page interactions
through a structured approach.
• Data-Driven: Storing test data outside code (like in spreadsheets) and using
it in test cases.
[data driven framework is which tha test data will be stored in
form of csv and excel sheets.testng supports the ddf using
@dataprovider annotation]
• Keyword-Driven: Using keywords to define test steps and actions.
Programming Concepts in Java:
• Immutable Class: A class whose state cannot be changed after creation, like
String in Java.
• Polymorphism: A method having multiple forms based on the number or types of
arguments.
• Encapsulation: Hiding internal implementation details and exposing a
controlled interface.
• Class and Constructor: A class defines a blueprint for objects, while a
constructor initializes an object.
Swapping Values: In this challenge, you need to swap the values of two variables
without using a third variable
a = a + b;
b = a - b;
a = a - b;
Reversing a String: In this challenge, you are required to reverse a given string.