Google search engine
Home Blog Page 67

Defect/Bug Life Cycle in Flutter

0

Hi everyone! today we explore the Defect / Bug life cycle In Flutter. The Defect Life Cycle, also known as the Bug Life Cycle, is a cycle of defects that it goes through covering the different states in its entire life. This starts as soon as any new defect is found by a tester and comes to an end when a tester closes that defect assuring that it won’t get reproduced again.

If you’re looking for the best Flutter app development company for your mobile application then feel free to contact us at — support@flutterdevs.com.


Table Of Contents::

What is Defect/Bug?

What is Defect Life Cycle?

Defect Status

Defect Life Cycle Explained

Tips to write a good bug report!

Good bug reports contain

Conclusion


What is Defect/Bug?

A defect is an error or a bug, in the application which is created. A programmer while designing and building the software can make mistakes or errors. These mistakes or errors mean that there are flaws in the software. These are called defects.

What is Defect Life Cycle?

Defect Life Cycle or Bug Life Cycle in software testing is the specific set of states that a defect or bug goes through in its entire life. The purpose of the Defect life cycle is to easily coordinate and communicate the current status of defects which changes to various assignees and makes the defect fixing process systematic and efficient.

Defect Status:

Defect Status or Bug Status in the defect life cycle is the present state from which the defect or a bug is currently undergoing. The goal of defect status is to precisely convey the current state or progress of a fault or bug to better track and understand the actual progress of the defect life cycle.

The number of states that a defect goes through varies from project to project. Below lifecycle diagram, covers all possible states

  • New: When a new defect is logged and posted for the first time. It is assigned a status as NEW.
  • Assigned: Once the bug is posted by the tester, the lead of the tester approves the bug and assigns the bug to the developer team
  • Open: The developer starts analyzing and works on the defect fix
  • Fixed: When a developer makes a necessary code change and verifies the change, he or she can make the bug status “Fixed.”
  • Pending retest: Once the defect is fixed the developer gives a particular code for retesting the code to the tester. Since the software testing remains pending from the tester’s end, the status assigned is “pending retest.”
  • Retest: The tester does the retesting of the code at this stage to check whether the defect is fixed by the developer or not and changes the status to “Re-test.”
  • Verified: The tester re-tests the bug after it got fixed by the developer. If there is no bug detected in the software, then the bug is fixed and the status assigned is “verified.”
  • Reopen: If the bug persists even after the developer has fixed the bug, the tester changes the status to “reopened”. Once again the bug goes through the life cycle.
  • Closed: If the bug no longer exists then the tester assigns the status “Closed.”
  • Duplicate: If the defect is repeated twice or the defect corresponds to the same concept of the bug, the status is changed to “duplicate.”
  • Rejected: If the developer feels the defect is not genuine then it changes the defect to “rejected.”
  • Deferred: If the present bug is not of a prime priority and if it is expected to get fixed in the next release, then the status “Deferred” is assigned to such bugs
  • Not a bug: If it does not affect the functionality of the application then the status assigned to a bug is “Not a bug”.

Defect Life Cycle Explained:

  • Tester finds the defect
  • The status assigned to defect- New
  • A defect is forwarded to the Project Manager for analyze
  • The project Manager decides whether a defect is valid
  • Here the defect is not valid- a status is given as “Rejected.”
  • So, the project manager assigns a status rejected. If the defect is not rejected then the next step is to check whether it is in scope. Suppose we have another function- email functionality for the same application, and you find a problem with that. But it is not a part of the current release when such defects are assigned as a postponed or deferred status.
  • Next, the manager verifies whether a similar defect was raised earlier. If yes defect is assigned a status duplicate.
  • If no the defect is assigned to the developer who starts fixing the code. During this stage, the defect is assigned a status in progress.
  • Once the code is fixed. A defect is assigned a status fixed
  • Next, the tester will re-test the code. In case, the test case passes the defect is closed. The defect is re-opened and assigned to the developer if the test cases fail again.
  • Consider a situation where during the 1st release of Flight Reservation a defect was found in the Fax order that was fixed and assigned a status closed. During the second upgrade release, the same defect again resurfaced. In such cases, a closed defect will be re-opened.

Tips to write a good bug report!:

One of the most important skills that you need to have in your tester’s toolbox is the ability to write a good bug report. Finding defects is only part of the job because if developers can’t reproduce the bugs you find, they will have a very tough time fixing them. Your bug tracking software should include several mandatory fields to ensure that testers give a complete account of the defect they encountered. And testers should hone their descriptive skills.

Good bug reports contain:

  • > Descriptive Title — Everything starts with a title. It must be clear and descriptive so that you get an idea of what it is about at a glance.
  • > Concise Description — Try to remain clear and concise in your description. Describing something accurately and concisely is a skill that develops with practice. Remember that the person reading your description has not seen the bug and try not to make assumptions.
  • > Expected Results — You have to make it clear what you expected to happen and how the defect diverged from that expectation. This field helps to prevent any misunderstandings, and it gives the developer a clear idea of what went wrong.
  • > Details about the project and version — It’s not unusual for testers to work on multiple projects at the same time, and sometimes they’ll share a database, so ensuring that your bug is listed in the correct project, and section within that project, is vital. You also need to get the software version right. Sometimes a bug will be fixed when a different defect is addressed, or simply by some change in the newest version of the software. If the version is wrong, developers may be embarking on a wild goose chase.
  • > Platform Details — Any background information you can provide about your environment will help developers track that bug down. What device were you using? What operating system was it running? What model was it? What browser did you use? Every detail you can give about the platform will help.

For Example Device Type, Model, Browser Version, and OS Version.

  • > Defect Type and Severity — These fields go hand-in-hand. A functional bug will generally be treated more seriously than a suggestion. Developers also need to know how severe the bug is. No product ships with zero defects, so having bugs categorized correctly in terms of type and severity helps the decision-making process about what gets fixed and what doesn’t. So it is always better to mention the Priority and Severity of the Bugs.
  • > Steps to Reproduce (this is very important!) — You want to give a step-by-step account of exactly what you did to find any defect. Sometimes you can use software tools that catch your keystrokes, or record screenshots or video files as you test, other times you will be writing from memory, so take notes as you go. Make sure that you test your steps again before submitting the bug.

Indicate reproducibility as well. Sometimes you’ll be confident about your steps, but upon repeating them the bug won’t necessarily occur. If it happens every time, at random, or only once, then the developer needs to know that.

  • > Visual Attachment — Supporting material is always gratefully received by those tasked with fixing defects. Usually, these will be screenshots, but they can include audio and video files. Keep in mind this is often what developers look at first, before reading the text you provided. If you can convey the issue in a single screenshot, you’re helping save precious time!
  • > Tags & Links — It can be a good idea to use descriptive tags that enable you to filter the database and find groups of related bugs. Sometimes you’ll want to include another bug ID or a link within your defect report to something that you feel is strongly related or similar, but not similar enough to be a duplicate.
  • > Assignee — It’s usually going to be up to the lead developer or management to assign bugs, but on occasion, you might receive instructions about who to assign them to. Leaving unassigned or wrongly assigned bugs in the database is a dangerous thing because they can potentially slip through the cracks. Make sure you’re clear on the expectations for assigning.
  • Put it all together — Bring all of this together and you should have a good bug report. If you’re uncertain about the quality of your bug reports ask for feedback. A quick chat with the developers can help you understand what they need.

Conclusion:

This is all about the Defect Life Cycle and Management. We hope you must have gained immense knowledge about the life cycle of a defect. This Blog will, in turn, help you while working with the defects in the future in an easy manner.

❤ ❤ Thanks for reading this article ❤❤

If I got something wrong? Let me know in the comments. I would love to improve.

Clap 👏 If this article helps you.


From Our Parent Company Aeologic

Aeologic Technologies is a leading AI-driven digital transformation company in India, helping businesses unlock growth with AI automation, IoT solutions, and custom web & mobile app development. We also specialize in AIDC solutions and technical manpower augmentation, offering end-to-end support from strategy and design to deployment and optimization.

Trusted across industries like manufacturing, healthcare, logistics, BFSI, and smart cities, Aeologic combines innovation with deep industry expertise to deliver future-ready solutions.

Feel free to connect with us:
And read more articles from FlutterDevs.com.

FlutterDevs team of Flutter developers to build high-quality and functionally-rich apps. Hire a flutter developer for your cross-platform Flutter mobile app project on an hourly or full-time basis as per your requirement! For any flutter-related queries, you can connect with us on Facebook, GitHub, Twitter, and LinkedIn.

We welcome feedback and hope that you share what you’re working on using #FlutterDevs. We truly enjoy seeing how you use Flutter to build beautiful, interactive web experiences.


BioMetric Authentication In Flutter Application

0

Hello Everyone! today my writing a blog about security or we can say privacy. In this blog, we learn how to add fingerprint authentication to our flutter application in a very easy way. As a developer, I think bio-metrics is very safe. In this blog, we learn how to implement BioMetric Authentication in Flutter Application.

For BioMetric Authentication, we need our local database by which we can check the fingerprint.

We use many types of bio-metric :

  • BiometricType.face
  • BiometricType.fingerprint
  • BiometricType.weak
  • BiometricType.strong

If you’re looking for the best Flutter app development company for your mobile application then feel free to contact us at — support@flutterdevs.com.


Table Of Contents:

Implementation

Conclusion

GitHub Link


Implementation:

First, we have to create a new For BioMetric Authentication first we need to add dependencies in pubspec. ymal which is local_auth.dependencies:
local_auth: ^1.1.10

|> local_auth: This Flutter plugin gives the means to perform local, on-device user authentication. Import the following file into your StatefulWidget class.

import 'package:local_auth/local_auth.dart';

This includes authentication with biometrics such as fingerprint or facial recognition on supported devices. It supports Android, IOS, and Windows. For local_auth we have to check the capabilities of the device.


>Device capabilities: If we want to use Fingerprint Authentication we have to check the capability of our device for check the capability, we should call canCheckBiometrics()or isDeviceSupport()

import 'package:local_auth/local_auth.dart';
final LocalAuthentication auth = LocalAuthentication();
final bool canAuthenticateWithBiometrics = await auth.canCheckBiometrics;
final bool canAuthenticate = canAuthenticateWithBiometrics || await auth.isDeviceSupported();

canCheckBiometric() only designate whether hardware support is available, not whether the device has any biometrics enrolled. To get a list of enrolled biometrics, call getAvailableBiometrics().

