Forum Discussion

xstoka's avatar
xstoka
New Contributor
13 years ago

Import Statements within Custom Components groovy script

Firstly loadUI is a great tool and i am having lots of fun creating custom components to load test different websites!

I do have a problem though which is that i can not Import certain java classes. In this instance i want to add some regular expressions to my custom components and would like to use the java.util.regexp library.

import java.util.regex;


Using the Import statement at the top of my component causes an error...

ERROR:Compilation of Groovy script failed: unable to resolve class java.util.regex


I have tried to search the forums for a similar answer and have been pointed to adding the java file into the \ext directory but still do not have any luck. It is not just the java.util.regexp library, i have downloaded a few different jar files to try and get them to work but none imports succesfully.

I am not from a java background so maybe im being abit stupid, but Could someone suggest what i need to do to use a library? maybe some simple steps? Do i need to use a @dependency call in my component header?

Thanks!!!
No RepliesBe the first to reply