0

I am able to take screenshot using below link : https://gist.github.com/guitarrapc/9870497 but my issue is , screenshot is getting captured what you are seeing on the screen , but i want to have the screenshot of complete webpage ,i.e part which is not covering on the display screen , is it possible ? Help is appreciated , thanks in advance.

Rahul
  • 239
  • 1
  • 9
  • 21

3 Answers3

0

It wouldn't be a screenshot then. A screenshot itself means what is visible on screen. You need to consider zoom out on page contents through code and snap the complete screen then.

Salman
  • 1,573
  • 3
  • 13
  • 24
0

------------ check below URL:
https://github.com/dafthack/PowerWebShot

Raeez Vp
  • 91
  • 2
  • is this C# ? because am seeing it is asking for webdriver.dll file , is their a way for Java ? – Rahul Dec 12 '18 at 14:51
0

Recent versions of Google Chrome have the ability to do this in the dev tools - A quick tutorial

For the automation, I think your only choice will be to use Puppeteer to drive Chrome.

Of course, a third party tool such as GreenShot or PicPick can be used, but I don't know if they can be automated.

Javascript using puppeteer to take a fullpage screen shot:

const puppeteer = require('puppeteer');

(async () => {
  const browser = await puppeteer.launch();
  const page = await browser.newPage();
  await page.goto('https://example.com');
  await page.screenshot({path: 'example.png', fullPage: true});

  await browser.close();
})();
mhhollomon
  • 965
  • 7
  • 15
  • Problem with chrome is , not able to populate few of the graphs when loaded the HTML page , i want to take screenshot of jenkins HTML build report and attach in the email – Rahul Dec 12 '18 at 14:53
  • What web browser are you using, then? – mhhollomon Dec 12 '18 at 14:54
  • IE , i have report getting generated using HTML publish plugin in jenkins , now i want to send this as body of the email ,using Email Ext Plugin , so i am planning to take the screenshot of the report using powershell and attach in the body – Rahul Dec 12 '18 at 15:11
  • For that, you would most likely be better off to use the Jenkins API to grab the information and format as you wish. – mhhollomon Dec 12 '18 at 15:18
  • can you please elaborate on the same ? how exactly i can use that and what exact API i should point to ? – Rahul Dec 13 '18 at 06:12
  • as i said am using published HTML report plugin and my html report is getting generated through jenkins – Rahul Dec 13 '18 at 07:42
  • [This answer](https://stackoverflow.com/questions/25661362/where-can-i-find-jenkins-restful-api-reference) has some pointers to the API docs. – mhhollomon Dec 13 '18 at 12:44