I was asked to verify if a background-image is loaded to the webpage, but I don't really understand the difference between an image being loaded vs displayed. Is there? If so, how does one code for this test in a selenium java?
Below is the code I am trying to assert, first by checking that the url contains the file I am expecting, and then the part I don't know how to verify, checking if the file is loaded on the webpage or not.
Code:
<div class="_1WvEu" style="background-image: url("/resources/defaults/news_3.0/icons/weather/wi-67.svg");"><p class="_1DlTY"> Now </p><p class="_1Q1wt _1L3iW">62</p></div>
Assert 1:
assertTrue(thePageFactory.getAudHomePage(this).WeatherTopNavContainer.findElement(By.xpath("div[1]")).getAttribute("style").contains("/resources/defaults/news_3.0/icons/weather/wi-67.svg"),"File does not match for widget #1");
Assert 2:
?