0% found this document useful (0 votes)
25 views7 pages

Test Important

Testng is a testing framework for Java that provides features like annotations, data-driven testing, test groups, dependencies, and listeners. It can integrate with tools like Selenium and be used for unit, functional, and integration testing. Maven is a build tool that standardizes project builds and manages dependencies through a POM file and central repository. It provides lifecycles and plugins to automate common tasks like testing, packaging, and deploying.

Uploaded by

ccrb wrlc
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views7 pages

Test Important

Testng is a testing framework for Java that provides features like annotations, data-driven testing, test groups, dependencies, and listeners. It can integrate with tools like Selenium and be used for unit, functional, and integration testing. Maven is a build tool that standardizes project builds and manages dependencies through a POM file and central repository. It provides lifecycles and plugins to automate common tasks like testing, packaging, and deploying.

Uploaded by

ccrb wrlc
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Smoke and sanity test

A smoke test is a type of software testing that verifies that the most crucial functions of a program work
correctly. The goal of a smoke test is to quickly identify major issues that would prevent the software from
being used.
Sanity test is a type of software testing that is usually performed after the build is stable. It is a superficial test
that verifies that the basic functionality of the system is working correctly, and that it has not regressed in
stability since the last release. It checks that the main functionalities of the system are working as expected and
it also helps to quickly identify if there are any obvious issues with the build.
Regression
Regression testing is a type of software testing that verifies that changes to the codebase have not introduced
new bugs or reintroduced old ones. It involves re-testing a previously tested program following modification
to ensure that no new errors have been introduced and that existing functionality has not been affected. The
goal of regression testing is to ensure that changes to the codebase do not cause unintended consequences, and
that the software continues to function as expected. Regression testing is typically done by re-running a subset
of the test cases that have been previously run, and comparing the results to the expected outcome. This can
be done manually or with the use of automated testing tools.
Junit
Junit is a unit testing framework for java programming language. It is an open-source framework that is used
to write and run repeatable tests. Junit tests are typically automated, and they are run using a junit test runner,
which can be run from the command line, or integrated into an ide.
Junit provides annotations and assertions to structure your test cases and validate the expected results. Some
of the most commonly used annotations and assertions are:
@test: this annotation is used to mark a method as a test method.
@before and @after: these annotations are used to mark methods that should be run before and after each test
method, respectively.
@beforeclass and @afterclass: these annotations are used to mark methods that should be run once before and
after all test methods, respectively.
Assertequals(): this assertion method is used to check that two values are equal.
Asserttrue(): this assertion method is used to check that a boolean value is true.
Assertfalse(): this assertion method is used to check that a boolean value is false.

