Posts

Showing posts from August, 2021

Java Program to Read a Properties file and return a Property Value

Image
  Properties file in Java is used to store configurations, data or settings for a project. They have been utilized as Object Repositories for Automation Projects in the past (and still are used in legacy projects) until the Page Object Model came along.  This makes reading of Properties files an important concept in Java. This Tutorial will cover the below topics: 1. Create  Properties file in a Java Project 2. Set Properties in the file 3. Read the Properties file using Java code and return the value Let's first see how to create a Properties file for your Project. Its really easy.  In Eclipse, right click on the folder where you want to create the file, and navigate to New -> File. Now enter the file name, and make sure to enter the extension as .properties The file has been created! Now, the next step, i.e. enter some data in the file that we'll read using Java. The properties stored in the properties file have to follow a certain format.  You can enter l...

What is my IP Address - How to find your IP address on Local Network using Command Prompt, and External Network using JavaScript Code

Image
  IP Address or Internet Protocol Address, is a set of numeric (IPv4) or Alphanumeric (IPv6) characters, which uniquely identify a system on the internet. As per wikipedia: An Internet Protocol address is a numerical label such as 172.16.254.1 that is connected to a computer network that uses the Internet Protocol for communication. An IP address serves two main functions: host or network interface identification and location addressing.   Wikipedia So, the next question is, what is my IP address? Now, there are two kinds of IP address, Internal IP - which identifies your machine on an internal network such as your home network connected to a router, and External IP, which identifies the network on the WWW i.e. the world wide web.  Let's try to find our IP address! To find your Internal IP address, you just need to know a few basic commands.  Open the Command Prompt on a Windows machine, press Windows + R: Click on OK. Now, simply type the command - ipconfig This sim...