<file_sep>package com.noos.databrain.pages;

import org.springframework.stereotype.Component;

@Component
public class TestPage extends AbstractPage {

    public void openPage(String url) {
        System.out.println(s);
    }

}
<file_sep><?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.social</groupId>
    <artifactId>MultiDriver</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.7</maven.compiler.source>
        <maven.compiler.target>1.7</maven.compiler.target>
        
        <browser>chrome</browser>
    </properties>
    
    <dependencies>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <version>4.2.3.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>4.2.3.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
            <version>4.2.3.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-java</artifactId>
            <version>2.48.2</version>
        </dependency>
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>6.9.9</version>
            <scope>test</scope>
        </dependency>
        
        <!-- Log4j dependency -->
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.16</version>
        </dependency>
    </dependencies>
    
    
    <build>
        <plugins>
            
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.18</version>
                <configuration>
                    <systemProperties>
                        <property>
                            <name>runOn</name>
                            <value>local</value>
                        </property>
                        <property>
                            <name>browser</name>
                            <value>${browser}</value>
                        </property>
                    </systemProperties>
                    <suiteXmlFiles>
                        <suiteXmlFile>.\src\test\java\com\noos\databrain\tests\Suite.xml</suiteXmlFile>
                    </suiteXmlFiles>
                </configuration>
                
            </plugin>
            
        </plugins>
    </build>
    <name>MultiDriver</name>
</project><file_sep>local_ff_dir = E:\\ffprofile<file_sep>package com.noos.databrain.browsers;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.remote.DesiredCapabilities;


public interface Browser {
    public DesiredCapabilities setCaps(String runOn);
    public WebDriver getDriver();
}
<file_sep>
package com.noos.databrain.browsers;

public class Tloc {
    
}
<file_sep>package com.noos.databrain.tests;

import com.noos.databrain.browsers.DriverManager;
import com.noos.databrain.pages.BrowserThread;
import com.noos.databrain.steps.Steps;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.testng.AbstractTestNGSpringContextTests;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

@ContextConfiguration(locations = {"classpath:spring-config.xml"})
public class T1Control extends AbstractTestNGSpringContextTests {

    @Autowired
    DriverManager man;

    @Autowired
    Steps step;

    @Test(invocationCount = 1)
    public void test1() throws InterruptedException {

        System.out.println("START MAIN 1");

        ThreadPoolTaskExecutor taskExecutor = (ThreadPoolTaskExecutor) applicationContext.getBean("taskExecutor");

        String[] bros = {"chrome"};
        broExecutor(bros, taskExecutor);
        taskExecutor.shutdown();

        System.out.println("FINISH MAIN");

    }

    public void broExecutor(String[] bros, ThreadPoolTaskExecutor task) {
        for (String bro : bros) {
            BrowserThread bt = (BrowserThread) applicationContext.getBean("browserThread");
            bt.setName(bro);
            task.execute(bt);
        }
    }

    @AfterClass
    public void quitDriver1() {
        step.openPage("https://www.google.com.ua/");
        System.out.println("get in main");
        man.quitDriver();
    }

    @BeforeClass
    public void initDriver() {
        man.initDefDriver();
    }

    private void sleep(int ms) {
        try {
            Thread.sleep(ms);
        } catch (InterruptedException ex) {
        }
    }

}
<file_sep>package com.noos.databrain.pages;

import org.springframework.stereotype.Component;

@Component
//@Scope("prototype")
public class AbstractPage {

//    public WebDriver driver;
//
//    public void initDriver() {
//        driver = LocalDriver.getDriver();
//    }
    public static String s;

    public void setS(String s) {
        AbstractPage.s = s;
    }

}
<file_sep>package com.noos.databrain.steps;

import com.noos.databrain.pages.TestPage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class Steps {

    @Autowired
    TestPage page;

    public void openPage(String url) {
        page.openPage(url);
    }

}
<file_sep>
package com.noos.databrain.multidriver;


public class Times {
   public static long ms = 1000; 
}
