【发布时间】:2017-09-08 05:47:44
【问题描述】:
我希望有人可以帮助解决这个问题,这让我发疯。我在 Windows Server 2008 R2 上安装了以下内容: - 硒服务器 - PHP - phpunit
我可以启动 selenium 服务器并手动执行 phpunit 脚本,一切正常。他们工作得很好。但我正在尝试自动化整个过程并在 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);上面似乎挂了。脚本不会超过这一点。有谁知道我如何看到导致脚本挂起的原因? 谢谢 康纳
【问题讨论】:
标签: php selenium selenium-webdriver phpunit