Contents of Automation and Manual testing

The blog gives you idea of testing and automation testing example of selenium webdriver,SQl and Jmeter, you see the basic example of selenium web driver and get idea how to do automation testing,

Selenium UnreachableBrowserException - “Could not start a new session”

Some time selenium unable to reached the browser and through some exception : "Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure."
Build info: version: '2.45.0', revision: '5017cb8', time: '2015-02-26 23:59:50'
System info: host: 'SmithPC', ip: '10.0.2.15', os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.8.0_45'
Driver info: driver.version: ChromeDriver
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:593)
    at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:240)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:126)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:139)
    at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:171)
    at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:160)
    at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:117)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

To resolve this you have to do only small changes in the host file.


Host file Location : C:\Windows\System32\drivers\etc

In your host file you have to add localhost entry, as i mention below then run your Selenium or Testng code and check it will work fine.

127.0.0.1            Localhost


I am encounter the same problem, after a long search will found this solution and it worked for me, I hope it will work for you also. 

How to Convert String Date into Millseconds

In your project you have some date and as project requirement you want to convert it into milliseconds or while code you need to convert date into other format, I am same date in file saving, long date is used in file name but it use depend on the developer.


1) First convert string to java.Date using simpledateformatter
2) Use getTime method to obtain count of millisecs from date

public class test {
    public static void main(String[] args) {

         String currentDate = "01-March-2016";
         SimpleDateFormat f = new SimpleDateFormat("dd-MMM-yyyy");
         Date parseDate = f.parse(currentDate);
         long milliseconds = parseDate.getTime();
    }
}
Powered by Blogger.