Code didnt work as expected

package testCode;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

public class Testcode2 {

public static void main(String[] args)
{
System.setProperty(“webdriver.gecko.driver”,”C://Program Files (x86)//geckodriver-v0.11.1-win64//geckodriver.exe”);
WebDriver driver = new FirefoxDriver();
String URL = “http://www.demoqa.com”;
driver.get(URL);
driver.findElement(By.xpath(“.//*[@id=’menu-item-374′]/a”)).click();
driver.navigate().back();
driver.navigate().forward();
driver.navigate().to(URL);
driver.navigate().refresh();
driver.quit();
}

}

 

While testing this code, back, forward, to and refresh commands didnt work and it closed the browser…..any issues with the code

Default Asked on June 30, 2017 in Selenium WebDriver.

Firefox version is 45.0.2 and when i checked the code line wise i found that after clicking the XPATH link mentioned, it does not click back, forward links but the to (URL) and refresh code is executed in a flash of a second.  Any suggestions !!!!!!!!!!!!

on July 3, 2017.
Add Comment
  • 0 Answer(s)
  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.