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
How To Use TestNG with Selenium
1. What is TestNG? TestNG is an open-source automated testing framework with flexible and powerful features. It is...
HOW-TO'S
How To Do Database Testing with JMeter
Introduction In this 'How-To', You will be guided to perform a database load test using JMeter. We will...
NFT AUTOMATION
How To Create FTP Test Plan in JMeter
About File Transfer Protocol File Transfer Protocol is a widely used standard network protocol for FIle sharing between...
PROGRAMMING
How To Remove Duplicates From List in Java
Introduction A List is an interface in the Java collection framework which can be used to store a...
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...
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...
How To Write Windows Environment Variables With VBScript
This is in continuation to the last post where we saw how to read windows environment variables using VBScript. As mentioned in the last post, we can use the following preferred methods to achieve this : Using the WSH Shell object Using WMI's Win32_Environment class In the below example we would be using the WSH Shell's Environment method. For 'strEnvVarType',...
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...
How-To VBScript
How To Read Windows Environment Variables With VBScript
Reading an environment variable is simple. There are a couple of methods available to do this but the...
Java Gists
Remove Duplicates from List Using Set.addAll
The Set interface has a method called addAll. This accepts a 'Collection' as the parameter. So if you...
ÂÂ



