как настроить тесты на сервере

привет! всем
настроил тесты у себя локально
связка webdriver+ ant + testnj +java
на лок компе все чудесно
закидую на удаленний сервер
запускаю там :


run:
   [testng] [TestNG] Running:
   [testng]   /var/www/ria_test/Java_ria/testng.xml
   [testng]
   [testng] TestCase_B1autoauto
   [testng] TestCase_B2
   [testng] log4j:WARN No appenders could be found for logger (devpinoyLogger).
   [testng] log4j:WARN Please initialize the log4j system properly.
   [testng] org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
   [testng] Error: no display specified
   [testng] Error: no display specified
   [testng]
   [testng]     at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:106)
//------------------------------------------------

не может приконектится к локальному хосту

 выход использовать селениум рс?, но при єтом рс использует другие команды
или Remote WD?
типа

public RemoteWebDriver getWebDriver() {
            if (driver == null) {
            DesiredCapabilities capability = DesiredCapabilities.firefox();
            try {
            driver = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"), capability);
            } catch (MalformedURLException e) {
            e.printStackTrace();
            }
            //driver = new EventFiringWebDriver(dr);
            driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
            }
            return driver;



 

 


 

это вся та же проблема, что и в http://automated-testing.info/forum/testng-zapustit-po-kliku-suite#comment-5323

тут нужен виртуальный экран

я так понимаю, тесты запускаются где-то linux

вот похожие ссылки на прочтение

http://automated-testing.info/knowledgebase/article/zapusk-selenium-testov-s-pomoshchyu-hudson-na-headless-linux-server-chast-1

http://automated-testing.info/knowledgebase/article/zapusk-selenium-testov-s-pomoshchyu-hudson-na-headless-linux-server-chast-2

http://automated-testing.info/knowledgebase/article/zapusk-selenium-testov-s-pomoshchyu-hudson-na-headless-linux-server-chast-3

http://automated-testing.info/knowledgebase/article/provodim-testy-s-selenium-bez-x11

1 - вместо вебдрайвера нужно использовать ремоут драйвер


        public void getWebDriver() throws Exception{
            if (driver == null) {
            //DesiredCapabilities capability = DesiredCapabilities.firefox();
            try {
            driver = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"), DesiredCapabilities.firefox());
            } catch (MalformedURLException e) {
            e.printStackTrace();
            }
            //driver = new EventFiringWebDriver(dr);
            driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
            }

 

2. - снятия скриншотов тоже нужно поменять - http://selenium2.ru/docs/webdriver-advanced-usage.html

       public static void CaptureScreenShot(String fileName) {
         WebDriver augmentedDriver = new Augmenter().augment(driver);
            File scrFile = ((TakesScreenshot)augmentedDriver).getScreenshotAs(OutputType.FILE);
        try {
            FileUtils.copyFile(scrFile, new File(System.getProperty("user.dir")+"//screenshots//"+fileName+".png"));
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }       
        
    }