Free Source Code and Tutorials

Custom Search

Category: Java

Perform right click using WebDriver

In this post, we will discuss how to perform right click if we are using Selenium WebDriver for automation testing. For this purpose, we need to use Action class . Under Action class various method are defined for serving various actions that are needed to be performed while testing. For right click operation, we have […]

Share this

How do Perform Drag and Drop using WebDriver?

In this post, we will discuss drag and drop using WebDriver. For this purpose, we need to use Action class. Under Actions, class various method is defined to serve various actions that are needed to be performed. One such method is dragAndDrop(). Below is the sample code: < View plain text > java Actions action […]

Share this

Java Regular Expression

Java provides the java.util.regex package for pattern matching with regular expressions. A regular expression is a special sequence of characters that helps you match or find other strings or sets of strings, using a specialized syntax held in a pattern. They can be used to search, edit, or manipulate text and data. The java.util.regex package […]

Share this

How to read Excel file using Selenium WebDriver

Below is a basic code on how to read excel file. As per your requirement you can read the data for excel and play around it. < View plain text > java import;   import;   import;   import org.apache.poi.hssf.usermodel.HSSFWorkbook;   import;   import;   import;   import org.apache.poi.xssf.usermodel.XSSFWorkbook; […]

Share this

Object class in Java

The Object class is the parent/base class of all the classes in java by default. An object class can be used in upcasting. If you don’t know the type of any object we can use Object class to refer that object. Let’s take an example, there is getObject() method that returns an object but it […]

Share this

How to get current date and time of the system in Java ?

In Java we have¬†Date class available in java.util package which¬†encapsulates the current date and time. The Date class have two constructors mentioned below: 1 Date( ) This constructor initializes the object with the current date and time. This doesn’t require any argument. 2 Date(long millisec) We need to provide an argument to this constructor that […]

Share this

The Collection Classes:

The Collection Classes: Java provides a set of standard collection classes that implement Collection interfaces. Some of the classes provide full implementations that can be used as-is and others are abstract class, providing skeletal implementations that are used as starting points for creating concrete collections. The standard collection classes are summarized in the following table: […]

Share this

Exception Handling in Java

An exception is any sort of deviation from what we a program is expecting. When an Exception occurs the normal flow of the program is disrupted and the program/Application terminates abnormally, which is not recommended, therefore these exceptions needs to be handled. The following is an array is declared with 2 elements. Then the code […]

Share this

How to set test case priority in TestNG?

How to set test case priority in TestNG? Setting Priority in TestNG < View plain text > java //Code Snippet   package TestNG;   import org.testng.annotations.*;   public class SettingPriority {   // m1 , m2 and m3 are three methods   @Test(priority=0)   public void m1() {   }   @Test(priority=1)   public void […]

Share this

What are the different types of frameworks?

In this post we will discuss about different type of framework which we can use to automate browser using Selenium WebDriver. Below are the different types of frameworks: 1.Module Based Testing Framework: In this framework we divide the whole project in various isolated and independent module. This division can be either on the basis of […]

Share this
Page 1 of 41234 © 2016 Frontier Theme

Subscribe For Latest Updates

Signup for our newsletter and get notified when we publish new articles for free!