This plugin will build and run on SDK 16+, but isDeviceSupported()will always return false before SDK 23.


> Dialogs:

The plugin provides default dialog’s for the following cases:

  1. Passcode/PIN/Pattern Not Set: The user has not yet configured a passcode on iOS or a PIN/pattern on Android.
  2. Bio-metrics Not Enrolled: The user has not enrolled in any biometrics on the device.
import 'package:local_auth/error_codes.dart' as auth_error;
try {
final bool didAuthenticate = await auth.authenticate(
localizedReason: 'Please authenticate to show account balance',
options: const AuthenticationOptions(useErrorDialogs: false));
} on PlatformException catch (e) {
if (e.code == auth_error.notAvailable) {
// Add handling of no hardware here.
} else if (e.code == auth_error.notEnrolled) {
} else {}
}

If you want to edit dialog, so you can pass AuthMessages for each platform in which you want to edit the message.

import 'package:local_auth_android/local_auth_android.dart';
import 'package:local_auth_ios/local_auth_ios.dart';
final bool didAuthenticate = await auth.authenticate(
localizedReason: 'Please authenticate to show account balance',
authMessages: const <AuthMessages>[
AndroidAuthMessages(
signInTitle: 'Oops! Biometric authentication required!',
cancelButton: 'No thanks',
),
IOSAuthMessages(
cancelButton: 'No thanks',
),
]);

>IOS Integration:

You need to add these lines in Info. plist file. Failure to do so results in a dialog that tells the user your app has not been updated to use Face ID.

<key>NSFaceIDUsageDescription</key>
<string>Why is my app authenticating using face id?</string>

>Android Integration:

  • If you are using FlutterActivity directly, change it to FlutterFragmentActivity in your AndroidManifest.xml.
  • If you are using a custom activity, update your MainActivity.java
import io.flutter.embedding.android.FlutterFragmentActivity;
public class MainActivity extends FlutterFragmentActivity {
}

or MainActivity.

import io.flutter.embedding.android.FlutterFragmentActivity
class MainActivity: FlutterFragmentActivity() {
}

we also permit using local_auth, add these lines in AndroidManifest.xml.

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.app">
<uses-permission android:name="android.permission.USE_BIOMETRIC"/>
<manifest>

To check if local authentication is available on this device.

Future<void> _checkBiometric() async {
bool canCheckBiometric = false;

try {
canCheckBiometric = await auth.canCheckBiometrics;
} on PlatformException catch (e) {
print(e);
}

if (!mounted) return;
setState(() {
_canCheckBiometric = canCheckBiometric;
}
);
}

We create a final variable with the name auth in which we pass LocalAuthentication().

final auth = LocalAuthentication();

To get the list of enrolled biometrics on this device we create a list which is biometricType.

Future _getAvailableBiometric() async {
List<BiometricType> availableBiometric = [];

try {
availableBiometric = await auth.getAvailableBiometrics();
} on PlatformException catch (e) {
print(e);
}

setState(() {
_availableBiometric = availableBiometric;
});
}

Also create a String variable to inspect the biometric, whether it’s successful or unsuccessful. Then we create a method, and in the starting, we pass authenticated as false. and after that, we define authentication with biometrics.

And use the parameters of it, localizedReason in which we define the string, set useErrorDialogs as true, and also set stickyAuth as true. in this method, we also check whether the bio-metric is authenticated or not.

Future<void> _authenticate() async {
bool authenticated = false;
try {
authenticated = await auth.authenticateWithBiometrics(
localizedReason: "Scan your finger to authenticate",
useErrorDialogs: true,
stickyAuth: true);
} on PlatformException catch (e) {
print(e);
}
setState(() {
authorized =
authenticated ? "Authorized success" : "Failed to authenticate";
print(authorized);
});
}

After creating all these methods, call these methods to initState().

@override
void initState() {
_checkBiometric();
_getAvailableBiometric();

super.initState();
}

Let’s come to UI part, In UI part return the scaffold in buildContext. add gave the background color of the Screen. In the body of the Scaffold pass Column(), take text as children,

and pass Login text. Create a FloatingActionButton and pass _authenticate at onPressed.

@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.blueGrey.shade600,
body: Padding(
padding: const EdgeInsets.symmetric(vertical: 12.0, horizontal: 24.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Center(
child: Text(
"Login",
style: TextStyle(
color: Colors.white,
fontSize: 48.0,
fontWeight: FontWeight.bold,
),
),
),
Container(
margin: const EdgeInsets.symmetric(vertical: 50.0),
child: Column(
children: [
Container(
margin: const EdgeInsets.symmetric(
vertical: 15.0),
child: const Text(
"Authenticate using your fingerprint instead of
your password",
textAlign: TextAlign.center,
style: TextStyle(color: Colors.white,
height: 1.5),
),
),
Container(
margin: const EdgeInsets.symmetric(
vertical: 15.0),
width: double.infinity,
child: FloatingActionButton(
onPressed: _authenticate,
elevation: 0.0,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(30.0),
),
child: const Padding(
padding: EdgeInsets.symmetric(
horizontal: 24.0, vertical: 14.0),
child: Text(
"Authenticate",
style: TextStyle(color: Colors.white),
),
),
),
)
],
),
)
],
),
),
);
}

When we run the application, we ought to get the screen’s output like the underneath screen capture.

Final Output

Conclusion:-

In this article, we have been through why Bio-metric is important and how to implement this in any Flutter Project. And also learn the importance of local_auth and how many types of Bio-metric are in this package.

❤ Thanks for reading this article ❤❤

If I got something wrong? Let me know in the comments. I would love to improve.

Clap 👏 If this article helps you.


GitHub Link:

Find the source code of the Fingerprint Authentication In Flutter Application :

GitHub – flutter-devs/biometric_authentication_flutter
You can’t perform that action at this time. You signed in with another tab or window. You signed out in another tab or…github.com
.


From Our Parent Company Aeologic

Aeologic Technologies is a leading AI-driven digital transformation company in India, helping businesses unlock growth with AI automation, IoT solutions, and custom web & mobile app development. We also specialize in AIDC solutions and technical manpower augmentation, offering end-to-end support from strategy and design to deployment and optimization.

Trusted across industries like manufacturing, healthcare, logistics, BFSI, and smart cities, Aeologic combines innovation with deep industry expertise to deliver future-ready solutions.

Feel free to connect with us:
And read more articles from FlutterDevs.com.

FlutterDevs team of Flutter developers to build high-quality and functionally-rich apps. Hire a flutter developer for your cross-platform Flutter mobile app project on an hourly or full-time basis as per your requirement! You can connect with us on Facebook, GitHub, Twitter, and LinkedIn for any flutter-related queries.

We welcome feedback and hope that you share what you’re working on using #FlutterDevs. We truly enjoy seeing how you use Flutter to build beautiful, interactive web experiences.


Retesting In Flutter

0

Hi everyone! today we explore Retesting In Flutter. Retesting is used when there is any specific error or bug which needs to be verified. It is used when the bug is rejected by the developers then the testing department tests whether that bug is actual or not. It is also used to check the whole system to verify the final functionality.

If you’re looking for the best Flutter app development company for your mobile application then feel free to contact us at — support@flutterdevs.com.


Table Of Contents::

What is Retesting?

Characteristics of Retesting

Process of Retesting

When Do We Do Re-testing

Use of Re-testing in Software Testing

An instance of Retesting

Advantages of Retesting

Disadvantages of Retesting

Conclusion


What is Retesting?

Retesting is a procedure where we need to check that particular test cases which are found with some bugs during the execution time. Retesting also occurs when the product is already tested and due to some problems it needs to be tested again. This test is named retesting.

Retesting depends on the developer department whether they are going to accept the bug testing or reject it. Retesting is done when there is a specific bug when the bug is rejected by the developer and the tester department needs to test the issues when the user reports a problem for retesting and fixing an issue for better application and better workflow.

Characteristics of Retesting:

  • It is a copy of testing which are done with the same files and processes in a new build.
  • Retesting can only be implemented when particular test cases are involved which are considered failed tests.
  • It takes the surety of successful tests and working flow as it has to be.
  • During execution time whenever any bug occurs and that test is declined by the developer, in that situation the testers department tests that file and they try to find the actual issue they also do the retesting of that bug to make sure whether that bug is actual or not.
  • Sometimes the whole program needs to be retested to verify its quality of the program.
  • The cases which are being retested cannot be computerized.

Process of Retesting:

As per the Bug Life Cycle, once a tester found a bug, the bug is reported to the Development Team. The status of the Bug should be “New”. The Development Team may accept or reject the bug.

If the development team accepts the bug then they do fix it and release it in the next release. The status of the bug will be “Ready For QA”. Now the tester verifies the bug to find out whether it is resolved or not. This testing is known as retesting. Retesting is planned testing.

We do use the same test cases with the same test data which we used in the earlier build. If the bug is not found then we do change the status of the bug to “Fixed” else we do change the status to “Not Fixed” and send a Defect Retesting Document to the development team.

When Do We Do Re-testing:

  1. When there is a particular bug fix specified in the Release Note:
    Once the development team releases the new build, then the test team has to test the already posted bugs to make sure that the bugs are fixed or not.
  2. When a Bug is rejected:
    At times, the development team refuses a few bugs which were raised by the testers and mentions the status of the bug as Not Reproducible. In this case, the testers need to retest the same issue to let the developers know that the issue is valid and reproducible.
  3. When a Client calls for a retesting:
    At times, the Client may request us to do the test again to gain confidence in the quality of the product. In this case, test teams do test the product again.

Use of Re-testing in Software Testing:

  • Retesting is used when there is any specific error or bug which needs to be verified.
  • It is used when the bug is rejected by the developers then the testing department tests whether that bug is actual or not.
  • It is also used to check the whole system to verify the final functionality.
  • It also checks the quality of a specific part of a system.
  • When some user demands to retest their system.

An instance of Retesting:

Let’s assume that there is an application that maintains the details of all the students in school. This application has four buttons Add, Save, Delete and Refresh. All the other buttons’ functionality is working as expected but clicking on the ‘Save’ button is not saving the details of the student. This is a bug that is caught by the tester and he raised it. This issue is assigned to the developer and he fixes it. Post fixing the issue it’s again assigned to the tester. This time tester tested only the ‘Save’ button functionality. This is called retesting.

Advantages of Retesting:

  • Retesting ensures that the bug is being fixed completely and working successfully according to the user.
  • It enhances the quality of the product or application.
  • The bug can be fixed in a short period as it targets a particular issue.
  • Retesting doesn’t require any specific or other software for testing.
  • It can perform with the same data and the same process with a new build for its execution.

