我希望有人可以幫助解決這個問題,這讓我瘋狂。我已經安裝了下面的Windows Server 2008 R2: - 硒服務器 - PHP - PHPUnit的在windows服務器上的php腳本啓動硒並呼叫phpunit
我可以啓動硒服務器,並手動執行PHPUnit的腳本,一切都OK。他們工作很好。但我試圖自動化整個過程,並在php腳本中完成所有這些。所以,我公司生產的:
<?php
/*
Start the Selenium server with the chrome browser driver in a separate cmd window
/k = execute the cmd and then return to initial CMD prompt
*/
echo "\nStart the Selenium Server and pass the Chrome browser as an argument";
$startSeleniumWithChrome = 'start cmd /k java -Dwebdriver.chrome.driver="C:\Users\*\Automation\requiredFiles\chromedriver.exe" -jar "C:\Users\*\Automation\requiredFiles\selenium-server-standalone-3.0.1.jar"';
echo "\nBefore startSeleniumWithChrome";
exec($startSeleniumWithChrome);
echo "\nAfter startSeleniumWithChrome";
echo "\nBefore START phpunit";
$executePhpunitCmd = 'start cmd /k phpunit -c phpunit.xml';
exec($executePhpunitCmd);
echo "\nAfter START phpunit";
?>
我的問題: 的EXEC($ startSeleniumWithChrome);上面似乎掛起。該腳本不會超越這一點。有沒有人有任何想法如何我可以看到是什麼導致腳本掛起? 謝謝 Conor