I am getting Exception in Selenium Webdriver (Java)
java.net.MalformedURLException: unknown protocol: maps
While Checking all Active Links(URLs) present on the page
The Code is as follows:
for(int j=0;j<activeLinks.size();j++)
{
String strURL = activeLinks.get(j).getAttribute("href");
HttpURLConnection connection = (HttpURLConnection)newURL(activeLinks.get(j).getAttribute("href")).openConnection();
connection.connect();
String response = connection.getResponseMessage(); //ok
connection.disconnect();
System.out.println(activeLinks.get(j).getAttribute("href")+"--> " +response);
}