I am getting below error when I am trying to use the SwingLibrary

java.lang.ClassCastException: SwingLibrary cannot be cast to org.robotframework.javalib.library.RobotJavaLibrary

My Keyword is written like below

 *** Keywords ***
 Start Demo Application
    [Arguments]    ${name}
    Start Application    ${name}    java ${MAIN CLASS}    10 seconds    ${LIB DIRECTORY}
    Take Library Into Use    SwingLibrary

I see that my application does get invoked but I get error.

Please help.

有帮助吗?

解决方案

EDIT: this issue was fixed in the 1.9.1 release.

The newest version of SwingLibrary no longer implements AnnotationLibrary (which implements RobotJavaLibrary). It has the necessary methods so you should be able to subclass it and use that library with RemoteApplications.

public class RemotableSwingLibrary extends SwingLibrary implements RobotJavaLibrary {}
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top