当我尝试在LambdaTest Selenium Grid上运行时,我的测试按顺序运行,但不是并行运行。以下是我的Maven Pom文件的一小部分:
<executions>
<execution>
<id>test-chrome</id>
<phase>test</phase>
<configuration>
<env>chrome</env>
<inParallel>true</inParallel>
<nodes>4</nodes>
<specsDir>specs</specsDir>
</configuration>
<goals>
<goal>execute</goal>
</goals>
</execution>
<execution>
<id>test-firefox</id>
<phase>test</phase>
<configuration>
<env>firefox</env>
<inParallel>true</inParallel>
<nodes>4</nodes>
<specsDir>specs</specsDir>
</configuration>
<goals>
<goal>execute</goal>
</goals>
</execution>
</executions>
而且我为chrome和firefox创建了2个不同的目录,其中包含两个不同的属性文件:
chrome.properties文件:
BROWSER = chrome
BROWSER_VERSION = 78
PLATFORM = WIN10
firefox.properties文件:
BROWSER = firefox
BROWSER_VERSION = 69
PLATFORM = WIN8
我在Java类文件中使用了这些环境变量:
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("browserName", System.getenv("BROWSER"));
capabilities.setCapability("version", System.getenv("BROWSER_VERSION"));
capabilities.setCapability("platform", System.getenv("PLATFORM"));
任何帮助将不胜感激,非常感谢:)