Buy TopCAfirms portal!

Please mail your bid to if you want to buy and operate TopCAfirms portal

Post & search forum related to Study, Articleship & Industrial Training
  • Page:
  • 1

TOPIC: Learn Java Basics For Selenium

Learn Java Basics For Selenium 1 year 4 months ago #3813

Java Basics for Selenium
Below are some basics of JAVA useful for Selenium scripts:

Sample program

If conditions
For loops
Extending class

1. Class:
A class is nothing but a blueprint or a template for creating different objects which define its properties and behaviors. Java class objects exhibit the properties and behaviors defined by its class. A class can contain fields and methods to describe the behavior of an object.

Desired to gain proficiency in Software Testing? Explore the blog post on Selenium Training to become a pro in Selenium.

2. Method:
Methods are nothing but members of a class that provide a service for an object or perform some business logic. Java fields and member functions names are case sensitive. Current states of a class’s corresponding object are stored in the object’s instance variables. Methods define the operations that can be performed in java programming.

3. Objects:
An object is an instance of a class created using a new operator. The new operator returns a reference to a new instance of a class. This reference can be assigned to a reference variable of the class. The process of creating objects from a class is called instantiation. An object encapsulates state and behavior.

An object reference provides a handle to an object that is created and stored in memory. In Java, objects can only be manipulated via references, which can be stored in variables

4. Sample program:

//Executes if Boolean expression is true
//Executes if Boolean expression is false

5. For Loop in Java
The for loop is the type of looping construct. It also works as while loop construct but it provides that the initialization, condition and the increment are same written in the for construct. All the statements which have to be executed are written in the for a block.

for( initialization; termination; increment)
package com.devmanuals2;
public class ForExample {
public static void main(String[] args) {
int i;
System.out.println(i+” Times”);
Checkout Selenium Tutorial

6. Variables:
A variable is a container that stores a meaningful value that can be used throughout a program. For example, in a program that calculates tax on items, you can have a few variables – one variable that stores the regular price of an item and another variable that stores the total price of an item after the tax is calculated on it. Variables store this information in a computer’s memory and the value of a variable can change all throughout a program.
  • Page:
  • 1
  • Not Allowed: to create new topic.
  • Not Allowed: to reply.
  • Not Allowed: to add attachements.
  • Not Allowed: to edit your message.
Time to create page: 0.213 seconds

Buy on  | Buy on  |  Buy on