Disadvantages of Retesting:

  • Retesting needs a new build for the qualifying verification process of the bug.
  • If the testing process is started then at that time, the test cases of the retesting can be obtained but not previously.
  • At the time of testing, retesting cannot be computerized.
  • When the retesting results are unsuccessful, it requires more time and effort for fixing all the issues.

Conclusion:

Retesting is an important and required testing type assuring system reliability and flawlessness. It confirms that failed test cases have been solved giving relief to not only testing and development teams but also to the client.

We hope this tutorial was beneficial in understanding the ‘Retesting’ concept. For any queries or suggestions, please let us know in the comments.

❤ ❤ Thanks for reading this article ❤❤

If I got something wrong? Let me know in the comments. I would love to improve.

Clap 👏 If this article helps you.


From Our Parent Company Aeologic

Aeologic Technologies is a leading AI-driven digital transformation company in India, helping businesses unlock growth with AI automation, IoT solutions, and custom web & mobile app development. We also specialize in AIDC solutions and technical manpower augmentation, offering end-to-end support from strategy and design to deployment and optimization.

Trusted across industries like manufacturing, healthcare, logistics, BFSI, and smart cities, Aeologic combines innovation with deep industry expertise to deliver future-ready solutions.

Feel free to connect with us:
And read more articles from FlutterDevs.com.

FlutterDevs team of Flutter developers to build high-quality and functionally-rich apps. Hire a flutter developer for your cross-platform Flutter mobile app project on an hourly or full-time basis as per your requirement! For any flutter-related queries, you can connect with us on Facebook, GitHub, Twitter, and LinkedIn.

We welcome feedback and hope that you share what you’re working on using #FlutterDevs. We truly enjoy seeing how you use Flutter to build beautiful, interactive web experiences.


Difference Between Verification and Validation In Flutter

0

Hi everyone! today we learn about Verification and Validation In Flutter. Verification and validation to assure that a software system meets a user’s needs. Verification: “Are we building the product right?” The software should conform to its specification. Validation: “Are we building the right product?” The software should do what the user requires.

If you’re looking for the best Flutter app development company for your mobile application then feel free to contact us at — support@flutterdevs.com.


Table Of Contents::

What is Verification in Software Testing?

Advantages of Verification Testing

When to use Verification Testing

What is Validation in Software Testing?

Advantages of Validation Testing

When to use Validation Testing;

KEY DIFFERENCE

Example of Verification and Validation

Conclusion



What is Verification in Software Testing?

Verification in Software Testing is a process of checking documents, design, code, and program to check if the software has been built according to the requirements or not.

The main goal of the verification process is to ensure the quality of software application, design, architecture, etc. The verification process involves activities like reviews, walk-throughs, and inspections.

Advantages of Verification Testing:

  • Early and frequent verification reduces the number of bugs and defects that may show up in later stages.
  • By verifying at each stage, devs, product managers, and stakeholders can get more insight into what the product may need to be developed better in the coming stages.
  • Even if they can’t solve all bugs immediately, verifying helps QAs estimate the kind of issues that might emerge and help them better prepare to handle those when they appear.
  • Verification helps keep software closely aligned with customers and business requirements at every stage. This ensures that devs have to put in less unnecessary work as development continues.

When to use Verification Testing:

Verification tests must be run at every stage of development before any feature is implemented.

For example, let’s consider a button labeled “Add to Cart”. Before starting with creating this button, verification tests would look through all relevant requirements previously decided in the ideation and brainstorming phases.

Let’s say the documentation says the button must be black with the lettering in white. It should be no larger than 10mm X 10mm, and it should be constantly visible in the top right corner of every product page of the website. Another button with the same text, color, and dimensions should be placed under every product on the page.

Before creating the button, design and requirements documents must be reviewed, and all necessary specifications must be listed before work begins. This must be done before working on every feature or element on the page so the devs do not miss any guidelines.

What is Validation in Software Testing?

Validation in Software Engineering is a dynamic mechanism of testing and validating if the software product meets the exact needs of the customer or not.

The process helps to ensure that the software fulfills the desired use in an appropriate environment. The validation process involves activities like unit testing, integration testing, system testing, and user acceptance testing.

Advantages of Validation Testing:

  • Any bugs missed during verification will be detected while running validation tests.
  • If specifications were incorrect and inadequate from the beginning, validation tests would reveal their inefficacy. Teams will have to spend time and effort fixing them, but it will prevent a bad product from hitting the market.
  • Validation tests ensure that the product matches and adheres to customer demands, preferences, and expectations under different conditions (slow connectivity, low battery, etc.)
  • These tests are also required to ensure that the software functions flawlessly across different browser-device-OS combinations. In other words, it authenticates software for cross-browser compatibility.

When to use Validation Testing;

Validation tests must be run after every feature or step in the development process is completed. For example, unit tests, a form of validation tests, are run after every unit of code has been created. Integration tests are run after multiple modules have been completed individually and are ready to be combined.

An important element of validation testing is the running of cross-browser testing. QAs must check that every function, feature, and design element appears and functions as expected on different browser-device-os combinations. For example, does the “Add to Cart” button show up and work perfectly on Chrome-Samsung Galaxy A23 and Safari-iPhone X?

KEY DIFFERENCE:

  • The verification process includes checking documents, design, code, and program whereasthe Validation process includes testing and validation of the actual product.
  • Verification does not involve code execution while Validation involves code execution.
  • Verification uses methods like reviews, walkthroughs, inspections, and desk-checking whereas Validation uses methods like black box testing, white box testing, and non-functional testing.
  • Verification checks whether the software confirms a specification whereas Validation checks whether the software meets the requirements and expectations.
  • Verification finds the bugs early in the development cycle whereas Validation finds the bugs that verification can not catch.
  • Comparing validation and verification in software testing, the Verification process targets on software architecture, design, database, etc. while the Validation process targets the actual software product.
  • Verification is done by the QA team while Validation is done by the involvement of the testing team with the QA team.
  • Comparing Verification vs Validation testing, the Verification process comes before validation whereas the Validation process comes after verification.

Example of Verification and Validation:

Now, let’s take an example to explain verification and validation planning:

  • In Software Engineering, consider the following specification for verification testing and validation testing,

A clickable button with name Submet

  • Verification would check the design doc and correct the spelling mistake.
  • Otherwise, the development team will create a button like

Example of Verification

  • So the new specification is
  • A clickable button with the name Submit
  • Once the code is ready, Validation is done. A Validation test found –

Example of Validation

  • Owing to Validation testing, the development team will make the submit button clickable

Conclusion:

Verification and validation are crucial parts of the development life cycle of an embedded system. Verification starts from the requirements analysis stage where design reviews and checklists are used to the validation stage where functional testing and environmental modeling are done.

❤ ❤ Thanks for reading this article ❤❤

If I got something wrong? Let me know in the comments. I would love to improve.

Clap 👏 If this article helps you.


From Our Parent Company Aeologic

Aeologic Technologies is a leading AI-driven digital transformation company in India, helping businesses unlock growth with AI automation, IoT solutions, and custom web & mobile app development. We also specialize in AIDC solutions and technical manpower augmentation, offering end-to-end support from strategy and design to deployment and optimization.

Trusted across industries like manufacturing, healthcare, logistics, BFSI, and smart cities, Aeologic combines innovation with deep industry expertise to deliver future-ready solutions.

Feel free to connect with us:
And read more articles from FlutterDevs.com.

FlutterDevs team of Flutter developers to build high-quality and functionally-rich apps. Hire a flutter developer for your cross-platform Flutter mobile app project on an hourly or full-time basis as per your requirement! For any flutter-related queries, you can connect with us on Facebook, GitHub, Twitter, and LinkedIn.

We welcome feedback and hope that you share what you’re working on using #FlutterDevs. We truly enjoy seeing how you use Flutter to build beautiful, interactive web experiences.


What is Priority and Severity In Flutter

0

Hi everyone! today we learn about Priority and Severity In Flutter. Priority is defined as a parameter that decides the order in which a defect should be fixed. Defects having a higher priority should be fixed first. Severity is a parameter to denote the implication and the impact of the defect on the functionality of the software.

If you’re looking for the best Flutter app development company for your mobile application then feel free to contact us at — support@flutterdevs.com.


Table Of Contents::

Bug Severity

What is Priority?

KEY DIFFERENCE

Types of Severity

Priority Types

Tips for determining the Severity of a Defect

Example of Defect Severity and Priority

Defect Triage

Guidelines that every tester should consider before selecting a severity

Conclusion


Bug Severity:

Bug Severity or Defect Severity in testing is the degree of impact a bug or a Defect has on the software application under test. A higher effect of bug/defect on system functionality will lead to a higher severity level. A Quality Assurance engineer usually determines the severity level of a bug/defect.

What is Priority?

Priority is defined as the order in which a defect should be fixed. The higher the priority the sooner the defect should be resolved.

Defects that leave the software system unusable are given higher priority over defects that cause a small functionality of the software to fail.

KEY DIFFERENCE:

  • Priority is the order in which the developer should resolve a defect whereas Severity is the degree of impact that a defect has on the operation of the product.
  • Priority is categorized into three types: low, medium, and high whereas Severity is categorized into five types: critical. major, moderate, minor, and cosmetic.
  • Priority is associated with scheduling while Severity is associated with functionality or standards.
  • Priority indicates how soon the bug should be fixed whereas Severity indicates the seriousness of the defect in the product functionality.
  • Priority of defects is decided in consultation with the manager/client while Severity levels of the defects are determined by the QA engineer.
  • Priority is driven by business value while Severity is driven by functionality.
  • The priority value is subjective and can change over some time depending on the change in the project situation whereas the Severity value is objective and less likely to change.
  • High Priority and low severity status indicate, defect has to be fixed on immediate bases but does not affect the application while High Severity and low priority status indicates the defect has to be fixed but not on immediate bases.
  • Priority status is based on customer requirements whereas Severity status is based on the technical aspect of the product.

Types of Severity:

In Software Testing, Types of Severity of bug/defect can be categorized into four parts :

  • Critical: This defect indicates complete shut-down of the process, nothing can proceed further
  • Major: It is a highly severe defect and collapses the system. However, certain parts of the system remain functional
  • Medium: It causes some undesirable behavior, but the system is still functional
  • Low: It won’t cause any major break-down of the system

Priority Types:

