答案 0 :(得分:1)
最后我得到了答案
driver.findElement(By.xpath("/html/body/div[1]/div[1]/div/div[4]/div[2]/div[2]/div[2]/div[1]/div/div[3]/div[1]/div/a[15]/div/img")).click();
Set<String> RecipeHandle = driver.getWindowHandles();
System.out.println(RecipeHandle);
for (String handle1 : driver.getWindowHandles())
{
System.out.println(handle1);
driver.switchTo().window(handle1);
}
driver.findElement(By.xpath("/html/body/div[1]/div[1]/div/div[4]/div[2]/div/div/div[2]/div[1]/div/div[2]/div[1]/a[4]")).click();
driver.findElement(By.xpath("/html/body/div[1]/div[1]/div/div[4]/div[2]/div/div/div[2]/div[1]/div/div[2]/div[1]/div[3]/div/div/div[2]/button")).click();
driver.switchTo().window(handle);
driver.manage().timeouts().implicitlyWait(5000, TimeUnit.SECONDS);
Thread.sleep(3000);**
感谢所有回复我的人......