RemoteServer - How to use Java Keyword in Robotframework?

后端 未结 2 789
情深已故
情深已故 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 includePatterns = new ArrayList() {{
        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();
        }
    }
    }
    

提交回复
热议问题