Olá. Rodei o TesteAutomatizado.java e ele respondeu o seguinte:
Exception in thread "main" java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.gecko.driver system property; for more information, see https://github.com/mozilla/geckodriver. The latest version can be downloaded from https://github.com/mozilla/geckodriver/releases
A seguir incluí o geckodriver e meu TesteAutomatizado.java ficou assim:
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
public class TesteAutomatizado {
public static void main(String[] args) {
System.setProperty("webdriver.gecko.driver", "C:\\Desenvolvimento\\geckodriver\\geckodriver.exe");
WebDriver driver = new FirefoxDriver();
driver.get("http://www.google.com.br/");
WebElement campoDeTexto = driver.findElement(By.name("q"));
campoDeTexto.sendKeys("Caelum");
campoDeTexto.submit();
}
}
Rodei novamente. O script abriu o browser, mas não carregou a página.
1599659421292 geckodriver INFO Listening on 127.0.0.1:13748
1599659422478 mozrunner::runner INFO Running command: "C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe" "--marionette" "-foreground" "-no-remote" "-profile" "C:\\Users\\xxxxxxx\\AppData\\Local\\Temp\\rust_mozprofile64EpdY"
1599659425629 addons.webextension.<unknown> WARN Loading extension 'null': Reading manifest: Error processing background.persistent: Event pages are not currently supported. This will run as a persistent background page.
1599659425637 addons.webextension.<unknown> WARN Loading extension 'null': Reading manifest: Error processing version_name: An unexpected property was found in the WebExtension manifest.
1599659427890 addons.webextension.extension@xxxx.com.br WARN Loading extension 'extension@xxxx.com.br': Reading manifest: Error processing background.persistent: Event pages are not currently supported. This will run as a persistent background page.
1599659427896 addons.webextension.extension@xxxx.com.br WARN Loading extension 'extension@xxxx.com.br': Reading manifest: Error processing version_name: An unexpected property was found in the WebExtension manifest.
1599659427921 addons.webextension.extension@xxxx.com.br WARN Please specify whether you want browser_style or not in your browser_action options.
JavaScript warning: moz-extension://22621e7e-f3a7-4820-9091-9f94100daef4/background.js, line 1: unreachable code after return statement
JavaScript warning: moz-extension://22621e7e-f3a7-4820-9091-9f94100daef4/background.js, line 1: unreachable code after return statement
JavaScript warning: moz-extension://22621e7e-f3a7-4820-9091-9f94100daef4/background.js, line 1: unreachable code after return statement
JavaScript warning: moz-extension://22621e7e-f3a7-4820-9091-9f94100daef4/background_popup.js, line 1: unreachable code after return statement
JavaScript warning: moz-extension://22621e7e-f3a7-4820-9091-9f94100daef4/version_utilities.js, line 1: unreachable code after return statement
Exception in thread "main" org.openqa.selenium.TimeoutException: Nenhuma conexão pôde ser feita porque a máquina de destino as recusou ativamente. (os error 10061)
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
System info: host: 'xxxxxxxx', ip: 'xx.x.xx.xx', os.name: 'Windows 8.1', os.arch: 'x86', os.version: '6.3', java.version: '1.8.0_31'
Driver info: driver.version: FirefoxDriver
remote stacktrace:
. . .
OBS.: Os 'xxx' são informações internas da empresa.