18 January 2026:
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
PDF Comparator integration with sahi
1.As per the following link http://ashwinilalit.blogspot.in/2013/02/validating-pdf-using-sahi.html installed DiffPDF-4.0.2-win32.msi but lot of confusion in passing the parameter for the code provide.
var $dirPathBat;//path to pdfcomparator
var $dirPathPdf;//dir path of the PDF files baseline and the one //generated through the website
var $str = new Array();
$str[0] = $dirPathBat+"comparePdfTool/comparedBat.bat";
$str[1] = $dirPathPdf+$file1; //baselined
$str[2] = $dirPathPdf+$file2; //downloaded
$str[3] = $dirPathPdf+$result; //result file path
$obj = java.lang.Runtime.getRuntime();
$obj.exec($str, null, new java.io.File($dirPathBat+"comparePdfTool"));
var $fileContents = _readFile($dirPathPdf+"Pdf/"+$inputObject.result);
_assertTrue($fileContents=="No differences detected.\r\n","File does not match");
2.$result and $inputObject are creating lot of confusion what to be passed.
3.After installing DiffPDF-4.0.2-win32.msi there was no file called as comparedBat.bat in the following C:/Program Files/Qtrac/DiffPDFcomparePdfTool/comparePdfTool/comparedBat.bat[my self created the following path DiffPDFcomparePdfTool/comparePdfTool/comparedBat.bat with a batch file]
4.what all are command need be passed for the created batch file.
5.How the result will posted to $inputObject.result file please explain.
Please describe with the integration of PDF Comparator for sahi with detail step asap.And let me know any thing more info needed.
Regards
Murali
var $dirPathBat;//path to pdfcomparator
var $dirPathPdf;//dir path of the PDF files baseline and the one //generated through the website
var $str = new Array();
$str[0] = $dirPathBat+"comparePdfTool/comparedBat.bat";
$str[1] = $dirPathPdf+$file1; //baselined
$str[2] = $dirPathPdf+$file2; //downloaded
$str[3] = $dirPathPdf+$result; //result file path
$obj = java.lang.Runtime.getRuntime();
$obj.exec($str, null, new java.io.File($dirPathBat+"comparePdfTool"));
var $fileContents = _readFile($dirPathPdf+"Pdf/"+$inputObject.result);
_assertTrue($fileContents=="No differences detected.\r\n","File does not match");
2.$result and $inputObject are creating lot of confusion what to be passed.
3.After installing DiffPDF-4.0.2-win32.msi there was no file called as comparedBat.bat in the following C:/Program Files/Qtrac/DiffPDFcomparePdfTool/comparePdfTool/comparedBat.bat[my self created the following path DiffPDFcomparePdfTool/comparePdfTool/comparedBat.bat with a batch file]
4.what all are command need be passed for the created batch file.
5.How the result will posted to $inputObject.result file please explain.
Please describe with the integration of PDF Comparator for sahi with detail step asap.And let me know any thing more info needed.
Regards
Murali