Types of Priority of bug/defect can be categorized into three parts :

  • Low: The Defect is an irritant but a repair can be done once the more serious Defect has been fixed
  • Medium: During the normal course of the development activities defect should be resolved. It can wait until a new version is created
  • High: The defect must be resolved as soon as possible as it affects the system severely and cannot be used until it is fixed

Tips for determining the Severity of a Defect:

  • Decide the frequency of occurrence: In some cases, if the occurrence of a minor defect is frequent in the code, it can be more severe. So from a user’s perspective, it is more serious even though it is a minor defect.
  • Isolate the defect: Isolating the defect can help to find out the severity of the impact.

Example of Defect Severity and Priority:

Let’s see an example of low severity and high priority and vice versa

  • A very low severity with a high priority: A logo error for any shipment website, can be of low severity as it not going to affect the functionality of the website but can be of high priority as you don’t want any further shipment to proceed with the wrong logo.
  • A very high severity with a low priority: Likewise, for a flight operating website, a defect in reservation functionality may be of high severity but can be a low priority as it can be scheduled to release in the next cycle.

Defect Triage:

Defect triage is a process that tries to re-balancing the process where the test team faces the problem of limited availability of resources. So, when there is a large number of defects and limited testers to verify them, defect triage helps to try to get as many defects resolved based on defect parameters like severity and priority.

How to determine Defect Triage:

Most systems use priority as the main criteria to assess the defect. However, a good triage process considers the severity as well.

The triage process includes the following steps

  • Reviewing all the defects including rejected defects by the team
  • Initial assessment of the defects is based on their content and respective priority and severity settings
  • Prioritizing the defect based on the inputs
  • Assign the defect to correct release by the product manager
  • Re-directs the defect to the correct owner/team for further action

Guidelines that every tester should consider before selecting a severity:

The severity parameter is assessed by the tester whereas the priority parameter is assessed by the product manager or by the triage team. For prioritizing the defect, a tester must choose the right severity to avoid confusion with the development team.

  • Understand the concept of priority and severity well
  • Always assign the severity level based on the issue type as this will affect its priority
  • Understand how a particular scenario or Test Case would affect the end-user
  • Need to consider how much time it would take to fix the defect based on its complexity and the time to verify the defect

Conclusion:

In Software Engineering, Assigning the wrong severity to a defect can delay the STLC process and can have some drastic implications on the overall performance of the team. So, the responsible person needs to be precise and accurate in their call for assigning defects.

❤ ❤ Thanks for reading this article ❤❤

If I got something wrong? Let me know in the comments. I would love to improve.

Clap 👏 If this article helps you.


From Our Parent Company Aeologic

Aeologic Technologies is a leading AI-driven digital transformation company in India, helping businesses unlock growth with AI automation, IoT solutions, and custom web & mobile app development. We also specialize in AIDC solutions and technical manpower augmentation, offering end-to-end support from strategy and design to deployment and optimization.

Trusted across industries like manufacturing, healthcare, logistics, BFSI, and smart cities, Aeologic combines innovation with deep industry expertise to deliver future-ready solutions.

Feel free to connect with us:
And read more articles from FlutterDevs.com.

FlutterDevs team of Flutter developers to build high-quality and functionally-rich apps. Hire a flutter developer for your cross-platform Flutter mobile app project on an hourly or full-time basis as per your requirement! For any flutter-related queries, you can connect with us on Facebook, GitHub, Twitter, and LinkedIn.

We welcome feedback and hope that you share what you’re working on using #FlutterDevs. We truly enjoy seeing how you use Flutter to build beautiful, interactive web experiences.


What Is Jenkins In Flutter

0

Hi everyone! today we learn about Jenkins In Flutter. Jenkins is an open-source automation tool written in Java with plugins built for Continuous Integration purposes.

Jenkins is used to building and testing your software projects continuously making it easier for developers to integrate changes to the project, and making it easier for users to obtain a fresh build.

If you’re looking for the best Flutter app development company for your mobile application then feel free to contact us at — support@flutterdevs.com.


In this tutorial, you will learn

What is Jenkins?

What is Continuous Integration?

How does Jenkins work?

Jenkin History

Why use Continuous Integration with Jenkins?

Real-world case study of Continuous Integration

Advantages of using Jenkins

Disadvantages of using Jenkins

Conclusion


What is Jenkins?

Jenkins is an open-source Continuous Integration server written in Java for orchestrating a chain of actions to achieve the Continuous Integration process in an automated fashion. Jenkins supports the complete development life cycle of software from building, testing, documenting the software, deploying, and other stages of the software development life cycle.

Jenkins is a widely used application around the world that has around 300k installations and growing day by day. By using Jenkins, software companies can accelerate their software development process, as Jenkins can automate build and testing at a rapid rate.

It is a server-based application and requires a web server like Apache Tomcat. The reason Jenkins software became so popular is that it monitors repeated tasks that arise during the development of a project. For example, if your team is developing a project, Jenkins will continuously test your project builds and show you the errors in the early stages of your development.

What is Continuous Integration?

Continuous Integration is a process of integrating code changes from multiple developers in a single project many times. The software is tested immediately after a code commit. With each code commit, code is built and tested. If the test is passed, the build is tested for deployment. If the deployment is successful, the code is pushed to production.

This commit, build, test, and deploy is a continuous process, hence the name continuous integration/deployment.

How does Jenkins work?

Jenkins is a server-based application and requires a web server like Apache Tomcat to run on various platforms like Windows, Linux, macOS, Unix, etc. To use Jenkins, you need to create pipelines which are a series of steps that a Jenkins server will take. Jenkins Continuous Integration Pipeline is a powerful instrument that consists of a set of tools designed to host, monitor, compile and test code, or code changes, like:

  • Continuous Integration Server (Jenkins, Bamboo, CruiseControl, TeamCity, and others)
  • Source Control Tool (e.g., CVS, SVN, GIT, Mercurial, Perforce, ClearCase and others)
  • Build tools (Make, ANT, Maven, Ivy, Gradle, and others)
  • Automation testing framework (Selenium, Appium, TestComplete, UFT, and others)

Jenkin History:

  • Kohsuke Kawaguchi, a Java developer, working at SUN Microsystems, was tired of building the code and fixing errors repetitively. In 2004, created an automation server called Hudson that automates build and test tasks.
  • In 2011, Oracle who owned Sun Microsystems had a dispute with Hudson’s open-source community, so they forked Hudson and renamed it, Jenkins.
  • Both Hudson and Jenkins continued to operate independently. But in a short period, Jenkins acquired a lot of projects and contributors while Hudson remained with only 32 projects. With time, Jenkins became more popular, and Hudson was not maintained anymore.

Why use Continuous Integration with Jenkins?

Some people might think that the old-fashioned way of developing software is the better way. Let’s understand the advantages of CI with Jenkins with the following example

Let us imagine, that there are around 10 developers who are working on a shared repository. Some developer completes their task in 25 days while others take 30 days to complete.

Before Jenkins After Jenkins Once all Developers had completed their assigned coding tasks, they used to commit their code all at the same time. Later, Build is tested and deployed.

Code commit was built, and the test cycle was very infrequent, and a single build was done after many days. The code is built and tested as soon as the Developer commits the code. Jenkin will build and test code many times during the day

If the build is successful, then Jenkins will deploy the source into the test server and notifies the deployment team. If the build fails, then Jenkins will notify the errors to developer team.

Since the code was built all at once, some developers would need to wait until other developers finish coding to check their build The code is built immediately after any of the Developers commits. It is not an easy task to isolate, detect, and fix errors for multiple commits.

Since the code is built after each commit of a single developer, it’s easy to detect whose code caused the build to fail Code build and test process are entirely manual, so there are a lot of chances for failure. Automated build and test process saving timing and reducing defects. ‘

The code is deployed once all the errors are fixed and tested. The code is deployed after every successful build and test. Development Cycle is slow The development cycle is fast. New features are more readily available to users. Increases profits.

Real-world case study of Continuous Integration

I am sure all of you are aware of the old phone Nokia. Nokia used to implement a procedure called nightly build. After multiple commits from diverse developers during the day, the software was built every night. Since the software was built only once a day, it’s a huge pain to isolate, identify, and fix the errors in a large code base.

Later, they adopted the Continuous Integration approach. The software was built and tested as soon as a developer committed code. If any error is detected, the respective developer can quickly fix the defect.

Jenkins Plugins:

By default, Jenkins comes with a limited set of features. If you want to integrate your Jenkins installation with version control tools like Git, then you need to install plugins related to Git. In fact, for integration with tools like Maven, and Amazon EC2, you need to install respective plugins in your Jenkins.

Advantages of using Jenkins:

  • Jenkins is being managed by a very open community. Every month, they hold public meetings and take inputs from the public for the development of the Jenkins project.
  • So far around 280 tickets are closed, and the project publishes stable releases every three months.
  • As technology grows, so does Jenkins. So far Jenkins has around 320 plugins published in its plugins database. With plugins, Jenkins becomes even more powerful and feature-rich.
  • Jenkins tool also supports cloud-based architecture so that you can deploy Jenkins in cloud-based platforms.
  • The reason why Jenkins became popular is that it was created by a developer for developers.

Disadvantages of using Jenkins:

Though Jenkins is a very powerful tool, it has its flaws.

  • Its interface is outdated and not user-friendly compared to current UI trends.
  • Though Jenkins is loved by many developers, it’s not that easy to maintain because Jenkins runs on a server and requires some skills as a server administrator to monitor its activity.
  • One of the reasons why many people don’t implement Jenkins is due to its difficulty in installing and configuring Jenkins.
  • Continuous integrations regularly break due to some small setting changes. Continuous integration will be paused and therefore requires some developer attention.

Conclusion:

  • In Continuous Integration, after a code commit, the software is built and tested immediately. Jenkins is used for orchestrating a chain of actions for Continuous Integration in a software project.
  • Before Jenkins when all Developers had completed their assigned coding tasks, they used to commit their code all at the same time. Later, Build is tested and deployed.
  • After Jenkins, the code is built and tested as soon as the Developer commits the code. Jenkin will build and test code many times during the day
  • By default, Jenkins comes with a limited set of features. If you want to integrate your Jenkins installation with version control tools like Git, then you need to install plugins related to Git
  • The biggest pros of Jenkins are that it is managed by the community which holds public meetings and takes inputs from the public for the development of Jenkins projects. The biggest con of Jenkin is that Its interface is outdated and not user-friendly compared to current UI trends.

❤ ❤ Thanks for reading this article ❤❤

