0
@When("^user clicks linkedin button of the first news item$")
public void user_clicks_linkedin_button_of_the_first_news_item()
{
try
{
firstSocialShareElement = driver.findElement(By.className("social-share-linkedin"));
if(firstSocialShareElement!=null && firstSocialShareElement.isDisplayed())
{
firstSocialShareElement.click();
}
}
catch(NoSuchElementException e)
{
}
}
我們可以看到您嘗試點擊的頁面的html嗎? (最好是url) – sircapsalot
它現在沒有任何元素。那個新聞項目的數據是動態的,有些場景現在不會出現這種情況,這就是爲什麼我得到這個例外,但是它沒有被捕獲,並且它出現在控制檯中。 –