答案 0 :(得分:0)
使用以下代码验证特定部分
后的天气<div>
标记
List<WebElement> ads = driver.findElements(By.xpath("//section[@class='hp_news']/following::div[@class='AdUnit']"));
if(ads.size()>0)
{
System.out.println("add available");
}
else
{
System.out.println("not available");
}
使用xpath的following-sibling
方法,该方法会根据<div>
<section>
标记找到您class = "hp_news"
答案 1 :(得分:0)
确保在this.$.document.saveValue('/categories/1/title', key)
:
<section class="hp_news">