All Products
Search
Document Center

Mobile Testing - Deprecated:java_net_MalformedURLException

Last Updated:Feb 28, 2022

Problem description

This exception occurs when the URL format is invalid, such as when an invalid protocol is used or strings cannot be parsed.

Solution

This exception occurs when the URL format is invalid, such as when an invalid protocol is used or strings cannot be parsed. We recommend that you catch the exception and handle it.

Sample code

  public void parse(String location){
      try
      {
        projectUrl = new URL(location);
      }
      catch (MalformedURLException e)
      {
        e.printStackTrace();
      } 
    }

References