If I got something wrong? Let me know in the comments. I would love to improve.

Clap 👏 If this article helps you.


From Our Parent Company Aeologic

Aeologic Technologies is a leading AI-driven digital transformation company in India, helping businesses unlock growth with AI automation, IoT solutions, and custom web & mobile app development. We also specialize in AIDC solutions and technical manpower augmentation, offering end-to-end support from strategy and design to deployment and optimization.

Trusted across industries like manufacturing, healthcare, logistics, BFSI, and smart cities, Aeologic combines innovation with deep industry expertise to deliver future-ready solutions.

Feel free to connect with us:
And read more articles from FlutterDevs.com.

FlutterDevs team of Flutter developers to build high-quality and functionally-rich apps. Hire a flutter developer for your cross-platform Flutter mobile app project on an hourly or full-time basis as per your requirement! For any flutter-related queries, you can connect with us on Facebook, GitHub, Twitter, and LinkedIn.

We welcome feedback and hope that you share what you’re working on using #FlutterDevs. We truly enjoy seeing how you use Flutter to build beautiful, interactive web experiences.

LambdaTest In Flutter

0

Hi everyone! today we learn about Lambda Test In Flutter. LambdaTest is a cloud-based cross-browser testing tool that allows you to perform cross-browser testing for web applications across more than 2000 browsers, operating systems, and devices. You can perform both manual and automated cross-browser testing using LambdaTest.

If you’re looking for the best Flutter app development company for your mobile application then feel free to contact us at — support@flutterdevs.com.


Table Of Contents::

Introduction To LambdaTest Cross Browser Testing Tool

Key Features of LambdaTest Cross Browser Testing Cloud

Registration — LambdaTest

Integration

Conclusion


Introduction To LambdaTest Cross Browser Testing Tool:

LambdaTest is a Cross Browser Testing Cloud, that allows developers and testers to perform Cross Browser Testing on 2000+ Real Browsers and Operating System Online in varying screen resolutions. LambdaTest allows us to test on the latest mobile and desktop browsers on the cloud.

We can ensure our website is compatible across all browsers and devices by performing Real-time cross cross-browser compatibility testing with LambdaTest. We can choose from a wide range of updated Android and iOS mobile devices from the latest to oldest versions of Chrome, Firefox, Safari, Edge, Internet Explorer, Opera, and Yandex. It also allows us to test for responsiveness and take full-paged automated screenshots. Supported devices are Windows, Android, iPhone/iPad, Mac, and Web-based.

As Software testers, we test applications on different platforms and we all know that it’s not an easy job to set up our test environment based on our requirements. While testing a website, we need to ensure that our website is up to shape. To ensure this we need to have all the devices and browsers. You need to install all the browsers by spending a lot of time, and money. Fortunately, there are some tools to overcome this cumbersome installation process and waste money unwantedly. We have many tools to do Cross Browser Testing. Today we are going to bring another new Cross Browser Testing Tool i.e., LambdaTest. LambdaTest is a CrossBrowserTesting Tool on Cloud.

Key Features of LambdaTest Cross Browser Testing Cloud:

1. Online Browser Compatibility Testing: We can perform browser compatibility testing from a vast choice of desktop and mobile browsers, browser versions, operating systems, and resolutions. We can also record or take screenshots during real-time browser compatibility testing sessions on the go.

2. Test on Latest Desktop Browsers: It has great collections of all the latest browsers (Google Chrome, Mozilla Firefox, Opera, IE, Edge, Safari, and Yandex) and operating systems.

3. Test on a Wide Variety of Mobile Devices: It supports a wide list of iPhones, and iPads on different iOs versions and Android phones like Samsung, Google, Sony, LG, One Plus, HTC, Amazon, Motorola, Xiaomi, Huawei, Gionee, Oppo, Vivo on latest Android versions and different browsers.

4. Faster Automated Screenshots / Screenshot testing: We can get full-paged screenshots within seconds by just selecting the configurations using the LambdaTest automated screenshots feature.

5. Check Responsiveness on All Screen Sizes: We can check the responsiveness of our website with just a single click across different screen sizes. We can also check the responsiveness of our locally hosted websites using LambdaTest Secure Shell Tunnel.

6. Seamless Collaboration and Testing: We can log issues instantly during test sessions. We can share the issues via email, slack or directly log it in different bug tracking tools.

7. Testing Locally Hosted Pages: We can test locally or privately hosted pages on the LambdaTest cloud platform using Lambda Tunnel even before launching on live servers.

8. Smart Visual Regression Testing: We can solve issues related to icon size, padding, color, layout, text, element’s position, etc., by performing smart visual regression testing on our layouts.

9. Resolution Display Testing: Screen resolutions ranging from 800×600 to 2560×1440 are available. We can simply change screen resolution in the mid of a session by just selecting the required resolution and our browser will be resized as per our selected resolution.

10. LambdaTest Inbuilt Issue Tracker: It comes with an inbuilt issue tracker. If you don’t use any third-party project management tool, then there is no need to buy one. You can use LambdaTest’s inbuilt issue tracker to assign, track, export to pdf, and share bugs.

11. Chrome Extension: It can be used to take full-page screenshots of web pages across different desktop and mobile browsers right from your browser with just one click. These screenshots will help in fast-tracking cross-browser compatibility testing of the web pages and websites.

12. 24*7 Support: The best part of LambdaTest is their 24×7 support from their Tech Experts. You can do so through email, live chat, and phone calls. If you don’t wish to use any of those channels, support tickets can also be filed. Just explain what the problem is and LambdaTest’s support team will do their best to resolve it for you.

Registration — LambdaTest:

Step 1: Open this link
Step 2: Click on “Free Sign Up”

Step 3: Provide the required details to Sign Up

You will be redirected to LambdaTest Dashboard.

Overview On LambdaTest Dashboard:

> Real-Time Browser Testing

Step 1: Go to “Real Time Test” from the left navigation menu.
Step 2: Enter the “URL” of the site that you want to test
Step 3: Select either “Desktop” or “Mobile device”
Step 4: Select “Browser version”, “OS”, and “Resolution”
Step 5: Click on “Start”

Click the button with the camera icon (as shown in the below image) to generate a screenshot for the visible part of the screen you are currently on inside the Virtual Machine.

Once the desired Virtual Machine is launched and operable, you can capture screenshots or record a video and report bugs in the bug tracking tool provided by LambdaTest or you can use your favorite third-party bug tracking tool.

> Screenshot Testing

Step 1: Click on the “Screenshot” menu under the “Visual UI Test” menu
Step 2: Enter the “URL” of the site that you want to test
Step 3: Select either “Desktop” or “Mobile device”
Step 4: Select “Browser version” related to the required “OS”
Step 5: Click on “Capture” and you will be taken to the result page where you can view your screenshots.

> Responsive Testing

Step 1: Click on the “Responsive” menu under the “Visual UI Test” menu
Step 2: Enter the “URL” of the site that you want to test
Step 3: Select either “Desktop” or “Mobile device”
Step 4: Select “Browser version” related to the required “OS”
Step 5: Click on “Generate”

Integration:

LambdaTest can seamlessly integrate with the following bug-tracking and communication tools:

> Bug Tracking Tools:

  • Jira
  • Slack
  • Asana
  • Trello
  • Github
  • Gitlab
  • Bitbucket
  • VSTS
  • Meet
  • Paymo
  • Teamwork
  • Hive
  • Clubhouse
  • Mantis

> Plugins & Extensions:

  • Chrome Extension
  • WordPress-Plugin

Conclusion:

If you’re looking for a fully functional and automated web-based software solution to perform live testing, then you should consider LambdaTest as a strong contender. With powerful features that allow users to test their websites and applications, the pros outweigh the cons. You can deploy projects and tasks more efficiently and easily with fewer challenges.

At the end of the day, LambdaTest only seeks to improve the way you do your work. Its features are catered to accelerate the development process and provide web developers with essential tools. Overall, testing projects and assessing software can now be done with relative ease.

❤ ❤ Thanks for reading this article ❤❤

If I got something wrong? Let me know in the comments. I would love to improve.

Clap 👏 If this article helps you.


From Our Parent Company Aeologic

Aeologic Technologies is a leading AI-driven digital transformation company in India, helping businesses unlock growth with AI automation, IoT solutions, and custom web & mobile app development. We also specialize in AIDC solutions and technical manpower augmentation, offering end-to-end support from strategy and design to deployment and optimization.

Trusted across industries like manufacturing, healthcare, logistics, BFSI, and smart cities, Aeologic combines innovation with deep industry expertise to deliver future-ready solutions.

Feel free to connect with us:
And read more articles from FlutterDevs.com.

FlutterDevs team of Flutter developers to build high-quality and functionally-rich apps. Hire a flutter developer for your cross-platform Flutter mobile app project on an hourly or full-time basis as per your requirement! For any flutter-related queries, you can connect with us on Facebook, GitHub, Twitter, and LinkedIn.

We welcome feedback and hope that you share what you’re working on using #FlutterDevs. We truly enjoy seeing how you use Flutter to build beautiful, interactive web experiences.

Flutter PageView Widget

0

The PageView widget allows the user to transition between different screens in their flutter application. All you need to set it up are a PageViewController and a PageView.

If you’re looking for the best Flutter app development company for your mobile application then feel free to contact us at — support@flutterdevs.com.


Table Of Contents

Introduction

Properties

Implementation

Conclusion

GitHub Link



Introduction:

A page view is a simple way to swipe the pages in the flutter application. It works in both horizontal and vertical ways. A PageView is a widget that generates the pages of the screen that are scrollable. The pages can be fixed or repeated pages that are built by the builder function. PageView behaves like ListView in constructing the elements.


Properties of PageView:

> allowImplicitScrolling:- This property takes in a boolean value as the object. It controls whether to allocate implicit scrolling to the widget’s page.

Implementationfinal

bool allowImplicitScrolling;

> childrenDelegate:- A delegate that provides the children for the PageView.

Implementation

final SliverChildDelegate childrenDelegate;

> clipBehavior:- The content will be clipped (or not) according to this option.

Implementation

final Clip clipBehavior;

> controller:- An object that can be used to control the position to which this page view is scrolled.

Implementation

final PageController controller;

> dragStartBehavior:- Determines the way that drags start behavior is handled.

Implementation

final DragStartBehavior dragStartBehavior;

> onPageChanged:- Called whenever the page in the center of the viewport changes.

Implementation

final ValueChanged<int>? onPageChanged;

