Logo

dev-resources.site

for different kinds of informations.

Java 101 for software testing (Using fruits and vehicle as example)

Published at
1/16/2023
Categories
testing
bugs
automationtest
java
Author
alanliew88
Categories
4 categories in total
testing
open
bugs
open
automationtest
open
java
open
Author
10 person written this
alanliew88
open
Java 101 for software testing (Using fruits and vehicle as example)

Image description

I think many of you might have similar experience like me where I found myself struggle to understand of Java language.

There was a time I try to avoid myself from writing selenium testing script in Java, instead, I'm using Python to code.

And when I decided to learn and write selenium testing script using java but I'm devastated because of the endless of error seem to appear.. I can't understand the error log, the console log and etc. And I knew that was because lack of basic understanding of Java language.

Hence, I strongly recommend you to read this article before you write any selenium test scripts because you must build your foundation right before you write any scripts.

**

First, we ask WHY ? Why Java ?

**
✅ Java is a programming language that is commonly used in combination with the Selenium web automation tool.

✅ Selenium is a powerful tool for automating web browsers, and it can be used to automate a wide variety of web-based tasks.

✅ When used with Java, Selenium allows developers to write automated tests for web applications using the Java programming language.

✅ This can be useful for a variety of purposes, including functional testing, performance testing, and regression testing. Not only that, selenium has a number of libraries that can be used to extend its functionality or make it easier to use in certain situations.

**

Next, what is Java ?

**

✅ Java is an object-oriented programming (OOP) language.

You may wonder what is OOP means ? Don't freak out.

Let me make this simple for you. For example:
Fruits.

Image description

There are bananas, cherries, oranges, kiwis, grapes and apples in the picture.

✅ These are called Objects.
✅ And what are they categories as ? Fruits

Hence, Fruits is the Class and bananas, cherries, oranges, kiwis, grapes and apples is the Objects.

Is this sound simple ?

What about this picture ?

Image description

We can see trucks , ambulance, bus and car.

And what are they ? Vehicles

So we know Vehicles is Class and trucks , ambulance , bus and car is an Object.

Now, what is the color of the car ? Blue

Blue is the attribute of the Car.

How do we operate the vehicles ? Drive

Drive is the method

We can conclude 4 things from this , we know the class (vehicles), the object (car, bus, trucks, ambulance), attributes (blue, 4 tires , etc) and method (drive).


public class Vehicle { <- this is class = vehicles

String carBrand = honda; <- this is objects and attributes
Int numOfTires = 4; <- this is objects and attributes

void Drive(){ <- this is drive method
System.out.print("Car is driving");
}

public static void main(String[]args){

Car myCar = new Car();

myCar.drive();


This is just a simple java program to show you how the java structure it is. It's OK not to understand everything in the first place. Just get along with me , and I can assure you will have sufficient java knowledge to write your first selenium script with Java.

❤️

Related Articles:
1. Cloud Computing , let’s talk about it [Part 2]
2. AWS ! the terms you must know 🤫
3. ISTQB 🧙🏻‍♀️The software testing Myth, do you need that?
4. Why Software Testing is necessary in the first place?👀

❤️

Connect with me in Linkedin !

bugs Article's
30 articles in total
Favicon
Debug or Be Doomed: How Errors Nearly Sparked World War III
Favicon
The Bug Bounty Dilemma: Are We Rewarding Skills or Exploits in Blockchain?
Favicon
How Can I Create a DevOps Pipeline That Automatically Resolves All Conflicts and Bugs Without Human Intervention?
Favicon
Little Bugs, Big Problems
Favicon
The 29 Days per Year Bug (30 Days for Leap Years!)
Favicon
A Quick Look at Why We Call Them "Software Bugs"
Favicon
Cleaning routines to keep your project without bugs
Favicon
This month we're snug as a bug under a Glitch-powered rug
Favicon
Six Factors That Raise The Risk Of Bugs In A Codebase
Favicon
Error monitoring and bug triage: Whose job is it?
Favicon
5 platform that pay huge if you're an Ethical H4CK3R
Favicon
5 platform that pay huge if you're an Ethical H4CK3R
Favicon
How to optimise JMeter for performance tests
Favicon
Crush Bugs with Laravel Contract-Based Testing
Favicon
When Two Bugs Cancel Out
Favicon
The Anatomy of a Perfect Bug Report: What It Needs to Contain
Favicon
Code Detective: Unraveling Bugs in Your Code
Favicon
Priority and Severity of tasks and bugs
Favicon
Burning Bugs at Manychat: Sharing Expertise and Experience in Bug Management
Favicon
"Bugs in Software Development: Types and Real-World Examples
Favicon
Java 101 for software testing (Using fruits and vehicle as example)
Favicon
Just one more check before I push my changes
Favicon
Reiterating why you should never use Array ‘index’ as ‘key’ in your React Applications
Favicon
Today I intentionally copied a bug
Favicon
What causes bugs?
Favicon
Why are Software bugs named bugs?
Favicon
What Is Holding A Software Tester From Finding Bugs?
Favicon
Data Races with value types in Swift
Favicon
uint vs uint256 -> Small Solidity detail that can cause big Heisenbug
Favicon
dev.to says 1

Featured ones: