WEBLOG
Format Decimal Numbers Using Locale
If you want to create a DecimalFormat instance for a specific Locale, create a NumberFormat and cast it to a DecimalFormat. The java.text.DecimalFormat class is used to format numbers using a user specified formatting. This concrete subclass of NumberFormat, allows formatting decimal numbers via predefined patterns specified as String . It has a variety of features designed to make it...
Desired Capabilities in Selenium Web Driver
1. Desired Capabilities in Selenium The performance of a Web application may vary according to different browsers and operating systems. Hence to ship out a near-consistent functional and performant application, it calls for testing your applications against different browsers or browser configurations. That is where Selenium's 'Desired Capabilities' class comes into the picture. 'DesiredCapabilities' is a class in Selenium that can...
Format Decimal Numbers Using Pattern
The java.text.DecimalFormat class is used to format numbers using a user specified formatting. This concrete subclass of NumberFormat, allows formatting decimal numbers via predefined patterns specified as String. It has a variety of features designed to make it possible to parse and format numbers in any locale The following example shows formatting decimal numbers using various string patterns: 4c8d7923a6dcd7cdc6ac489ba6c59bdc The above code...
Java Tutorial #7 Part 1 – Classes & Objects
Classes are a very important concept in Java. Java code always needs to be written in a class. In this article, we will be taking a very close look at classes and understanding their syntax and semantics. Classes and objects A class defines a new data type. Once defined, this new type can be used to create objects of that type....
How To Use Mouse and Keyboard Events with Selenium
In this tutorial, we will discuss how to use mouse click events and keyboard events with Selenium WebDriver. The mouse click and keyboard events are used to automate the interactions of a user with a mouse and keyboard. Action & Actions We encourage the use of Action and Actions together with the keyboard and mouse events. Action & Actions are user-facing...
Java Tutorial #6 – Jump Statements
Introduction The break statement is used to stop further execution. It can be used either in a loop or within a switch statement. Break Statement The break statement is used to stop further execution. It can be used either in a loop or within a switch statement. Break in a loop When the break statement is used within a loop, it terminates the loop....
HomeWeblog
FT AUTOMATION
Best Practices For Evaluating Automation Tool
With rapidly changing financial conditions, businesses face the tough challenge of optimizing resources to produce maximum results....
HOW-TO'S
How To Install Oh-My-Posh On Windows PowerShell
Oh-My-Posh is a powerful custom prompt engine for any shell that has the ability to adjust the...
NFT AUTOMATION
How To Do API Testing with JMeter
Introduction Application Programming Interface is a very popular term among developers. It is simply a request provider that...
PROGRAMMING
Rounding Decimal Number With Java DecimalFormat
The DecimalFormat class has a method called setRoundingMode() which can be used for setting the rounding mode...
Getting Started with Apache JMeter
1. Introduction As a developer, you may have tested the functionality of your code hundreds of times during development. This is known as functional testing. Despite how familiar you are with your product, users will approach it differently and have many different use cases. That’s why you need Non-Functional Testing (NFT). Performance, Security, Usability, and Reliability are just some of...
Remove Duplicates from List Using HashSet
The Set is also an interface in the 'Java Collection' framework. Unlike a List, a Set does not allow duplicates. Hence you can use a Set to eliminate the duplicates in a List. There are several ways in which you can use a Set to eliminate duplicates as demonstrated below: The most commonly used implementation of Set is HashSet....
How To Convert List To Array in Java
A common scenario faced by programmers is to convert a Java List to an Array. A 'List' is part of the Collection Framework and is useful when the number of elements are unknown. An 'Array', on the other hand, is useful for fixed-size elements. However, in real-world programming, there are often situations when you would need to convert a List...
Convert List to Array Using Stream without Param
Java 8 has added the Stream API that helps to easily perform bulk operations on Collections. A new method called stream() has been added to all the collection interfaces that returns a Stream corresponding to the underlying collection. There is a toArray method available on the Stream interface that can be used to convert the Stream to an array. So...
Remove Duplicates from List Using For-Loop
The simplest way to remove duplicates from a 'List' is to use a for-loop. The following code snippet demonstrates this method. First, the code creates a new ArrayList to store the output, i.e. a List without duplicates. A for-loop is then used which iterates through the input List. It first checks if the input element is present in the output...
Convert List to Array Using For-Loop
The simplest way to convert a List to an array is to use a for-loop. The following code snippet demonstrates this method. First, the code creates an Array based on the number of elements in the input List. A for-loop is then used which iterates through the input List and adds each element of the List to an Array. Finally,...
How To Auto-launch VBscript with Elevated Privileges
For cases when you need to execute a VBS script (*.vbs file) as admin with elevated privileges you can try the following snippet. This can be done by running ShellExecute and setting the runas flag to run an executable or to run an entire script (batch file or VBScript) with elevated permissions. You can copy/embed the following snippet into...
CODE SNIPPETS | CODEX
Java Gists
Concatenate Strings Using Plus Operator
In Java, a String is a sequence of characters. There are often programming situations where you will need...
Java Gists
Convert List to Array Using Stream with Param
There is an overloaded version of the Stream.toArray method which can be used to return a result array...
Java Gists
Remove Duplicates from List Using Stream
Java 8 has added the Stream API that helps to easily perform bulk operations on Collections. A new...
ÂÂ



