public class Demo1 {
public static void main(String[] args) {
FirefoxDriver driver = new FirefoxDriver();
driver.get(“http://www.baidu.com”);
driver.get(“https://www.zhihu.com/signup?next=%2F”);
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}//线程休眠1秒
driver.navigate().back();//网页后退
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
driver.navigate().forward();//前进
driver.navigate().refresh();//刷新
//driver.quit();
}
}