Я пытаюсь открыть firefox, а также пытаюсь зайти на google.com с maven и intellij, но не могу.просто откройте Firefox и больше ничего не делайте.Я делаю что-то не так?или это что-то о версии Firefox или Geckodriver.
это мой код:
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxOptions;
import java.util.concurrent.TimeUnit;
public class PruebaTest {
private WebDriver firefoxDriver;
@Test
public void hacer_una_busqueda() {
System.setProperty("webdriver.gecko.driver", "src/main/resources/geckodriver");
FirefoxOptions options = new FirefoxOptions();
options.setCapability("marionette",false);
firefoxDriver = new FirefoxDriver(options);
firefoxDriver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
firefoxDriver.get("https://www.google.com");
firefoxDriver.findElement(By.xpath("//input[@title='Buscar']")).sendKeys("Cantidad de paises en America"); firefoxDriver.findElement(By.xpath("//input[@title='Buscar']")).sendKeys(Keys.ENTER);
}
}
![enter image description here](https://i.stack.imgur.com/OeU6e.png)