Selenium - RuntimeException

1 resposta
A
java.lang.RuntimeException: Could not contact Selenium Server; have you started it on 'localhost:4444' ?
Read more at http://seleniumhq.org/projects/remote-control/not-started.html
Connection refused: connect
	at com.thoughtworks.selenium.DefaultSelenium.start(DefaultSelenium.java:86)
	at br.edu.junitlearning.seleniumtests.TesteSelenium.main(TesteSelenium.java:23)

Código:

package br.edu.junitlearning.seleniumtests;

import com.thoughtworks.selenium.CommandProcessor;
import com.thoughtworks.selenium.DefaultSelenium;
import com.thoughtworks.selenium.HttpCommandProcessor;

public class TesteSelenium {
	public static void main(String[] args) {  
		  
        try {  
              
            int port = 4444;  
            String host = "localhost";  
            String browser = "*firefox";  
            String baseUrl = "http://www.google.com";  
              
            CommandProcessor command = new HttpCommandProcessor(host, port, browser, baseUrl);  
            DefaultSelenium selenium = new DefaultSelenium(command);  
           
            
            System.out.println(host + port + browser + baseUrl);
            
            selenium.start();  
 
            selenium.open("http://www.google.com/webhp");  
            selenium.waitForPageToLoad("9000");  
            selenium.type("q", "java na cabeça abril blogs");  
            selenium.click("btnG");  
            selenium.waitForPageToLoad("9000");  
            selenium.click("//div[@id='res']/div/ol/li[1]/h3/a/em[2]");  
            selenium.waitForPageToLoad("9000");  
  
            System.out.println(selenium.isTextPresent("teste"));  
        } catch (Exception e) {  
             
            e.printStackTrace();  
        }  
	}
}

Alguém pode ajudar?

1 Resposta

A

Alguma dica?

Criado 16 de fevereiro de 2011
Ultima resposta 16 de fev. de 2011
Respostas 1
Participantes 1