Getting null from select statement referencing a spinner control

53 views
Skip to first unread message

Bob R

unread,
Dec 28, 2020, 9:33:43 PM12/28/20
to Marathon Java GUI Testing
I am trying out Marathon with our javafx application.  I've had success with the recorder until I tried to interact with a spinner control in one of our dialogs.  The recorder generated the below select statement, but when I play the test script back I am getting error -
net.sourceforge.marathon.javafxagent.JavaAgentException:null: net.sourceforge.marathon.javafxagent.JavaAgentException:null
when the playback hits the select("scaleSpinner", "105")line
Any ideas or pointers?

code snip
   with_window("AUT-window-name") {
        select_fx_menu("#menu", "BOC>>Characteristic Properties...")
        with_window("Characteristic Properties")
            select("scaleSpinner", "105")
            select("scaleSpinner", "110")
            select("scaleSpinner", "115")
            select("scaleSpinner", "100")
            assert_p("nominalField", "text", "6.678")
        }
    }
Here's a snip of the generated omap data
- !!net.sourceforge.marathon.objectmap.OMapComponent
    componentRecognitionProperties:
    - {method: equals, name: Id, value: scaleSpinner}
    - {method: equals, name: tagName, value: spinner}
    created: 1608841990168
    generalProperties:
    - {name: name, value: scaleSpinner}
    - {name: id, value: scaleSpinner}
    - {name: tagName, value: spinner}
    - {name: Id, value: scaleSpinner}
    - {name: indexOfType, value: '0'}
    - {name: component.class.name, value: javafx.scene.control.Spinner}
    - {name: instanceOf, value: javafx.scene.control.Spinner}
    - {name: enabled, value: 'true'}
    - {name: type, value: spinner}
    modified: 0
    name: scaleSpinner
    used: true

Aditya Chandrasekhar Karra

unread,
Dec 29, 2020, 1:26:06 AM12/29/20
to Marathon Java GUI Testing
Hi Bob

Can you please share the full stack trace and also. Is it possible to have a component screenshot?

Thanks & Regards
Aditya Karra
Jalian Systems Pvt. Ltd.

Jalian Systems Pvt. Ltd.
#457, 5th Main, 3rd Cross, 5th Block, 1st Stage, H B R Layout,
Bengaluru 560043, INDIA

Bob R

unread,
Dec 29, 2020, 8:17:09 AM12/29/20
to Marathon Java GUI Testing
I found the full stack trace after my initial post.  
Dec 28, 2020 5:32:27 PM net.sourceforge.marathon.javafxagent.server.JavaServer handleRoute
WARNING: null
net.sourceforge.marathon.javafxagent.JavaAgentException
at net.sourceforge.marathon.javafxagent.server.JavaServer.invoke(JavaServer.java:514)
at net.sourceforge.marathon.javafxagent.server.JavaServer.handleRoute(JavaServer.java:408)
at net.sourceforge.marathon.javafxagent.server.JavaServer.serve_internal(JavaServer.java:371)
at net.sourceforge.marathon.javafxagent.server.JavaServer.serve(JavaServer.java:326)
at fi.iki.elonen.NanoHTTPD.serve(NanoHTTPD.java:2244)
at fi.iki.elonen.NanoHTTPD$HTTPSession.execute(NanoHTTPD.java:945)
at fi.iki.elonen.NanoHTTPD$ClientHandler.run(NanoHTTPD.java:192)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NullPointerException
at net.sourceforge.marathon.javafxagent.components.JavaFXTextInputControlElement.marathon_select(JavaFXTextInputControlElement.java:45)
at net.sourceforge.marathon.javafxagent.components.JavaFXSpinnerElement.marathon_select(JavaFXSpinnerElement.java:58)
at net.sourceforge.marathon.javafxagent.JavaFXElement.getByPseudoElement(JavaFXElement.java:190)
at net.sourceforge.marathon.javafxagent.components.JavaFXSpinnerElement.getByPseudoElement(JavaFXSpinnerElement.java:67)
at net.sourceforge.marathon.javafxagent.css.PseudoElementFilter.match(PseudoElementFilter.java:60)
at net.sourceforge.marathon.javafxagent.css.SimpleSelector.filterMatches(SimpleSelector.java:180)
at net.sourceforge.marathon.javafxagent.css.SimpleSelector.found(SimpleSelector.java:138)
at net.sourceforge.marathon.javafxagent.css.SimpleSelector$2.till(SimpleSelector.java:97)
at net.sourceforge.marathon.javafxagent.EventQueueWait$1.run(EventQueueWait.java:46)
at net.sourceforge.marathon.javafxagent.EventQueueWait$8.run(EventQueueWait.java:237)
at com.sun.javafx.application.PlatformImpl.lambda$null$5(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$6(PlatformImpl.java:294)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$3(WinApplication.java:177)
... 1 more

screen snip.  During the recording I clicked on the up and down arrows of the spinner.


Bob R

unread,
Dec 29, 2020, 8:30:19 AM12/29/20
to Marathon Java GUI Testing
Did the screen snip get included?  I'm not seeing it.  I'll include it here as an attachment.
Also, I've noticed this line in the log from our application.  I don't know if it's related.
Dec 28, 2020 5:31:51 PM javafx.fxml.FXMLLoader$ValueElement processValue
WARNING: Loading FXML document with JavaFX API of version 11.0.1 by JavaFX runtime of version 8.0.232
SpinnerControl.PNG

Bob R

unread,
Dec 29, 2020, 2:07:39 PM12/29/20
to Marathon Java GUI Testing
I have attached the UI from a playback in debug mode, stepping into the select("scaleSpinner", "105") line.  I see the 105 value is getting filled into the spinner text field, spinner control was enabled then another control in the UI enabled, then I think NPE was hit.  I found what I think is the source code file in github.  Looks like cell is null. I'm getting out of my knowledge area here so my next statement maybe be way off.  I'm thinking the ENTER after the value is sent/filled in is kicking our app off, it's running with the new value, taking the focus off the spinner control, putting it on another control, then the cell is returning null or the commitEdit is returning null because the spinner is no longer in focus.
SpinnerControlPlayBack.PNG
CodeSnip.PNG
Message has been deleted

Aditya Chandrasekhar Karra

unread,
Dec 30, 2020, 12:52:35 AM12/30/20
to Marathon Java GUI Testing
Hi Bob

We will be releasing new version in next week. This issue will be fixed in it. Sorry for the inconvenience caused. 

Thanks & Regards
Aditya Karra

Bob R

unread,
Dec 30, 2020, 8:44:16 AM12/30/20
to Marathon Java GUI Testing
Aditya,
Very good.  Thanks in advance.  I look forward to the new version.
Bob R.

Aditya Chandrasekhar Karra

unread,
Jan 21, 2021, 4:30:12 AM1/21/21
to Marathon Java GUI Testing
Hi Bob,

We have release new version of Marathon fixed with bug. Please let us know if there are any issues.

Thanks & Regards
Aditya Karra.

Bob R

unread,
Jan 25, 2021, 8:33:31 AM1/25/21
to Marathon Java GUI Testing
Very good.  thanks.
Reply all
Reply to author
Forward
0 new messages