This test case tests the addition functionality of the calculator class by creating an instance of the class and
calling the add method with two arguments, then it checks that the result is equal to 3 using the assertequals
method.
Junit is widely used to test java applications because it is simple to use, it has a rich set of features and it is well-
documented.
Testng listeners
In testng, listeners are objects that implement certain interfaces and can be registered to receive events during
the execution of a test suite. Listeners can be used to perform additional actions before or after a test method
is executed, or to perform custom logging or reporting.
There are several types of listeners in testng, such as:
Itestlistener: this interface provides callbacks for the events that occur before and after a test method is run,
as well as on test failure or test success.
Iinvokedmethodlistener: this interface provides callbacks for the events that occur before and after a test
method is invoked.
Iannotationtransformer: this interface allows to modify test class or test method annotations before they are
processed by testng.
Iexecutionlistener: this interface provides callbacks for global events, such as the start and end of a test suite.
Once you've created a listener class, you can register it with testng by adding it to the testng.xml file or by using
the listeners annotation:
You can also register multiple listeners at the same time, by adding them to a list, and use the listeners
annotation.
Functional and non-functional testing
Functional testing and non-functional testing are two types of testing that are used to evaluate the quality of
software.
Functional testing is a type of testing that focuses on the functionality of the software and ensures that it works
as intended. It is used to validate that the software meets the requirements and specifications. Functional tests
are often written to cover specific scenarios and use cases, and they are typically automated. Examples of
functional testing include unit testing, integration testing, and acceptance testing.
Non-functional testing is a type of testing that focuses on the non-functional aspects of the software, such as
performance, security, usability, and compatibility. It is used to evaluate the software's behavior in a production-
like environment and to ensure that it can handle the expected load and usage. Non-functional tests are often
automated and they may require specialized testing tools. Examples of non-functional testing include load
testing, stress testing, security testing, and usability testing.
Functional testing and non-functional testing are complementary, and both are important to ensure that the
software is of high quality and fit for purpose. Functional testing ensures that the software works as intended,
while non-functional testing ensures that the software can handle the expected usage and is suitable for
production.
UAT and sit test cases
UAT (user acceptance testing) and sit (system integration testing) are two different types of testing that are used
to evaluate the quality of software.
UAT is a type of testing that focuses on the end-user's perspective and ensures that the software meets their
needs and is fit for purpose. It is usually performed by a team of business users, who test the software against
the acceptance criteria and business requirements. UAT tests are typically manual, and they involve testing the
software in a realistic environment to ensure that it works as intended. The goal of uat is to ensure that the
software is ready for release and meets the needs of the business.
Sit is a type of testing that focuses on the integration of different system components and ensures that they
work together as a cohesive whole. It is usually performed by a team of developers and testers, who test the
software against the integration requirements. Sit tests are typically automated and they involve testing the
software in a controlled environment to ensure that it works as intended. The goal of sit is to ensure that the
different system components integrate correctly and that there are no integration issues.
UAT and sit tests are complementary, and both are important to ensure that the software is of high quality and
fit for purpose. UAT tests ensure that the software meets the needs of the business, while sit tests ensure that
the different system components integrate correctly. Both uat and sit tests should be planned and executed in
parallel or in a phased manner to ensure that the software meets the needs of the business and is ready for
release.
Brief about testng
Testng is a testing framework for the java programming language that is inspired by junit and nunit. It is
designed to be more powerful and flexible than junit, and it is widely used for unit, functional, and integration
testing.
Some of the key features of testng include:
Support for annotations, which make it easy to configure test methods and test classes
Support for data-driven testing, which allows you to run a test method multiple times with different data sets
Support for test groups, which allows you to organize and run tests based on their functional or technical
characteristics
Support for test dependencies, which allows you to specify that a test method must be run after or before
another test method
Support for test listeners, which allow you to perform additional actions before or after a test method is
executed
Support for test reporting, which provides detailed information about the results of a test run
Support for test configuration, which allows you to specify test-specific configurations such as test suite, test
class and test method level configuration
Testng can be integrated with popular build tools like maven and gradle, as well as with continuous integration
servers like jenkins. It also can be integrated with other test libraries like selenium, appium etc.
Testng is widely used in the industry and is considered a powerful tool for automating software tests. It is open-
source and actively maintained by a community of developers.
Brief about Maven
Maven is a build automation tool primarily used for java projects. It is an open-source tool developed by apache
software foundation. It is used to manage the build, dependencies, and documentation of a project.
Maven provides a standard way to build a project and manage its dependencies. It uses a declarative approach
to specify the project's build and dependencies in an xml file called the pom.xml. This file contains information
such as the project's group and artifact id, dependencies, build plugins, and other project-related information.
Maven uses a centralized repository to manage dependencies and plugins. This repository contains a wide range
of java libraries, frameworks and plugins that can be easily included in a project by specifying them in the
pom.xml file. By default, maven uses the maven central repository, but it can also be configured to use a
different repository.
Maven also provides a set of standard lifecycle phases that a project goes through, such as compile, test, package,
and deploy. This allows developers to automate the build process and ensures that the project is built in a
consistent and reproducible way.
Maven provides a lot of useful plugins that can be used in the build process. For example, the surefire plugin
is used for executing unit tests, the jacoco plugin is used for code coverage, and the pmd plugin is used for code
analysis.
Maven is widely used in the industry, and it is considered a powerful tool for automating software builds. It is
easy to use, has a large user community and many plugins available to use, making it a useful tool for build
automation.
Brief about SoapUI
Soapui is a free and open-source tool that is used for functional and non-functional testing of web services,
including soap and rest apis. It allows developers and testers to create, execute and analyze the results of web
service tests in a user-friendly interface.
Some of the key features of soapui include:
Support for creating and executing functional tests for soap and rest web services
Support for creating and executing load tests and security tests
Support for simulating web services, including the ability to create mock services
Support for creating and executing tests in a continuous integration environment
Support for data-driven testing and parameterization
Support for creating and executing tests in parallel
Support for creating and executing tests in different environments
Support for creating and executing tests in different languages

Soapui also supports a variety of protocols like soap, rest, jms, amf, jdbc, and http. It also supports different
data formats like xml, json, and csv.
Soapui can be integrated with popular build tools like maven and gradle, as well as with continuous integration
servers like jenkins. It is also integrated with other test libraries like selenium, appium etc.
Soapui is widely used in the industry and is considered a powerful tool for automating web service tests. It is
open-source and actively maintained by a community of developers.
Soap and REST APIs
Soap (simple object access protocol) and rest (representational state transfer) are two different types of web
service architectures.
Soap is a protocol for exchanging structured data between applications over the internet. It is based on xml and
uses a variety of messaging formats, such as http, smtp, and TCP, to transport data. Soap web services are
typically more complex and heavyweight than rest web services, and they often require more resources to
implement and consume. They also require more bandwidth due to their xml payloads.
Rest is an architectural style for building web services that are lightweight and easy to implement and consume.
Rest web services use http methods like get, post, put, and delete to retrieve and manipulate data. Rest web
services are typically faster and more scalable than soap web services because they use less bandwidth and are
less resource-intensive. They also return data in a format that is more easily consumable by clients, such as json.
While soap is a protocol and rest is an architectural style, it is common to use http as transport protocol for
rest web services and soap messages are often wrapped in an http post request. The choice of whether to use
soap or rest depends on the specific requirements of the application and the resources available to implement
and consume the web service. In general, rest web services are more popular due to their simplicity and
scalability, but soap web services can be a better choice for applications that require advanced security features.
what is assertion
An assertion is a statement in code that checks whether a certain condition is true or false. If the condition is
false, the code will raise an error, typically called an "assertion error," to indicate that something unexpected
has occurred. Assertions are often used to test the assumptions that a programmer makes about the behavior
of their code, and can be useful for debugging and detecting potential issues.
what is hard and soft assertion
A hard assertion is an assertion that stops the execution of the test case if the assertion fails. It means that if
the test case fails on a hard assertion, the execution of the test case will be terminated immediately and no
further steps will be executed. It will also make the test case failure immediately.
On the other hand, a soft assertion is an assertion that does not stop the execution of the test case if the
assertion fails. It means that if the test case fails on a soft assertion, the execution of the test case will
continue and the next steps will be executed. It will not make the test case failure immediately and it will be
considered as failure only at the end of the test case execution.
In Selenium, the assert method is a hard assertion, while the verify method is a soft assertion. The specialized
assertion libraries also support both hard and soft assertion, which can be useful in different situations,
depending on the requirements of the test case.
Hard assertion is useful when you have a test case that needs to fail if a specific condition is not met, and soft
assertion is useful when you want to check multiple conditions in a test case, and you want to see the overall
results at the end of the test case, instead of stopping the execution as soon as a failure is encountered.

