import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
def uri = new URI('data:text/html;charset=utf-8,%3Cdiv%3EKatalon%3C%2Fdiv%3E')
WebUI.comment("URI successfully instanciated")
def url = new URL('data:text/html;charset=utf-8,%3Cdiv%3EKatalon%3C%2Fdiv%3E')
WebUI.comment("URL successfully instanciated")
When I run it, I got the following messages:
URI successfully instanciated
Test Cases/TC1 FAILED because (of) java.net.MalformedURLException: unknown protocol: data
This proves that the Java Language treats a String
Passed some time, but I have the same error and do not understand how to solve it.
I want to go to a url (protocol: data) data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAA… to take an image and receive the exception “java.net.MalformedURLException: unknown protocol: data”
Can you help me with something? or is there no solution for java?
If you provide a concrete implementation of URLStreamHandler for data scheme, you would be able to construct an instance of java.net.URL of data: scheme.
But this explanation would not eventually solve your problem. You would want Katalon Studio to accept the instance of java.net.URL of ‘data’ which you (your test case script) instantiated. However Katalon Studio does not support such customizability.
So, you should not regard your problem is due to a shortage of Java language. You should rather raise a feature request for Katalon Studio. If you are willing to, you should describe your problem with more information (runnable codes at least) so that Katalon Team can understand what exactly is the point to be improved.