我使用Maven Failsafe + TestNG来运行Selenium测试。我知道这是可能通过在pom.xml中定义这样的系统性能参数传递给我的TestNG的测试:在不使用testng.xml的情况下使用Selenium和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>
我TestNG的测试是指该物业是这样的:
@Parameters("browser")
public void setUpClass(@Optional("firefox") String browser)
{
...
}
不过,我是想知道是否可以并行运行跨浏览器测试而不需要指定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>
是否有可能通过pom.xml配置实现此目的?由于我的项目具有多模块性质,我并不热衷于使用testng.xml文件。
“我正在尝试这样的事情,但没有奏效。”有什么问题?在捕获浏览器的价值之后,你在做什么? –
我想在多个浏览器上并行运行硒测试。为了清晰起见,我会更新我的问题。 –