Closed voletiswaroop closed 5 years ago
Hi @voletiswaroop , this is already supported scenario as Differencify supports full Puppeteer API. By Puppeteer API you can use elementHandle.screenshot method to take a screenshot of an element. Something like this should work,
(async () => {
const target = differencify.init({ chain: false });
await target.launch();
const page = await target.newPage();
await page.goto('https://www.skyscanner.net/');
const legalInfoHandle = await page.$('.legal-info__copyright');
const image = await legalInfoHandle.screenshot();
const result = await target.toMatchSnapshot(image)
await page.close();
await target.close();
console.log(result);
})();
Please reopen the issue if needed. Thanks
Thank you so much @NimaSoroush
I have a scenario where I have to take a screenshot of the particular 'div/section' which is not happening with page.screenshot().
Thanks in Advance.