> padEnds:- Whether to add padding to both ends of the list.

Implementation

final bool padEnds;

> physics:- How the page view should respond to user input.

Implementation

final ScrollPhysics? physics;

> restorationId:- Restoration ID to save and restore the scroll offset of the scrollable.

Implementation

final String? restorationId;

> reverse:- It defines the scrolling direction. By default, it is set to false.

Implementation

final bool reverse;

> scrollDirection:- The axis along which the page view scrolls.

Implementation

final Axis scrollDirection;

Implementation:

First, we have to create a new Flutter Project with the name pageview_flutter_demo. Then we start coding to implement the PageView in the flutter application. We use PageController inside the state of a statefulWidget and initialize it inline or in the init() method. And create an integer variable _curr and pass the initial value zero.PageController controller = PageController();
int _curr = 0;

In BuildContext(), we define Scaffold. In the appbar, we define the name and center tile.

AppBar(
centerTitle: true,
title: const Text('PageView'),
backgroundColor: Colors.lightBlueAccent,
),

After this, we pass PageView in the Scaffold body. In PageView Widget, first, we have to pass true at allowImplicitScrolling because It controls whether to allocate implicit scrolling to the widget’s page. and set the scroll direction as horizontal we can also set it as vertical. and pass the controller in the controller. After all this, we have to set the value at onPageChangeso, for page change we use setState in which we pass the _curr equals to num.

PageView(
allowImplicitScrolling: true,
children: _list,
scrollDirection: Axis.horizontal,
controller: controller,
onPageChanged: (num) {
setState(() {
_curr = num;
});
},
),

And at last, we have to pass the children, In children, we pass the _list. We already create a list.

final List<Widget> _list = <Widget>[
Center(
child: Pages(
text: "Page One",
color: Colors.teal,
)),
Center(
child: Pages(
text: "Page Two",
color: Colors.red.shade100,
)),
Center(
child: Pages(
text: "Page Three",
color: Colors.grey,
)),
Center(
child: Pages(
text: "Page Four",
color: Colors.yellow.shade100,
))
];

In this list, we use text and color so for this we create a stateless Widget with the name Pages in this we create two constructor text and color.

class Pages extends StatelessWidget {
final text;
final color;
Pages({this.text, this.color});
@override
Widget build(BuildContext context) {
return Container(
color: color,
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text(
text,
textAlign: TextAlign.center,
style: const TextStyle(
fontSize: 30,
fontWeight: FontWeight.w400),
),
]),
),
);
}
}

If the properties are:

scrollDirection: Axis.vertical,
reverse: true,
controller: controller,

When we run the application, we ought to get the screen’s output like the underneath screen video.

And If the properties are:

scrollDirection: Axis.horizontal,
controller: controller,

When we run the application, we ought to get the screen’s output like the underneath screen video.


Conclusion:

In this article, we learn how to implement PageView Widget in Flutter Application. In this, we learn many things like the axis of scroll direction, reverse, physics, etc.

❤ Thanks for reading this article ❤❤

If I got something wrong? Let me know in the comments. I would love to improve.

Clap 👏 If this article helps you.


GitHub Link:

Find the source code of the PageView Widget In the Flutter Application :

GitHub – flutter-devs/pageView_flutter-
A new Flutter project. This project is a starting point for a Flutter application. A few resources to get you started…github.com


From Our Parent Company Aeologic

Aeologic Technologies is a leading AI-driven digital transformation company in India, helping businesses unlock growth with AI automation, IoT solutions, and custom web & mobile app development. We also specialize in AIDC solutions and technical manpower augmentation, offering end-to-end support from strategy and design to deployment and optimization.

Trusted across industries like manufacturing, healthcare, logistics, BFSI, and smart cities, Aeologic combines innovation with deep industry expertise to deliver future-ready solutions.

Feel free to connect with us:
And read more articles from FlutterDevs.com.

FlutterDevs team of Flutter developers to build high-quality and functionally-rich apps. Hire a flutter developer for your cross-platform Flutter mobile app project on an hourly or full-time basis as per your requirement! You can connect with us on Facebook, GitHub, Twitter, and LinkedIn for any flutter-related queries.

We welcome feedback and hope that you share what you’re working on using #FlutterDevs. We truly enjoy seeing how you use Flutter to build beautiful, interactive web experiences.


APPIUM For Android & iOS Mobile Apps Testing In Flutter

0

Hi everyone! today we learn about Appium for Android & iOS Mobile Apps Testing In Flutter. Appium is an open-source test automation tool used for testing mobile applications. It allows users to test various types of mobile applications (such as Native, Hybrid, and Mobile Web) using the standard WebDriver library.

If you’re looking for the best Flutter app development company for your mobile application then feel free to contact us at — support@flutterdevs.com.


Table Of Contents::

What is Appium?

How APPIUM Works?

Prerequisite To Use APPIUM

Install Appium Desktop

APPIUM Inspector

Attach Android Emulator to Appium

APPIUM Test Case for Native Android App(Calculator)

Limitations Using APPIUM

Common Encountered Errors and Troubleshooting Steps in Appium

Conclusion


What is Appium?:

APPIUM is a freely distributed open-source mobile application UI Testing framework. Appium allows native, hybrid, and web application testing and supports automation tests on physical devices as well as an emulator or simulator both. It offers cross-platform application testing, i.e. single API works for both Android and iOS platform test scripts.

It has NO dependency on Mobile device OS. Because APPIUM has a framework or wrapper that translates Selenium Webdriver commands into UIAutomation (iOS) or UIAutomator (Android) commands depending on the device type, not any OS type.

Appium supports all languages that have Selenium client libraries like- Java, Objective-C, JavaScript with node.js, PHP, Ruby, Python, C#, etc.

How APPIUM Works?:

  • Appium is an ‘HTTP Server’ written using a Node.js platform and drives iOS and an Android sessions using Webdriver JSON wire protocol. Hence, before initializing the Appium Server, Node.js must be pre-installed on the system.
  • When Appium is downloaded and installed, then a server is set up on our machine that exposes a REST API.
  • It receives connection and command requests from the client and executes that command on mobile devices (Android / iOS).
  • It responds with HTTP responses. Again, to execute this request, it uses the mobile test automation frameworks to drive the user interface of the apps. A framework like:-
  • Apple Instruments for iOS (Instruments are available only in Xcode 3.0 or later with OS X v10.5 and later)
  • Google UIAutomator for Android API level 16 or higher
  • Selendroid for Android API level 15 or less

Prerequisite To Use APPIUM:

  1. Install ANDROID SDK (Studio)
  2. Install JDK (Java Development Kit)
  3. Install Eclipse
  4. Install TestNG for Eclipse
  5. Install Selenium Server JAR
  6. Appium Client Library
  7. APK App Info on Google Play
  8. js (Not Required — Whenever the Appium server is installed, it by default comes with “Node.exe” & NPM. It’s included in the Current version of Appium.)
  9. Install Appium Desktop

Install Appium Desktop:

Appium Studio is an Open source GUI app to install Appium Server. It comes bundled with all the prerequisites to install and use Appium Server. It also has an Inspector to get basic information on your Apps. It comes with a Recorder to create boilerplate code to automate your mobile apps.

Step 1) Go to http://appium.io/ and click on Download Appium.

Step 2) For Windows, select the exe file and download. The file is around 162MB and will take time to download based on your internet speed.

Step 3) Click on the downloaded exe.

Step 4) On a Windows machine, there is no need to install Appium. It runs directly from the exe. Once you click the exe you will see the following image for a few minutes.

For Mac, you need to install the dmg

Step 5) Next you will see the Server Start Window. It populates the default host and port option which you can change. It also mentions the version of Appium being used.

Step 6) On clicking the Start Server Button, a new server is launched on the specified host and port. Server log output is shown.

Step 7) Click New Session Window.

Step 8) You can enter the Desired Capabilities and start a session.

APPIUM Inspector:

Similar to the Selenium IDE record and playback tool, Appium has an ‘Inspector’ to record and Playback. It records and plays native application behavior by inspecting DOM and generates the test scripts in any desired language. However, currently, there is no support for Appium Inspector for Microsoft Windows. In Windows, it launches the Appium Server but fails to inspect elements. However, the UI Automator viewer can be used as an option for Inspecting elements.

Steps to start with Appium Inspector on a Mac machine:-

Step 1) Download and start your Appium server with the default IP Address 0.0.0.0 and port 4725.

  1. Select the source file or .app files from local to test.
  2. Check the ‘App Path’ Checkbox to enable the ‘Choose’ button.

Step 2)Now, clicking on the ‘Choose’ button will give the option to browse and select the test file from the local drive.

Step 3) Start Simulator on a Mac machine.

Step 4) Click the ‘Launch’ button from the top right corner, which enables a blue color icon. Again, click on this blue color icon, it will open the Appium inspector and Simulator with a pre-selected application.

Step 5)– Launching your Appium Inspector will show the element hierarchy in a column-wise structure. Also, a user can apply actions using buttons like Tap, Swipe, etc.

Step 6) Click on the ‘Stop’ button to stop recording.

Attach Android Emulator to Appium:

Step 1) Install Android SDK in your system.

Go to Control panel >> System and Security >> System and from the left panel click on ‘Advanced System Settings. From the ‘System Properties’ pop-up, click on the ‘Advanced’ tab and then click on the “Environment Variables” button.

Step 2) Now, from the ‘Environment variables’ pop-up, ‘double-click on ‘Path’ and set the ANDROID_HOME variable that points to your SDK directory. In the path append the whole SDK folder path.

e.g. –C:\User\ABC\Desktop\adt-bundled-windows-x86_64-20140321\sdk

Step 3) Start your Android emulator or attach any Android device to your system (Make sure you have the Android Debugging option enabled in your Android device. To check Debugging Option. Go to Device Settings >> Developer Options >> Check “Debugging Option”).

Step 4) Open Command Prompt and navigate to your Android SDK’s \platform-tools\ directory (E.g. D:\adt-bundle-windows-x86_64–20130514\sdk\platform-tools).

Step 5)– Run the ADB devices’ command. You can see your connected device listed in Command Prompt window. (In CMD write ‘>adb devices’- This command will list the connected emulator instances. E.g.: ADB –s emulator-5554 install <Location of .apk file>)

Step 6)– Run the ADB start-server command. It will start the ADB server that will be used by Appium to send commands to your Android device.

Step 7) Now, navigate to the Appium directory in your system and start Appium by clicking an Appium.exe file.