what is bug life cycle


The bug life cycle, also known as the defect life cycle, is the process that a bug or defect goes through from
its initial report to its resolution. The exact stages of the bug life cycle may vary depending on the
organization or methodology, but it generally includes the following stages:
New: The bug is reported and entered into the bug tracking system as a new issue.
Assigned: The bug is assigned to a developer or tester for investigation and resolution.
In Progress: The developer or tester is working on reproducing and analyzing the bug.
Fixed: The developer or tester has identified the cause of the bug and has created a fix for it.
Retested: The fix is tested to ensure that it resolves the issue and does not introduce any new problems.
Closed: The bug is closed as resolved, and the fix is deployed to the production environment.
Reopened: If the bug is found to still exist after the fix is deployed, the bug can be reopened and moved back
to an earlier stage of the bug life cycle.
This is a general overview of the bug life cycle, some organizations have more stages or different naming
conventions, but this is the basic process that allows to track and report issues in a software development
process.
what is annotations
In programming, annotations are a way to add metadata to code, typically in the form of comments or special
notations. They are used to provide additional information about the code, such as its purpose, usage, or
behavior.
Annotations are typically used to provide information that can be used by other tools or frameworks, such as
testing frameworks, build systems, or documentation generators. For example, in Java, annotations can be
used to provide information about how a class or method should be used, or to indicate that a certain class or
method should be used in a specific way by a framework.
In TestNG, annotations are used to indicate the methods that should be run as tests, and to configure how
those tests should be run. Some examples of annotations used in TestNG are:
@Test: Indicates that the method is a test method.
@BeforeMethod: Indicates that the method will be run before each test method.
@AfterMethod: Indicates that the method will be run after each test method.
@BeforeClass: Indicates that the method will be run before the first test method in the current class is
invoked.
@AfterClass: Indicates that the method will be run after all the test methods in the current class have been
run.
@DataProvider: Indicates that the method will return an object that will be used by test methods to get the
data.
Annotations can also be used to provide additional information about the test case such as priority, expected
exception, etc.
In summary, annotations are a way to add metadata to code, they provide additional information about the
code, that can be used by other tools or frameworks. In TestNG, annotations are used to indicate the
methods that should be run as tests and to configure how those tests should be run.
what is desired capabilities
Desired Capabilities is a term used in Selenium to refer to a set of properties that define the browser and its
settings that you want to use for your test. It allows you to configure various options for the browser, such as
the browser type, the version, and the platform. It also allows you to set options for browser extensions,
proxy settings and many more.
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities

# Set the desired capabilities


caps = DesiredCapabilities.CHROME
caps['browserName'] = 'chrome'
caps['version'] = '83.0'
caps['platform'] = 'Windows 10'

# Start the browser


driver = webdriver.Remote(
command_executor='http://127.0.0.1:4444/wd/hub',
desired_capabilities=caps)

# Navigate to a website
driver.get("https://www.example.com")

# Close the browser


driver.quit()

implicit and explicit wait


In Selenium, there are two types of waits that can be used to handle dynamic web pages: implicit wait and
explicit wait.
Implicit Wait: An implicit wait is a type of wait that is set globally for the entire web driver instance. Once
set, the implicit wait is applied to all elements that are located by the web driver. It tells the web driver to poll
the DOM for a certain amount of time when trying to find an element or elements if they are not
immediately available. The default setting is 0, meaning that the web driver will not wait at all. An implicit
wait can be set using the webdriver.manage().timeouts().implicitlyWait() method.
Explicit Wait: An explicit wait is a type of wait that is set for a specific element or elements. It tells the web
driver to wait for a certain condition to be met before proceeding with the next step. It is more flexible than
an implicit wait, since it can be set for specific elements and can be used with different conditions. The
WebDriverWait class and the ExpectedConditions class are used to set an explicit wait.

You might also like