我无法在图像的快速视图中找到 "Add to wishlist" 网络元素

i am not able to locate "Add to wishlist" web element on the quick view of the image

在此代码中,我无法在图像的快速视图中找到“添加到心愿单”网络元素。

Add To Wishlist Screenshot

driver = new ChromeDriver(); 
driver.get("http://automationpractice.com/index.php");  
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);  
driver.findElement(By.xpath("//[@id='block_top_menu']/ul/li[2]")).click(); 
driver.findElement(By.xpath("//[@id='categories_block_left']/div/ul/li[3]/a")).click(); driver.findElement(By.id("list")).click();  
driver.findElement(By.xpath("//[@id='center_column']/ul/li1/div/div/div/div")).click();  
driver.findElement(By.xpath("//[contains(@class,'box-cart-bottom')]//[contains(@id,'wishlist_button')]")).click();  

从图中可以看出,那里有一个iframe,所以你需要先切换到它,然后才能访问它里面的元素。
要获得该 iframe 的正确、清晰和唯一的定位符,我们需要搜索整个页面 HTML.
一旦你有 iframe 定位器切换到它可以完成:

driver.switchTo().frame(driver.findElement(By.id("frameId")));

或任何其他相关定位器