Is there any way to list all of the changes on a web page? By changes I mean all the new html elements added to the page, old elements that removed, location of some elements changed?
I am using selenium web driver with java. This is my code:
@Test(dataProvider = "deviceName")
public void mobileEmulation(String deviceName, String url){
String ChromeDriverPath = "C:\\chromedriver_win32\\chromedriver.exe";
System.setProperty("webdriver.chrome.driver", ChromeDriverPath);
Map<String, String> mobileEmulation = new HashMap<String, String>();
mobileEmulation.put("deviceName", deviceName);
Map<String, Object> chromeOptions = new HashMap<String, Object>();
chromeOptions.put("mobileEmulation", mobileEmulation);
DesiredCapabilities capabilities = DesiredCapabilities.chrome();
capabilities.setCapability(ChromeOptions.CAPABILITY, chromeOptions);
WebDriver driver = new ChromeDriver(capabilities);
for ( int i = 0 ; i < 2 ; i ++){
driver.get(url);
String source=driver.getPageSource();
}
driver.quit();
}
I am stuck since I have no idea how to do it or from where to start?