Home » Core Java

Core Java

Java XPath Performance Tips

1. Introduction This is the third article in a series dealing with using XPath within a Java application. This article focuses attention on tips for improving XPath performance. The first two articles were: A Java XPath Best Practices Tutorial https://examples.javacodegeeks.com/core-java/xpath-best-practices-tutorial/ Which showed how to setup and evaluate XPath expressions using Java. Java XPath Examples https://examples.javacodegeeks.com/core-java/xml/xpath/java-xpath-examples/ Which explored XPath syntax and ...

Read More »

Selenium Grid Docker Tutorial

1. Introduction In this example set, we will be exploring the functionality of selenium grid on Docker container. We will be deploying the hub and nodes of Selenium Grid on the Docker container and will be linking together so that we could run test cases on the docker container. Environment of the Project: 1. Selenium Grid 3.0.1 2. Maven 4.0 3. TestNG ...

Read More »

Java XPath Examples

1. Introduction The previous article, Java XPath Best Practices Tutorial (https://examples.javacodegeeks.com/core-java/xpath-best-practices-tutorial/), explored how to set up a Java application to create a DOM (Document Object Model) document using a DOM parser to read an XML file; and an XPath object to evaluate XPath expressions as applied to the DOM. This article dives into how to construct XPath expressions. Starting with ...

Read More »

XPath Best Practices Tutorial

XPath is used to retrieve and interpret information represented in XML files. This tutorial assumes that the reader has a working knowledge of XPath, does not attempt to teach XPath. This tutorial instead shows you, the reader, how to create a simple Java SE application that uses XPath expressions to get information about a computer inventory stored in an XML ...

Read More »

Selenium Chromedriver Tutorial

 1. Introduction In this example set, we will be exhibiting the concept of Data Driven Testing (DDT) by passing multiple sets of data using Apache POI and Web driver interface of Chrome Driver and thus testing them on the Facebook URL. In this tutorial, we will be passing multiple sets of username and password from spreadsheet “Testdata.xls” to Facebook URL. ...

Read More »

Lombok Utility and Scrapbook an eclipse feature

Today we are going to see couple of utility features which could ease coding and help you save some time. They have handy features and I would recommend to have a look and try it. Let’s start a utility called Lombok which is an open source and helps to make code clean and reduce the boiler plate code. It’s very easy ...

Read More »

Java Nio Write File Example

With this example we are going to demonstrate how to use the Non-blocking I/O API, or NIO.2 API (NIO API) for short, to write data to a file. The examples in this article are compiled and run in a Mac OS unix environment. Please note that Java SE 8 is required to run the code in this article. 1. Introduction to ...

Read More »

Java 8 Anonymous Function Example

1. Introduction Java is an object Oriented Programming Language, and as such concepts like Encapsulation and Abstraction sits at the heart of it. However, since Java is a bit-too-much Object Oriented at its genome structure, that often times than not, it adds a lot of verbosity and boiler plate to its language constructs. Even simple, trivial requirement of creating an ...

Read More »

JAVA ActionEvent Example

1. Introduction An Action can be used to separate functionality and state from a component. For example, if you have two or more components that perform the same function, consider using an Action object to implement the function. An Action object is an action listener that provides not only action-event handling, but also centralized handling of the state of action-event-firing ...

Read More »

Mockito Mock Database Connection Example

A unit test should test a class in isolation. Side effects from other classes or the system should be eliminated if possible. Mockito lets you write beautiful tests with a clean & simple API. In this example we will learn how to write a simple test case using Mockito. Tools and technologies used in this example are Java 1.8, Eclipse ...

Read More »

Want to take your Java skills to the next level?

Grab our programming books for FREE!

Here are some of the eBooks you will get:

  • Spring Interview QnA
  • Multithreading & Concurrency QnA
  • JPA Minibook
  • JVM Troubleshooting Guide
  • Advanced Java
  • Java Interview QnA
  • Java Design Patterns