Step 8) Do not alter the IP address or port number and click the ‘Launch’ button. Your Appium console starts at 127.0.0.1:4723 as shown below.

Step 9) Click on the ‘Start’ button, Appium server started running on your system.

APPIUM Test Case for Native Android App(Calculator):

Step 1) Download the ADT eclipse plugin or download ADT bundled separately here

Step 2) Open Eclipse and Create a new Project >> Package >> Class

Step 3) Import the Selenium library and Test-inside that new project.

Step 4) Now Create a small test Program for ‘Calculator. app’ to sum two numbers.

package src_Appium;
import java.net.MalformedURLException;
import java.net.URL;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
//import org.openqa.selenium.remote.CapabilityType;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.testng.annotations.*;

public class Calculator {
WebDriver driver;@BeforeClass
public void setUp() throws MalformedURLException{
//Set up desired capabilities and pass the Android app-activity and app-package to Appium
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("BROWSER_NAME", "Android");
capabilities.setCapability("VERSION", "4.4.2");
capabilities.setCapability("deviceName","Emulator");
capabilities.setCapability("platformName","Android");


capabilities.setCapability("appPackage", "com.android.calculator2");
// This package name of your app (you can get it from apk info app)
capabilities.setCapability("appActivity","com.android.calculator2.Calculator"); // This is Launcher activity of your app (you can get it from apk info app)
//Create RemoteWebDriver instance and connect to the Appium server
//It will launch the Calculator App in Android Device using the configurations specified in Desired Capabilities
driver = new RemoteWebDriver(new URL("https://127.0.0.1:4723/wd/hub"), capabilities);
}@Test
public void testCal() throws Exception {
//locate the Text on the calculator by using By.name()
WebElement two=driver.findElement(By.name("2"));
two.click();
WebElement plus=driver.findElement(By.name("+"));
plus.click();
WebElement four=driver.findElement(By.name("4"));
four.click();
WebElement equalTo=driver.findElement(By.name("="));
equalTo.click();
//locate the edit box of the calculator by using By.tagName()
WebElement results=driver.findElement(By.tagName("EditText"));
//Check the calculated value on the edit box
assert results.getText().equals("6"):"Actual value is : "+results.getText()+" did not match with expected value: 6";}@AfterClass
public void teardown(){
//close the app
driver.quit();
}
}

Appium Server and Android Emulator from ‘AVD Manager’ and Click Run >> TestNG. The above program will run the ‘Calculator. app’ on the selected emulator and the Result is displayed under the Eclipse console using a TestNG framework.

Limitations Using APPIUM:

  1. Appium does not support testing of Android Version lower than 4.2
  2. Limited support for hybrid app testing. e.g.: not possible to test the switching action of the application from the web app to native and vice-versa.
  3. No support for running Appium Inspector on Microsoft Windows.

Common Encountered Errors and Troubleshooting Steps in Appium:

Conclusion:

With emerging trends and more demand for Mobile Apps, all major companies are migrating to get their business on mobile apps. Thus to release quality mobile apps, automation testing of mobile apps is the latest trend in the industry.

Appium, because of its simplicity and ease of use, is one of the leaders and most widely used tools all over the globe for the automation testing of mobile apps for iOS or Android.

❤ ❤ Thanks for reading this article ❤❤

If I got something wrong? Let me know in the comments. I would love to improve.

Clap 👏 If this article helps you.


From Our Parent Company Aeologic

Aeologic Technologies is a leading AI-driven digital transformation company in India, helping businesses unlock growth with AI automation, IoT solutions, and custom web & mobile app development. We also specialize in AIDC solutions and technical manpower augmentation, offering end-to-end support from strategy and design to deployment and optimization.

Trusted across industries like manufacturing, healthcare, logistics, BFSI, and smart cities, Aeologic combines innovation with deep industry expertise to deliver future-ready solutions.

Feel free to connect with us:
And read more articles from FlutterDevs.com.

FlutterDevs team of Flutter developers to build high-quality and functionally-rich apps. Hire a flutter developer for your cross-platform Flutter mobile app project on an hourly or full-time basis as per your requirement! For any flutter-related queries, you can connect with us on Facebook, GitHub, Twitter, and LinkedIn.

We welcome feedback and hope that you share what you’re working on using #FlutterDevs. We truly enjoy seeing how you use Flutter to build beautiful, interactive web experiences.

What is TestNG In Flutter

0

Hi everyone! today we learn about What is TestNG In Flutter. TestNG is a testing framework for the java programming language created by Cédric Beust and inspired by JUnit and NUnit.

The design goal of TestNG is to cover a wider range of test categories: unit, functional, end-to-end, integration, etc., with more powerful and easy-to-use functionalities.

If you’re looking for the best Flutter app development company for your mobile application then feel free to contact us at — support@flutterdevs.com.


Table Of Contents::

What is TestNG?

Why Use TestNG with Selenium?

Advantages of TestNG over JUnit

What is Annotation in TestNG?

How to Write Test Cases in TestNG?

Create Test Case Using TestNG Annotations

Setting up a new TestNG Project

How to Create a New TestNG Test File

Coding of our First TestNG Test Case Example

Running the Test

Checking reports created by TestNG

Generating HTML Reports

Annotations used in TestNG

Multiple Test Cases

Parameters

Multiple Parameters

Summary of TestNG Annotations

Conclusion


What is TestNG?

TestNG is an automation testing framework in which NG stands for “Next Generation”. TestNG is inspired by JUnit which uses the annotations (@). TestNG overcomes the disadvantages of JUnit and is designed to make end-to-end testing easy.

Using TestNG, you can generate a proper report, and you can easily come to know how many test cases are passed, failed, and skipped. You can execute the failed test cases separately.

For example:

  • Suppose, you have five test cases, and one method is written for each test case (Assume that the program is written using the main method without using TestNG). When you run this program first, three methods are executed successfully, and the fourth method is failed. Then correct the errors present in the fourth method, now you want to run only the fourth method because the first three methods are anyway executed successfully. This is not possible without using TestNG.
  • The TestNG in Selenium provides an option, i.e., the TestNG-failed.xml file in the test-output folder. If you want to run only failed test cases means you run this XML file. It will execute only failed test cases.

Besides the above concept, you will learn more about TestNG, like what are the Advantages of TestNG, how to create test methods using @test annotations, and how to convert these classes into testing suite files and execute them through the eclipse as well as from the command line.

Why Use TestNG with Selenium?

Default Selenium tests do not generate a proper format for the test results. Using TestNG in Selenium, we can generate test results.

Most Selenium users use this more than JUnit because of its advantages. There are so many features of TestNG, but we will only focus on the most important ones that we can use in Selenium. The following are the key features of Selenium TestNG:

  • Generate the report in a proper format including the number of test case runs, the number of test cases passed, the number of test cases failed, and the number of test cases skipped.
  • Multiple test cases can be grouped more easily by converting them into testng.xml files. In which you can make priorities on which test case should be executed first.
  • The same test case can be executed multiple times without loops just by using a keyword called ‘invocation count.’
  • Using TestNG, you can execute multiple test cases on multiple browsers, i.e., cross-browser testing.
  • The TestNG framework can be easily integrated with tools like TestNG Maven, Jenkins, etc.
  • Annotations used in the testing are very easy to understand ex: @BeforeMethod, @AfterMethod, @BeforeTest, @AfterTest
  • WebDriver has no native mechanism for generating reports. TestNG can generate the report in a readable format like the one shown below.
  • TestNG simplifies the way the tests are coded. There is no more need for a static main method in our tests. The sequence of actions is regulated by easy-to-understand annotations that do not require methods to be static.
  • Uncaught exceptions are automatically handled by TestNG without terminating the test prematurely. These exceptions are reported as failed steps in the report.

Advantages of TestNG over JUnit:

There are three major advantages of TestNG over JUnit:

  • Annotations are easier to understand
  • Test cases can be grouped more easily
  • Parallel testing is possible

What is Annotation in TestNG?

Annotations in TestNG are lines of code that can control how the method below them will be executed. They are always preceded by the @ symbol. A very early and quick TestNG Example is the one shown below.

Annotations will be discussed later in the section named “Annotations used in TestNG,” so it is perfectly ok if you do not understand the above TestNG Example just yet. It is just important to note for now that annotations in TestNG are easier to code and understand than in JUnit.

The ability to run tests in parallel is available in TestNG but not in JUnit, so the TestNG framework is preferred for testers using Selenium Grid.

How to Write Test Cases in TestNG?

Step 1) Write your business logic and insert the TestNG annotations in your code.
Step 2) Add more information like class name, groups name, package name, etc
Step 3) Run the TestNG.

Create Test Case Using TestNG Annotations:

Now, we will learn how to create our first test case using TestNG Annotations in Selenium:

Before we create a test case, we should first set up a new TestNG Project in Eclipse and name it “FirstTestNGProject”.

Setting up a new TestNG Project:

Step 1: Click File > New > Java Project

Step 2: Type “FirstTestNGProject” as the Project Name then click Next.

Step 3: We will now start to import the TestNG Libraries onto our project. Click on the “Libraries” tab, and then “Add Library…”

Step 4: On the Add Library dialog, choose “TestNG” and click Next.

Step 5: Click Finish.

You should notice that TestNG is included on the Libraries list.

Step 6: We will now add the JAR files that contain the Selenium API. These files are found in the Java client driver that we downloaded from https://www.selenium.dev/downloads/ when we were installing Selenium and Eclipse in the previous chapters.

Then, navigate to where you have placed the Selenium JAR files.

After adding the external JARs, your screen should look like this.

Step 7: Click Finish and verify that our FirstTestNGProject is visible on Eclipse’s Package Explorer window.

How to Create a New TestNG Test File:

Now that we are done setting up our project in this TestNG tutorial, let us create a new TestNG file.

Step 1: Click on ‘src’ and Choose other.
Right-click on the “src” package folder then choose New > Other…

Step 2: Select the TestNG class.
Click on the TestNG folder and select the “TestNG class” option. Click Next.

Step 3: Type the values.
Type the values indicated below on the appropriate input boxes and click Finish. Notice that we have named our Java file “FirstTestNGFile”.

Step 4: Template Created.
Eclipse should automatically create the template for our TestNG file shown below.

Coding of our First TestNG Test Case Example:

Let us now create our first Test Case that will check if Mercury Tours’ homepage is correct. Type your code as shown in the below TestNG Example:

