0

I am trying to convert a HTML page to image using wkhtmltoimage.

I have followed below steps.

I have created a batch file to navigate to the wkhtmltoimage bin directory and then taking a file and converting it to image.

It works perfectly fine when I run the command in cmd.exe and converts the file to image. But when I try to run the same batch file through jenkins it shows me the below error.

with network status code 203 and http status code 0 - Error opening C:/Users//.jenkins/jobs/Automation_Git/builds/17/cucumber-html-reports/overview-features.html: The system cannot find the path specified.

Below are the commands I am trying to run:

cd C:\Program Files\wkhtmltopdf\bin
wkhtmltoimage --enable-local-file-access   file:///C:/Users/.jenkins/jobs/Automation_Git/builds/17/cucumber-html-reports/overview-features.html D://Report//howzit.jpg

I even tried using --load-error-handling ignore, but no use.

Tejashree Kutte
  • 94
  • 1
  • 10
  • ...not a solution, but always use `cd /D` rather than `cd`... – aschipfl Dec 04 '19 at 15:24
  • You should always doublequote paths for safety too, e.g. `CD /D "%ProgramFiles%\wkhtmltopdf\bin"`, and it should be `"D:\Report\howzit.jpg"`, as Windows uses back slashes as directory and file separators, not forward slashes. The actual error tells you what the issue is, the file `C:\Users\\.jenkins\jobs\Automation_Git\builds\17\cucumber-html-reports\overview-features.html` isn't found. A little strange because your command didn't use that, it used, `C:\Users\.jenkins\jobs\Automation_Git\builds\17\cucumber-html-reports\overview-features.html`. **_Please do not modify strings unnecessarily**_. – Compo Dec 04 '19 at 16:29

0 Answers0