Php 如何检查Selenium服务器是否正在运行
我有很多phpunit测试,其中一部分使用selenium,我需要知道selenium服务器是否正在运行(windows)。有没有办法从php检查它 默认情况下,Selenium服务器接受本地主机端口4444上的命令 所以你可以这样做:Php 如何检查Selenium服务器是否正在运行,php,windows,selenium,phpunit,Php,Windows,Selenium,Phpunit,我有很多phpunit测试,其中一部分使用selenium,我需要知道selenium服务器是否正在运行(windows)。有没有办法从php检查它 默认情况下,Selenium服务器接受本地主机端口4444上的命令 所以你可以这样做: <?php $selenium_running = false; $fp = @fsockopen('localhost', 4444); if ($fp !== false) { $selenium_running = true; fc
<?php
$selenium_running = false;
$fp = @fsockopen('localhost', 4444);
if ($fp !== false) {
$selenium_running = true;
fclose($fp);
}
var_dump($selenium_running);