Forum Discussion

AymenFNZ's avatar
Frequent Visitor
2 years ago

Load the library dynamically WITHOUT Thread.sleep



Here at the bottom of the page, it says how to dynamically load a lib.


However the solution proposed isn't qualitative; it says to do a Thread.sleep(3000)... But this isn't a guarantee that the lib is effectively loaded!


As proof, I did this in my "Setup script" of my test suite, like this:


String customGroovyLibsPath = (new File(testSuite.project.getPath())).getParent() + File.separator + "GroovyLibs"

if ([ 'soapui.scripting.library' ] != customGroovyLibsPath) {[ 'soapui.scripting.library' ] = customGroovyLibsPath


 On the first execution of my test suite, most of the time, it ends up in an error.


So, my question is how can I make "absolutely" sure my library is fully loaded, without using Thread.sleep and passing to it an arbitrary big amount of time?

No RepliesBe the first to reply