Jam*_*mar 5 java testng selenium maven selenium-webdriver
我正在使用Maven Failsafe + TestNG来运行Selenium测试.我知道可以通过在pom.xml中定义系统属性来将参数传递给我的TestNG测试,如下所示:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.19.1</version>
<configuration>
<systemPropertyVariables>
<browser>firefox</browser>
</systemPropertyVariables>
</configuration>
</plugin>
Run Code Online (Sandbox Code Playgroud)
我的TestNG测试将此属性称为:
@Parameters("browser")
public void setUpClass(@Optional("firefox") String browser)
{
...
}
Run Code Online (Sandbox Code Playgroud)
但是,我想知道是否可以并行运行跨浏览器测试而无需指定testng.xml文件.我正在尝试这样的事情,但它没有用.感谢您是否可以提供帮助.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.19.1</version>
<configuration>
<systemPropertyVariables>
<browser>firefox, chrome</browser>
</systemPropertyVariables>
<parallel>tests</parallel>
</configuration>
</plugin>
Run Code Online (Sandbox Code Playgroud)
是否可以通过pom.xml配置实现这一目标?由于我的项目具有多模块特性,我并不热衷于使用testng.xml文件.
| 归档时间: |
|
| 查看次数: |
626 次 |
| 最近记录: |