RemoteServer - How to use Java Keyword in Robotframework?

后端 未结 2 790
情深已故
情深已故 2021-01-28 19:05

I\'m trying to implement JavaLibCore to use Java method in robotframework. I followed this tutorial : https://blog.codecentric.de/en/2016/01/robot-framework-tutoria

相关标签:
2条回答
  • 2021-01-28 19:56

    Please find my solution below:

    public class KeywordRemoteLibrary extends AnnotationLibrary {
    
    static List<String> includePatterns = new ArrayList<String>() {{
        add("keywords/*.class");
    }};
    
    public KeywordRemoteLibrary() {
        super(includePatterns);
    }
    
    public static void main(String[] args) {
        RemoteServer server = new RemoteServer("127.0.0.1", 8270);
        server.putLibrary("/RPC2", new KeywordRemoteLibrary());
        try {
            server.start();
        }
        catch(Exception e) {
            e.printStackTrace();
        }
    }
    }
    
    0 讨论(0)
  • 2021-01-28 20:00

    Try with this code:

    RemoteServer.configureLogging();
    RemoteServer server = new RemoteServer();
    server.putLibrary("/keywords", KeywordRemoteLibrary.class);
    server.setPort(8271);
    server.start();
    
    0 讨论(0)
提交回复
热议问题