Java 循环浏览网页列表
我正在Eclipse中使用SeleniumWebDriver。我想把它打开Java 循环浏览网页列表,java,loops,selenium,Java,Loops,Selenium,我正在Eclipse中使用SeleniumWebDriver。我想把它打开 http://www.sample.com/catalog?product_id="0001" 填充字段并检查径向按钮,然后关闭,然后循环打开 http://www.sample.com/catalog?product_id="0002"` 并执行相同的操作。我希望它循环,直到达到9990 System.setProperty("webdriver.firefox.marionette","/Users/Downl
http://www.sample.com/catalog?product_id="0001"
填充字段并检查径向按钮,然后关闭,然后循环打开
http://www.sample.com/catalog?product_id="0002"`
并执行相同的操作。我希望它循环,直到达到9990
System.setProperty("webdriver.firefox.marionette","/Users/Downloads/geckodriver");
WebDriver driver;
driver = new FirefoxDriver();
String base = ("http://www.sample.com/catalog?product_id="0001");
代码片段:
for(int i = 1; i <= 9990; i++){
String base = "http://www.sample.com/catalog?product_id=" + String.format("%04d", i);
driver.get(base);
//do your stuff here
}
for(int i=1;我在TestNg/Junit中搜索数据驱动测试。下面是一个TestNg示例,那么您尝试完成了什么循环?请发布您的代码。