我想将输出打印到Excel工作表中。我的Excel字段类似于姓名,电话,地址。
我的代码如下:
public class Cpydata
{
WebDriver driver = new FirefoxDriver();
int i=0;
@Test
public enter code herevoid demo()
{
while(i<=1000)
{
driver.get("test.com");
driver.manage().window().maximize();
driver.findElement(By.xpath("xxx")).click();
System.out.println(driver.getTitle());
//System.out.println(Hos_name);
Object ph=driver.findElement(By.className("tel")).getText();
System.out.println(ph);
Object add=driver.findElement(By.className("jadlt")).getText();
System.out.println(add);
i++;
}
driver.quit();
}
}