Eclipse for Robot框架(java版本)项目:如何运行特定标记?

Eclipse for Robot框架(java版本)项目:如何运行特定标记?,eclipse,robotframework,ui-automation,Eclipse,Robotframework,Ui Automation,我的项目使用Maven引用所有需要的库,因此我甚至不需要手动安装robot framework(我只是将markusbernhardt的Selenium2Library作为依赖项包含在pom.xml中): org.seleniumhq.selenium 然而,我不知道如何告诉robot框架我想要运行带有特定标记的测试。我没有从命令行运行robot framework,因为我的机器中没有安装robot framework,我只是将其作为maven依赖项使用,因此无法运行python-m ro

我的项目使用Maven引用所有需要的库,因此我甚至不需要手动安装robot framework(我只是将markusbernhardt的Selenium2Library作为依赖项包含在pom.xml中):


org.seleniumhq.selenium

然而,我不知道如何告诉robot框架我想要运行带有特定标记的测试。我没有从命令行运行robot framework,因为我的机器中没有安装robot framework,我只是将其作为maven依赖项使用,因此无法运行
python-m robot.run--include标记

我尝试在运行配置中添加
--include tag
作为参数,但被忽略


有没有一种方法可以在Eclipse中将此标记参数发送给robot?

刚刚了解了如何发送!在此处留下信息,以防对其他人有所帮助:

都在pom.xml中:

  <dependencies>
    <dependency>
      <groupId>org.seleniumhq.selenium</groupId>
      <artifactId>selenium-java</artifactId>
      <version>3.4.0</version>
    </dependency>
    <dependency>
      <groupId>com.github.markusbernhardt</groupId>
      <artifactId>robotframework-selenium2library-java</artifactId>
      <version>1.4.0.8</version>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <groupId>org.robotframework</groupId>
        <artifactId>robotframework-maven-plugin</artifactId>
        <version>1.4.7</version>
        <executions>
          <execution>
            <goals>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
添加一个
第一级元素(在
中),其中包含您选择的属性名称和要运行的标记,如下所示:

<properties>
  <robot-tag>mytag</robot-tag>
</properties>
就这样。运行配置不需要更改。该项目也可以作为Maven安装运行

这就是我的pom.xml现在的样子(去掉元素和特定于项目的信息,如groupID、artifactID等):


调试
org.seleniumhq.selenium
硒爪哇
3.4.0
com.github.markusbernhardt
robotframework-selenium2library-java
1.4.0.8
org.robotframework
机器人框架maven插件
1.4.7
跑
${robot tag}
<configuration>
  <includes>
    <include>${robot-tag}</include>
  </includes>
</configuration>
  <properties>
    <robot-tag>debug</robot-tag>
  </properties>
  <dependencies>
    <dependency>
      <groupId>org.seleniumhq.selenium</groupId>
      <artifactId>selenium-java</artifactId>
      <version>3.4.0</version>
    </dependency>
    <dependency>
      <groupId>com.github.markusbernhardt</groupId>
      <artifactId>robotframework-selenium2library-java</artifactId>
      <version>1.4.0.8</version>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <groupId>org.robotframework</groupId>
        <artifactId>robotframework-maven-plugin</artifactId>
        <version>1.4.7</version>
        <executions>
          <execution>
            <goals>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <includes>
            <include>${robot-tag}</include>
          </includes>
        </configuration>
      </plugin>
    </plugins>
  </build>