package firsttestngpackage;
import org.openqa.selenium.*;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.Assert;
import org.testng.annotations.*;public class firsttestngfile {
public String baseUrl = "http://demo.guru99.com/test/newtours/";
String driverPath = "C:\\geckodriver.exe";
public WebDriver driver ;

@Test
public void verifyHomepageTitle() {

System.out.println("launching firefox browser");
System.setProperty("webdriver.gecko.driver", driverPath);
driver = new FirefoxDriver();
driver.get(baseUrl);
String expectedTitle = "Welcome: Mercury Tours";
String actualTitle = driver.getTitle();
Assert.assertEquals(actualTitle, expectedTitle);
driver.close();
}
}

Notice the following.

  • TestNG does not require you to have a main() method.
  • Methods need not be static.
  • We used the @Test annotation. @Test is used to tell that the method under it is a test case. In this case, we have set the verifyHomepageTitle() method to be our test case, so we placed an ‘@Test’ annotation above it.
  • Since we use annotations in TestNG, we needed to import the package org.testng.annotations.*.
  • We used the Assert class. The Assert class is used to conduct verification operations in TestNG. To use it, we need to import the org. testng.Assert package.

You may have multiple test cases (therefore, multiple @Test annotations) in a single TestNG file. This will be tackled in more detail later in the section “Annotations used in TestNG.”

Running the Test:

To run the test, simply run the file in Eclipse as you normally do. The eclipse will provide two outputs — one in the Console window and the other in the TestNG Results window.

Checking reports created by TestNG:

The Console window in Eclipse gives a text-based report of our test case results while the TestNG Results window gives us a graphical one.

Generating HTML Reports:

TestNG can generate reports in HTML format.

Step 1: After running our FirstTestNGFile that we created in the previous section, right-click the project name (FirstTestNGProject) in the Project Explorer window then click on the “Refresh” option.

Step 2: Notice that a “test-output” folder was created. Expand it and look for an index.html file. This HTML file is a report of the results of the most recent test run.

Step 3: Double-click on that index.html file to open it within Eclipse’s built-in web browser. You can refresh this page any time after you rerun your test by simply pressing F5 just like in ordinary web browsers.

Annotations used in TestNG:

In the previous section, you have been introduced to the @Test annotation. Now, we shall be studying more advanced annotations and their usage.

Multiple Test Cases:

We can use multiple @Test annotations in a single TestNG file. By default, methods annotated by @Test are executed alphabetically. See the code below. Though the methods c_test, a_test, and b_test are not arranged alphabetically in the code, they will be executed as such.

Run this code and on the generated index.html page, click “Chronological view.”

Parameters:

If you want the methods to be executed in a different order, use the parameter “priority”. Parameters are keywords that modify the annotation’s function.

  • Parameters require you to assign a value to them. You do. this by placing a “=” next to them, and then followed by the value.
  • Parameters are enclosed in a pair of parentheses which are placed right after the annotation like the code snippet shown below.

TestNG will execute the @Test annotation with the lowest priority value up to the largest. There is no need for your priority values to be consecutive.

The TestNG HTML report will confirm that the methods were executed based on the ascending value of priority.

Multiple Parameters:

Aside from “priority,” @Test has another parameter called “alwaysRun” which can only be set to either “true” or “false.” To use two or more parameters in a single annotation, separate them with a comma such as the one shown below.@Test(priority = 0, alwaysRun = true)

@BeforeTest and @AfterTest:

@BeforeTestmethods under this annotation will be executed before the first test case in the TestNG file.@AfterTestmethods under this annotation will be executed after all test cases in the TestNG file are executed.

Consider the code below.

package firsttestngpackage;
import org.openqa.selenium.*;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.Assert;
import org.testng.annotations.*;
public class firsttestngfile {
public String baseUrl = "http://demo.guru99.com/test/newtours/";
String driverPath = "C:\\geckodriver.exe";
public WebDriver driver ;

@BeforeTest
public void launchBrowser() {
System.out.println("launching firefox browser");
System.setProperty("webdriver.gecko.driver", driverPath);
driver = new FirefoxDriver();
driver.get(baseUrl);
}
@Test
public void verifyHomepageTitle() {
String expectedTitle = "Welcome: Mercury Tours";
String actualTitle = driver.getTitle();
Assert.assertEquals(actualTitle, expectedTitle);
}
@AfterTest
public void terminateBrowser(){
driver.close();
}
}

Applying the logic presented by the table and the code above, we can predict that the sequence by which methods will be executed is:

  • 1st — launchBrowser()
  • 2nd — verifyHomepageTitle()
  • 3rd — terminateBrowser()

The placement of the annotation blocks can be interchanged without affecting the chronological order by which they will be executed. Let’s understand with a TestNG Example and try to rearrange the annotation blocks such that your code would look similar to the one below.

package firsttestngpackage;
import org.openqa.selenium.*;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.Assert;
import org.testng.annotations.*;
public class firsttestngfile {
public String baseUrl = "http://demo.guru99.com/test/newtours/";
String driverPath = "C:\\geckodriver.exe";
public WebDriver driver ;
@AfterTest //Jumbled
public void terminateBrowser(){
driver.close();
}
@BeforeTest //Jumbled
public void launchBrowser() {
System.out.println("launching firefox browser");
System.setProperty("webdriver.gecko.driver", driverPath);
driver = new FirefoxDriver();
driver.get(baseUrl);
}
@Test //Jumbled
public void verifyHomepageTitle() {
String expectedTitle = "Welcome: Mercury Tours";
String actualTitle = driver.getTitle();
Assert.assertEquals(actualTitle, expectedTitle);
}

}

Run the code above and notice that

@BeforeMethod and @AfterMethod:

@BeforeMethodmethods under this annotation will be executed before each method in each test case.@AfterMethodmethods under this annotation will be executed after each method in each test case.

In Mercury Tours, suppose we like to verify the titles of the target pages of the two links below.

The flow of our test would be:

  • Go to the homepage and verify its title.
  • Click REGISTER and verify the title of its target page.
  • Go back to the homepage and verify if it still has the correct title.
  • Click SUPPORT and verify the title of its target page.
  • Go back to the homepage and verify if it still has the correct title.

The code below illustrates how @BeforeMethod and @AfterMethod are used to efficiently execute the scenario mentioned above.

package firsttestngpackage;
import org.openqa.selenium.*;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.Assert;
import org.testng.annotations.*;
@Test
public class firsttestngfile {
public String baseUrl = "http://demo.guru99.com/test/newtours/";
String driverPath = "C:\\geckodriver.exe";
public WebDriver driver;
public String expected = null;
public String actual = null;
@BeforeTest
public void launchBrowser() {
System.out.println("launching firefox browser");
System.setProperty("webdriver.gecko.driver", driverPath);
driver= new FirefoxDriver();
driver.get(baseUrl);
}

@BeforeMethod
public void verifyHomepageTitle() {
String expectedTitle = "Welcome: Mercury Tours";
String actualTitle = driver.getTitle();
Assert.assertEquals(actualTitle, expectedTitle);
}
@Test(priority = 0)
public void register(){
driver.findElement(By.linkText("REGISTER")).click() ;
expected = "Register: Mercury Tours";
actual = driver.getTitle();
Assert.assertEquals(actual, expected);
}
@Test(priority = 1)
public void support() {
driver.findElement(By.linkText("SUPPORT")).click() ;
expected = "Under Construction: Mercury Tours";
actual = driver.getTitle();
Assert.assertEquals(actual, expected);
}
@AfterMethod
public void goBackToHomepage ( ) {
driver.findElement(By.linkText("Home")).click() ;
}

@AfterTest
public void terminateBrowser(){
driver.close();
}
}

After executing this test, your TestNG should report the following sequence.

Simply put, @BeforeMethod should contain methods that you need to run before each test case while @AfterMethod should contain methods that you need to run after each test case.

Summary of TestNG Annotations:

@BeforeSuite: The annotated method will be run before all tests in this suite have run.

@AfterSuite: The annotated method will be run after all tests in this suite have run.

@BeforeTest: The annotated method will be run before any test method belonging to the classes inside the tag is run.

@AfterTest: The annotated method will be run after all the test methods belonging to the classes inside the tag have run.

@BeforeGroups: The list of groups that this configuration method will run before. This method is guaranteed to run shortly before the first test method that belongs to any of these groups is invoked.

@AfterGroups: The list of groups that this configuration method will run after. This method is guaranteed to run shortly after the last test method that belongs to any of these groups is invoked.

@BeforeClass: The annotated method will be run before the first test method in the current class is invoked.

@AfterClass: The annotated method will be run after all the test methods in the current class have been run.

@BeforeMethod: The annotated method will be run before each test method.

@AfterMethod: The annotated method will be run after each test method.

@Test: The annotated method is a part of a test case

Conclusion:

  • TestNG is a testing framework that is capable of making Selenium tests easier to understand and of generating reports that are easy to understand.
  • The main advantages of TestNG over JUnit are the following.
  • Annotations are easier to use and understand.
  • Test cases can be grouped more easily.
  • TestNG allows us to create parallel tests.
  • The Console window in Eclipse generates a text-based result while the TestNG window is more useful because it gives us a graphical output of the test result plus other meaningful details such as:
  • Runtimes of each method.
  • The chronological order by which methods were executed
  • TestNG is capable of generating HTML-based reports.
  • Annotations can use parameters just like the usual Java TestNG methods.
  • TestNG Data provider is a way to pass parameters into the test function which passes different values in test cases in a single execution.

❤ ❤ Thanks for reading this article ❤❤

If I got something wrong? Let me know in the comments. I would love to improve.

Clap 👏 If this article helps you.


From Our Parent Company Aeologic

Aeologic Technologies is a leading AI-driven digital transformation company in India, helping businesses unlock growth with AI automation, IoT solutions, and custom web & mobile app development. We also specialize in AIDC solutions and technical manpower augmentation, offering end-to-end support from strategy and design to deployment and optimization.

Trusted across industries like manufacturing, healthcare, logistics, BFSI, and smart cities, Aeologic combines innovation with deep industry expertise to deliver future-ready solutions.

Feel free to connect with us:
And read more articles from FlutterDevs.com.

FlutterDevs team of Flutter developers to build high-quality and functionally-rich apps. Hire a flutter developer for your cross-platform Flutter mobile app project on an hourly or full-time basis as per your requirement! For any flutter-related queries, you can connect with us on Facebook, GitHub, Twitter, and LinkedIn.

We welcome feedback and hope that you share what you’re working on using #FlutterDevs. We truly enjoy seeing how you use Flutter to build beautiful, interactive web experiences.