您必須創建文件主機器人框架如:
import org.robotframework.RobotFramework;
public class RobotFrameworkTest {
public static void main(String[] args) {
prepareYourEnvironmentTest();
RobotFramework.main(args);
}
private static void prepareYourEnvironmentTest() {
// your code
}
}
在pom.xml文件中,您必須使用maven遮罩插件:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<manifestEntries>
<Main-Class>ors.robotframework.RobotFrameworkTest</Main-Class>
</manifestEntries>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
太棒了! 我使用spring框架來創建機器人測試庫。有用!謝謝 – hoang