Help with a webdriver test with geckodriver and selenium ide

1

I'm using selenium ide the oldest version where you can export the script in testng driverweb format, the issue is that I tried several ways to run the test but I still have problems with the test, here's the code:

@BeforeClass(alwaysRun = true)
public void setUp() throws Exception {
  String projectPath = System.getProperty("user.dir");
  System.setProperty("webdriver.gecko.driver","C:\Geckodriver_Fire\geckodriver.exe");
  driver = new FirefoxDriver();
  baseUrl = "http://localhost:8080/ProyectoTesting/index.jsp";
  driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
}

@Test
public void testCamposValidos() throws Exception {
    driver.get(baseUrl + "/ProyectoTesting/index.jsp");
    driver.findElement(By.id("indentificador")).click();
    driver.findElement(By.id("indentificador")).clear();
    driver.findElement(By.id("indentificador")).sendKeys("19");
    driver.findElement(By.id("monto")).clear();
    driver.findElement(By.id("monto")).sendKeys("600000");
    driver.findElement(By.name("cuotas")).clear();
    driver.findElement(By.name("cuotas")).sendKeys("12");
    driver.findElement(By.id("datepicker")).click();
    driver.findElement(By.linkText("20")).click();
    driver.findElement(By.id("desgravamen")).click();
    driver.findElement(By.id("protegido")).click();
    driver.findElement(By.id("ap")).click();
    driver.findElement(By.id("rut")).clear();
    driver.findElement(By.id("rut")).sendKeys("19");
    driver.findElement(By.id("nombre")).clear();
    driver.findElement(By.id("nombre")).sendKeys("nicolas");
    driver.findElement(By.id("apellido")).clear();
    driver.findElement(By.id("apellido")).sendKeys("flores");
    driver.findElement(By.id("renta")).clear();
    driver.findElement(By.id("renta")).sendKeys("600000");
    driver.findElement(By.id("celular")).clear();
    driver.findElement(By.id("celular")).sendKeys("994573188");
    driver.findElement(By.id("telefono")).clear();
    driver.findElement(By.id("telefono")).sendKeys("26451419");
    driver.findElement(By.id("correo")).clear();
    driver.findElement(By.id("correo")).sendKeys("[email protected]");
    new Select(driver.findElement(By.id("regiones"))).selectByVisibleText("Región Metropolitana de Santiago");
    new Select(driver.findElement(By.id("comunas"))).selectByVisibleText("Macul");
    driver.findElement(By.name("submit")).click();
}

  @AfterClass(alwaysRun = true)
  public void tearDown() throws Exception {
    driver.quit();
    String verificationErrorString = verificationErrors.toString();
    if (!"".equals(verificationErrorString)) {
      fail(verificationErrorString);
    }
  }
    
asked by Nicolas Flores Muñoz 20.11.2018 в 01:44
source

1 answer

1

Check the string of baseUrl and how you invoke it in the driver.get .

As you have it now, the get would be to:

"http://localhost:8080/ProyectoTesting/index.jsp/ProyectoTesting/index.jsp"
    
answered by 26.12.2018 в 06:28