I was trying to use php file to run a test and get the result. The content in PHP is shown as follows:
<html>
<body style="background-color:#CCCCFF;">
<h1>Result of SimplePolicyTest:</h1>
<?php
$filename='results_'.date('Y-m-d_H-i-s').'_simple-policy.php';
$path='/var/www/qa/automation/results/';
$destination=$path.$filename;
$cmd='/var/www/selenium/projects/QA\ Automation/grid/./SimplePolicyTest | tee -a '.$destination;
echo $cmd;
system($cmd);
?>
</body>
</html>
What's inside the bash file is to initiate a selenium test. But the result is I got the test result after the test is done on the page. However, the required file is not found where it is supposed to be. Also I'm suing system right now. Is there any way to make the output on the pager real time?
Few suggestions:
tee
it to another file & then include it.|
can be used in system
.