我正在尝试点击具有悬停状态的图像。检查class = wmagents_click_h上的元素突出显示,我尝试了以下内容:
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(".//*[@class='wmagnets_click_h']/div"))).click();
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(".//*[@class='wmagnets_click_h']/div/div"))).click();
driver.findElements(By.xpath(".//*[@id='c2canvasdiv']/div[6]/div"))
driver.findElements(By.cssSelector(".wmagents_click>div"))
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(".//*[@class='wmagnets_click']/div"))
我也试过这个:
String js = "arguments[0].style.height='auto'; arguments[0].style.visibility='visible';";
((JavascriptExecutor) driver).executeScript(js, e);
和
((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView(true);", e);
以上都不奏效。我究竟做错了什么?有人可以帮忙吗?感谢