Java 8 introduces ZonedDateTime, you can now easily get the local time and date based on timezones. Take look at the example below
If you would like to keep your variables’ values separate from different threads and would also like to access the variables without having to pass them as parameters then a good way would be to use the ThreadLocal. ThreadLocal is used for thread-local variables. Here is an example on how to use it. Create the …
Here are the dependencies you will need to use Selenium and PhantomJS with Maven. and in your code call the following WebDriverManager downloads the latest version of the required PhantomJS binary to be used with Selenium WebDriver.
When using PhantomJS visa GhostDriver with Selenium, you will get all kinds of log messages which would not be necessary in some instances. The example below shows how to disable these log messages.
The example below shows how you can configure PhantomJS to use proxies with your web testing.
The following applies if you are running a console based multi-threaded Java application. You can get a full stack dump by pressing the following keys on your keyboard. Ctrl+Break
If your Java application makes use of files using paths, it’s best not to use slash “/” or backslash “\” hard coded in your source code. Use the following to ensure your program would work as expected on both Windows and Unix like systems.
If you find that your Java application is running our of heap space and you don’t have a memory leak, you can give the JMV more memory. This is very simple to do by starting your java application with the following argument. You have three options for increasing size
If you do any socket programming on Java or use any library that does, there will come a time that you need to monitor the traffic going through your application. You will need the following class in order to see the traffic in Fiddler You can initialize the above class by the following
Here is a simple method that can compare the difference in seconds, minutes, hours and days.