Forum Discussion

EllaVader's avatar
EllaVader
Occasional Contributor
12 years ago

custom component doesn't show up

Hi all -- I am working on creating a custom component in LoadUI.
I am having issues with my .groovy file even showing up after I place it in the script-components folder.

I am running LoadUI v2.5.1 on a Mac 10.7.5

I am also seeing this same behavior on a pc laptop. The component doesn't show up. Is there something different in this version of LoadUI that is not consistent with the video on the Developers Corner page on creating custom components? http://www.loadui.org/Developers-Corner/custom-component-reference-new.html
I am following along with the video and it is a simple groovy script that looks like this:


/**
* @name DataSource
* @category flow
*/

println 'Hello LoadUI!'


Additionally, if i close the LoadUI application and re-open it, I am unable to load any projects. And I can't quit the LoadUI program after that as well. I have to force quit the program. What am I doing wrong with dropping that .groovy file in the directory is causing all these issue?
Thanks in advance.

6 Replies

  • EllaVader's avatar
    EllaVader
    Occasional Contributor
    An update on this...when I look in the error.log file I see this after dropping my test groovy script into the script-components directory:

    Exception in runnable
    com.google.common.util.concurrent.UncheckedExecutionException: java.lang.NullPointerException
    at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2263)
    at com.google.common.cache.LocalCache.get(LocalCache.java:4000)
    at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:4004)
    at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4874)
    at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:4880)
    at com.google.common.cache.LocalCache$LocalLoadingCache.apply(LocalCache.java:4898)
    at com.google.common.collect.Iterators$8.transform(Iterators.java:860)
    at com.google.common.collect.TransformedIterator.next(TransformedIterator.java:48)
    at com.google.common.collect.Lists.newArrayList(Lists.java:145)
    at com.google.common.collect.Lists.newArrayList(Lists.java:125)
    at com.eviware.loadui.ui.fx.util.ObservableLists$2.invalidated(ObservableLists.java:197)
    at javafx.beans.WeakInvalidationListener.invalidated(WeakInvalidationListener.java:80)
    at com.sun.javafx.collections.ListListenerHelper$SingleInvalidation.fireValueChangedEvent(ListListenerHelper.java:100)
    at com.sun.javafx.collections.ListListenerHelper.fireValueChangedEvent(ListListenerHelper.java:48)
    at com.sun.javafx.collections.ObservableListWrapper.callObservers(ObservableListWrapper.java:97)
    at com.sun.javafx.collections.ObservableListWrapper.setAll(ObservableListWrapper.java:303)
    at com.eviware.loadui.ui.fx.util.ObservableLists$4$1.run(ObservableLists.java:257)
    at com.sun.javafx.application.PlatformImpl$4.run(PlatformImpl.java:173)
    at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:76)
    Caused by: java.lang.NullPointerException
    at com.eviware.loadui.ui.fx.views.canvas.ComponentDescriptorView.<init>(ComponentDescriptorView.java:45)
    at com.eviware.loadui.ui.fx.views.canvas.CanvasView$4.apply(CanvasView.java:189)
    at com.eviware.loadui.ui.fx.views.canvas.CanvasView$4.apply(CanvasView.java:185)
    at com.eviware.loadui.ui.fx.util.ObservableLists$1.load(ObservableLists.java:170)
    at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3599)
    at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2379)
    at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2342)
    at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2257)
    ... 18 more
  • EllaVader's avatar
    EllaVader
    Occasional Contributor
    So if anyone has any insight with creating a custom component from scratch in version 2.5.1, that would be greatly appreciated.

    It appears is if you must have a corresponding .png file in place for the .groovy script to even show up on the workbench? Additionally, if you don't specify category in the comment header, it won't show up either. And if you do get past that point where it will show up in the work bench, if you drag your "empty" component onto the workarea, it just flashes and goes away. It appears as if you must have a layout in coded. This appears to be contradictory to what all of the video tutorials describe on the website. I says if you simply have a blank groovy file in place, and drag it onto the work space, a component shell will appear, but won't have any functionality.

    If I am doing something wrong, please let me know. Or if things have changed since this recent version of LoadUI, can you also let me know.
  • Filip's avatar
    Filip
    Occasional Contributor
    I have exactly the same problem. Is there any chance for the support from the support ?
  • Filip wrote:
    I have exactly the same problem. Is there any chance for the support from the support ?

    This should work now.

    Which version are you using? Could you send the component to henrik dot olsson at smart bear com (or post it here) so I can have a look at it?

    Regards

    Henrik
    LoadUI team
  • Filip's avatar
    Filip
    Occasional Contributor
    I am using 2.6.4 build version: 20131106-1445.
    It is not component specific. I am just playing and learning.
    If a new groovy file is placed in the directory it is required to reopen the project to make the component available.
    If the groovy file is changed it is also required to reopen the project to observe the changes.
    It just makes playing and learning much less fun...

    I am not exactly sure what shell I send by mail.
  • Filip wrote:
    I am using 2.6.4 build version: 20131106-1445.
    It is not component specific. I am just playing and learning.
    If a new groovy file is placed in the directory it is required to reopen the project to make the component available.
    If the groovy file is changed it is also required to reopen the project to observe the changes.
    It just makes playing and learning much less fun...

    Ok. We just tried in 2.6.6 and cannot reproduce the problem:

    Most changes to components propagates to the GUI within 5 seconds. Only in rare cases, we get a XmlProviderDisconnectedException and have to recreate the component (alternatively reloading the project).

    It might be worth trying 2.6.6. Which OS are you running btw?