Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
同时在不同的浏览器中运行一个功能文件-maven framework_Maven_Junit_Cucumber Jvm_Selenium3 - Fatal编程技术网

同时在不同的浏览器中运行一个功能文件-maven framework

同时在不同的浏览器中运行一个功能文件-maven framework,maven,junit,cucumber-jvm,selenium3,Maven,Junit,Cucumber Jvm,Selenium3,我正在将Selenium Cumber Maven框架与Junit一起使用。我需要同时在不同的浏览器中运行相同的功能文件。 我还需要使用命令行运行该文件。我是个初学者,你们能帮我解决吗。 @下面是TestRunner文件的BeforeClass @BeforeClass public static void before() { browserName = System.getProperty("browserName"); if(browserName==null) {

我正在将Selenium Cumber Maven框架与Junit一起使用。我需要同时在不同的浏览器中运行相同的功能文件。 我还需要使用命令行运行该文件。我是个初学者,你们能帮我解决吗。 @下面是TestRunner文件的BeforeClass

@BeforeClass
public static void before() {   
browserName = System.getProperty("browserName");
if(browserName==null)
    {
        browserName= "chrome";
    }

if (browserName.equalsIgnoreCase("Chrome")) 
{
    System.setProperty("webdriver.chrome.driver", "E:\\ChromeDriverNew\\chromedriver.exe");
    driver=new ChromeDriver(); 
} 
else if (browserName.equalsIgnoreCase("Firefox")) 
{
    System.setProperty("webdriver.gecko.driver","E:\\geckoNew\\geckodriver.exe");
     driver = new FirefoxDriver();
} 

else {
    System.out.println("Error Message----> "
            + "browser name not mentioned properly");
    System.exit(0);
}      
   driver.manage().window().maximize();
  driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);   

}
TestRunner文件中需要做哪些更改?
如果你们能帮我,那将是一个很大的帮助,因为我是初学者。提前感谢。

并行执行是在功能文件之间执行,而不是在功能文件内。因此,您需要对每个浏览器依次运行该功能。