WebDriver:当前网址为空,没有打开任何网页(WebDriver: Current url is blank, no page was opened)

我们正在尝试在我们的实际网站上添加测试作为更新部署的一部分。 我们最后一次处理它们的测试运行得很好,这是一周后但是现在所有这些都抛出了这个错误。 我们试图找出它,但没有发现任何有价值的东西。

更新1:我们发现由于程序包更新而导致功能中断。 这是更新的包列表;

barryvdh/laravel-debugbar 2.0.6 -> 2.1.1 barryvdh/laravel-ide-helper 2.1.0 -> 2.1.2 codeception/codeception 2.1.4 -> 2.1.5 doctrine/cache 1.5.2 -> 1.6.0 laravel/framework 5.1.26 -> 5.1.28 league/flysystem 1.0.15 -> 1.0.16 maximebf/debugbar 1.10.5 -> 1.11.0 phpspec/phpspec 2.4.0 -> 2.4.1 phpunit/phpunit 4.8.20 -> 4.8.21 symfony/browser-kit 2.8.0 -> 2.8.1 symfony/class-loader 2.8.0 -> 2.8.1 symfony/console 2.7.7 -> 2.7.8 symfony/css-selector 2.7.7 -> 2.7.8 symfony/debug 2.7.7 -> 2.7.8 symfony/dom-crawler 2.7.7 -> 2.7.8 symfony/event-dispatcher 2.8.0 -> 2.8.1 symfony/finder 2.7.7 -> 2.7.8 symfony/http-foundation 2.7.7 -> 2.7.8 symfony/http-kernel 2.7.7 -> 2.7.8 symfony/polyfill-php56 1.0.0 -> 1.0.1 symfony/polyfill-util 1.0.0 -> 1.0.1 symfony/process 2.7.7 -> 2.7.8 symfony/routing 2.7.7 -> 2.7.8 symfony/translation 2.7.7 -> 2.7.8 symfony/var-dumper 2.7.7 -> 2.7.8 symfony/yaml 2.8.0 -> 3.0.1

更新2:我们尝试降级laravel和代码,但无济于事。 奇怪的是,即使它们被降级到代码2.1.0之前,已经更新过一次的机器总是会抛出该错误。 通过所有测试的机器是在代码2.1.4和webdriver 1.1.0上。

更新3:安装selenium只是为了检查它的工作原因可能是它的phantomJS / ghost-driver有冲突。

示例测试

public function test(AcceptanceTester $I) { $I->amOnUrl('http://swaggable.com'); $I->canSeeCurrentUrlEquals('/'); }

示例输出

Failed to check correct credentials in _001PlatformSignupCest::checkCorrectCredentials (tests\acceptance\_001PlatformSIgnupCest.php) [ModuleException] WebDriver: Current url is blank, no page was opened Scenario Steps: 3. $I->canSeeCurrentUrlEquals("/signup") 2. $I->amOnUrl("http://platform.work.com/signup") 1. $I->resizeWindow(1280,720)

验收配置:

modules: enabled: - Asserts - WebDriver: url: http://platform.work.com browser: firefox http_proxy: direct - \Helper\Acceptance

建立:

Laravel 5.1.28 Codeception 2.1.5 PhantomJS 2.0.0

作曲家

"require": { "php": ">=5.5.9", "laravel/framework": "5.1.*", "barryvdh/laravel-ide-helper": "^2.0", "sboo/multiauth": "4.0.*", "dingo/api": "0.10.*", "doctrine/dbal": "2.3.*", "rtconner/laravel-kint": "~2.0", "factual/factual-php-driver": "dev-master", "weblee/mandrill": "dev-master", "barryvdh/laravel-debugbar": "^2.0", "laravel/envoy": "~1.0", "jeremeamia/superclosure": "~2.0", "illuminate/html": "~5.0", "predis/predis": "^1.0", "guzzlehttp/guzzle": "~5.3|~6.0", "laravelcollective/html": "5.1.*", "exeu/apai-io": "dev-master", "codeception/codeception": "*" }, "require-dev": { "mockery/mockery": "0.9.*", "phpunit/phpunit": "~4.0", "phpspec/phpspec": "~2.1", "fzaninotto/faker": "~1.0" },

We are trying to add testing as part of update deployment on our live site. The tests ran fine the last time we worked on them which was a week back but now all of them throw that error. We have tried to figure it out but haven't found anything worthwhile.

Update 1: We have found that the functionality breaks due to a package getting updated. Here is the list of updated packages;

barryvdh/laravel-debugbar 2.0.6 -> 2.1.1 barryvdh/laravel-ide-helper 2.1.0 -> 2.1.2 codeception/codeception 2.1.4 -> 2.1.5 doctrine/cache 1.5.2 -> 1.6.0 laravel/framework 5.1.26 -> 5.1.28 league/flysystem 1.0.15 -> 1.0.16 maximebf/debugbar 1.10.5 -> 1.11.0 phpspec/phpspec 2.4.0 -> 2.4.1 phpunit/phpunit 4.8.20 -> 4.8.21 symfony/browser-kit 2.8.0 -> 2.8.1 symfony/class-loader 2.8.0 -> 2.8.1 symfony/console 2.7.7 -> 2.7.8 symfony/css-selector 2.7.7 -> 2.7.8 symfony/debug 2.7.7 -> 2.7.8 symfony/dom-crawler 2.7.7 -> 2.7.8 symfony/event-dispatcher 2.8.0 -> 2.8.1 symfony/finder 2.7.7 -> 2.7.8 symfony/http-foundation 2.7.7 -> 2.7.8 symfony/http-kernel 2.7.7 -> 2.7.8 symfony/polyfill-php56 1.0.0 -> 1.0.1 symfony/polyfill-util 1.0.0 -> 1.0.1 symfony/process 2.7.7 -> 2.7.8 symfony/routing 2.7.7 -> 2.7.8 symfony/translation 2.7.7 -> 2.7.8 symfony/var-dumper 2.7.7 -> 2.7.8 symfony/yaml 2.8.0 -> 3.0.1

Update 2: We have tried downgrading laravel and codeception but to no avail. It is strange as the machines which have been updated once will always throw that error even if they are downgraded till codeception 2.1.0. While the machine which passed all tests was on codeception 2.1.4 and webdriver 1.1.0.

Update 3: Installed selenium just to check and it works so maybe its phantomJS / ghost-driver which has conflict.

Example Test

public function test(AcceptanceTester $I) { $I->amOnUrl('http://swaggable.com'); $I->canSeeCurrentUrlEquals('/'); }

Example Output

Failed to check correct credentials in _001PlatformSignupCest::checkCorrectCredentials (tests\acceptance\_001PlatformSIgnupCest.php) [ModuleException] WebDriver: Current url is blank, no page was opened Scenario Steps: 3. $I->canSeeCurrentUrlEquals("/signup") 2. $I->amOnUrl("http://platform.work.com/signup") 1. $I->resizeWindow(1280,720)

Acceptance Configuration:

modules: enabled: - Asserts - WebDriver: url: http://platform.work.com browser: firefox http_proxy: direct - \Helper\Acceptance

Setup:

Laravel 5.1.28 Codeception 2.1.5 PhantomJS 2.0.0

Composer

"require": { "php": ">=5.5.9", "laravel/framework": "5.1.*", "barryvdh/laravel-ide-helper": "^2.0", "sboo/multiauth": "4.0.*", "dingo/api": "0.10.*", "doctrine/dbal": "2.3.*", "rtconner/laravel-kint": "~2.0", "factual/factual-php-driver": "dev-master", "weblee/mandrill": "dev-master", "barryvdh/laravel-debugbar": "^2.0", "laravel/envoy": "~1.0", "jeremeamia/superclosure": "~2.0", "illuminate/html": "~5.0", "predis/predis": "^1.0", "guzzlehttp/guzzle": "~5.3|~6.0", "laravelcollective/html": "5.1.*", "exeu/apai-io": "dev-master", "codeception/codeception": "*" }, "require-dev": { "mockery/mockery": "0.9.*", "phpunit/phpunit": "~4.0", "phpspec/phpspec": "~2.1", "fzaninotto/faker": "~1.0" },

最满意答案

您好我有同样的问题。

我已将幻影降级为1.9.7版本

... "jonnyw/php-phantomjs": "3.*", "site5/phantoman": "^1.0" }, "require-dev": { "phpunit/phpunit": "~4.0", "phpspec/phpspec": "~2.1" }, "autoload": { "classmap": [ "database" ], "psr-4": { "App\\": "app/" } }, "autoload-dev": { "classmap": [ "tests/TestCase.php" ] }, "scripts": { "post-install-cmd": [ "php artisan clear-compiled", "PhantomInstaller\\Installer::installPhantomJS", "php artisan optimize" ], "post-update-cmd": [ "php artisan clear-compiled", "PhantomInstaller\\Installer::installPhantomJS", "php artisan optimize" ], "post-create-project-cmd": [ "php -r \"copy('.env.example', '.env');\"", "php artisan key:generate" ] }, "config": { "preferred-install": "dist", "bin-dir": "bin" } }

它现在正在运行,但我知道是一种解决方法

Hello I have the same issue.

I have downgraded the phantomjs to the 1.9.7 version

... "jonnyw/php-phantomjs": "3.*", "site5/phantoman": "^1.0" }, "require-dev": { "phpunit/phpunit": "~4.0", "phpspec/phpspec": "~2.1" }, "autoload": { "classmap": [ "database" ], "psr-4": { "App\\": "app/" } }, "autoload-dev": { "classmap": [ "tests/TestCase.php" ] }, "scripts": { "post-install-cmd": [ "php artisan clear-compiled", "PhantomInstaller\\Installer::installPhantomJS", "php artisan optimize" ], "post-update-cmd": [ "php artisan clear-compiled", "PhantomInstaller\\Installer::installPhantomJS", "php artisan optimize" ], "post-create-project-cmd": [ "php -r \"copy('.env.example', '.env');\"", "php artisan key:generate" ] }, "config": { "preferred-install": "dist", "bin-dir": "bin" } }

And it working now, but I know is a workaround

WebDriver:当前网址为空,没有打开任何网页(WebDriver: Current url is blank, no page was opened)

我们正在尝试在我们的实际网站上添加测试作为更新部署的一部分。 我们最后一次处理它们的测试运行得很好,这是一周后但是现在所有这些都抛出了这个错误。 我们试图找出它,但没有发现任何有价值的东西。

更新1:我们发现由于程序包更新而导致功能中断。 这是更新的包列表;

barryvdh/laravel-debugbar 2.0.6 -> 2.1.1 barryvdh/laravel-ide-helper 2.1.0 -> 2.1.2 codeception/codeception 2.1.4 -> 2.1.5 doctrine/cache 1.5.2 -> 1.6.0 laravel/framework 5.1.26 -> 5.1.28 league/flysystem 1.0.15 -> 1.0.16 maximebf/debugbar 1.10.5 -> 1.11.0 phpspec/phpspec 2.4.0 -> 2.4.1 phpunit/phpunit 4.8.20 -> 4.8.21 symfony/browser-kit 2.8.0 -> 2.8.1 symfony/class-loader 2.8.0 -> 2.8.1 symfony/console 2.7.7 -> 2.7.8 symfony/css-selector 2.7.7 -> 2.7.8 symfony/debug 2.7.7 -> 2.7.8 symfony/dom-crawler 2.7.7 -> 2.7.8 symfony/event-dispatcher 2.8.0 -> 2.8.1 symfony/finder 2.7.7 -> 2.7.8 symfony/http-foundation 2.7.7 -> 2.7.8 symfony/http-kernel 2.7.7 -> 2.7.8 symfony/polyfill-php56 1.0.0 -> 1.0.1 symfony/polyfill-util 1.0.0 -> 1.0.1 symfony/process 2.7.7 -> 2.7.8 symfony/routing 2.7.7 -> 2.7.8 symfony/translation 2.7.7 -> 2.7.8 symfony/var-dumper 2.7.7 -> 2.7.8 symfony/yaml 2.8.0 -> 3.0.1

更新2:我们尝试降级laravel和代码,但无济于事。 奇怪的是,即使它们被降级到代码2.1.0之前,已经更新过一次的机器总是会抛出该错误。 通过所有测试的机器是在代码2.1.4和webdriver 1.1.0上。

更新3:安装selenium只是为了检查它的工作原因可能是它的phantomJS / ghost-driver有冲突。

示例测试

public function test(AcceptanceTester $I) { $I->amOnUrl('http://swaggable.com'); $I->canSeeCurrentUrlEquals('/'); }

示例输出

Failed to check correct credentials in _001PlatformSignupCest::checkCorrectCredentials (tests\acceptance\_001PlatformSIgnupCest.php) [ModuleException] WebDriver: Current url is blank, no page was opened Scenario Steps: 3. $I->canSeeCurrentUrlEquals("/signup") 2. $I->amOnUrl("http://platform.work.com/signup") 1. $I->resizeWindow(1280,720)

验收配置:

modules: enabled: - Asserts - WebDriver: url: http://platform.work.com browser: firefox http_proxy: direct - \Helper\Acceptance

建立:

Laravel 5.1.28 Codeception 2.1.5 PhantomJS 2.0.0

作曲家

"require": { "php": ">=5.5.9", "laravel/framework": "5.1.*", "barryvdh/laravel-ide-helper": "^2.0", "sboo/multiauth": "4.0.*", "dingo/api": "0.10.*", "doctrine/dbal": "2.3.*", "rtconner/laravel-kint": "~2.0", "factual/factual-php-driver": "dev-master", "weblee/mandrill": "dev-master", "barryvdh/laravel-debugbar": "^2.0", "laravel/envoy": "~1.0", "jeremeamia/superclosure": "~2.0", "illuminate/html": "~5.0", "predis/predis": "^1.0", "guzzlehttp/guzzle": "~5.3|~6.0", "laravelcollective/html": "5.1.*", "exeu/apai-io": "dev-master", "codeception/codeception": "*" }, "require-dev": { "mockery/mockery": "0.9.*", "phpunit/phpunit": "~4.0", "phpspec/phpspec": "~2.1", "fzaninotto/faker": "~1.0" },

We are trying to add testing as part of update deployment on our live site. The tests ran fine the last time we worked on them which was a week back but now all of them throw that error. We have tried to figure it out but haven't found anything worthwhile.

Update 1: We have found that the functionality breaks due to a package getting updated. Here is the list of updated packages;

barryvdh/laravel-debugbar 2.0.6 -> 2.1.1 barryvdh/laravel-ide-helper 2.1.0 -> 2.1.2 codeception/codeception 2.1.4 -> 2.1.5 doctrine/cache 1.5.2 -> 1.6.0 laravel/framework 5.1.26 -> 5.1.28 league/flysystem 1.0.15 -> 1.0.16 maximebf/debugbar 1.10.5 -> 1.11.0 phpspec/phpspec 2.4.0 -> 2.4.1 phpunit/phpunit 4.8.20 -> 4.8.21 symfony/browser-kit 2.8.0 -> 2.8.1 symfony/class-loader 2.8.0 -> 2.8.1 symfony/console 2.7.7 -> 2.7.8 symfony/css-selector 2.7.7 -> 2.7.8 symfony/debug 2.7.7 -> 2.7.8 symfony/dom-crawler 2.7.7 -> 2.7.8 symfony/event-dispatcher 2.8.0 -> 2.8.1 symfony/finder 2.7.7 -> 2.7.8 symfony/http-foundation 2.7.7 -> 2.7.8 symfony/http-kernel 2.7.7 -> 2.7.8 symfony/polyfill-php56 1.0.0 -> 1.0.1 symfony/polyfill-util 1.0.0 -> 1.0.1 symfony/process 2.7.7 -> 2.7.8 symfony/routing 2.7.7 -> 2.7.8 symfony/translation 2.7.7 -> 2.7.8 symfony/var-dumper 2.7.7 -> 2.7.8 symfony/yaml 2.8.0 -> 3.0.1

Update 2: We have tried downgrading laravel and codeception but to no avail. It is strange as the machines which have been updated once will always throw that error even if they are downgraded till codeception 2.1.0. While the machine which passed all tests was on codeception 2.1.4 and webdriver 1.1.0.

Update 3: Installed selenium just to check and it works so maybe its phantomJS / ghost-driver which has conflict.

Example Test

public function test(AcceptanceTester $I) { $I->amOnUrl('http://swaggable.com'); $I->canSeeCurrentUrlEquals('/'); }

Example Output

Failed to check correct credentials in _001PlatformSignupCest::checkCorrectCredentials (tests\acceptance\_001PlatformSIgnupCest.php) [ModuleException] WebDriver: Current url is blank, no page was opened Scenario Steps: 3. $I->canSeeCurrentUrlEquals("/signup") 2. $I->amOnUrl("http://platform.work.com/signup") 1. $I->resizeWindow(1280,720)

Acceptance Configuration:

modules: enabled: - Asserts - WebDriver: url: http://platform.work.com browser: firefox http_proxy: direct - \Helper\Acceptance

Setup:

Laravel 5.1.28 Codeception 2.1.5 PhantomJS 2.0.0

Composer

"require": { "php": ">=5.5.9", "laravel/framework": "5.1.*", "barryvdh/laravel-ide-helper": "^2.0", "sboo/multiauth": "4.0.*", "dingo/api": "0.10.*", "doctrine/dbal": "2.3.*", "rtconner/laravel-kint": "~2.0", "factual/factual-php-driver": "dev-master", "weblee/mandrill": "dev-master", "barryvdh/laravel-debugbar": "^2.0", "laravel/envoy": "~1.0", "jeremeamia/superclosure": "~2.0", "illuminate/html": "~5.0", "predis/predis": "^1.0", "guzzlehttp/guzzle": "~5.3|~6.0", "laravelcollective/html": "5.1.*", "exeu/apai-io": "dev-master", "codeception/codeception": "*" }, "require-dev": { "mockery/mockery": "0.9.*", "phpunit/phpunit": "~4.0", "phpspec/phpspec": "~2.1", "fzaninotto/faker": "~1.0" },

最满意答案

您好我有同样的问题。

我已将幻影降级为1.9.7版本

... "jonnyw/php-phantomjs": "3.*", "site5/phantoman": "^1.0" }, "require-dev": { "phpunit/phpunit": "~4.0", "phpspec/phpspec": "~2.1" }, "autoload": { "classmap": [ "database" ], "psr-4": { "App\\": "app/" } }, "autoload-dev": { "classmap": [ "tests/TestCase.php" ] }, "scripts": { "post-install-cmd": [ "php artisan clear-compiled", "PhantomInstaller\\Installer::installPhantomJS", "php artisan optimize" ], "post-update-cmd": [ "php artisan clear-compiled", "PhantomInstaller\\Installer::installPhantomJS", "php artisan optimize" ], "post-create-project-cmd": [ "php -r \"copy('.env.example', '.env');\"", "php artisan key:generate" ] }, "config": { "preferred-install": "dist", "bin-dir": "bin" } }

它现在正在运行,但我知道是一种解决方法

Hello I have the same issue.

I have downgraded the phantomjs to the 1.9.7 version

... "jonnyw/php-phantomjs": "3.*", "site5/phantoman": "^1.0" }, "require-dev": { "phpunit/phpunit": "~4.0", "phpspec/phpspec": "~2.1" }, "autoload": { "classmap": [ "database" ], "psr-4": { "App\\": "app/" } }, "autoload-dev": { "classmap": [ "tests/TestCase.php" ] }, "scripts": { "post-install-cmd": [ "php artisan clear-compiled", "PhantomInstaller\\Installer::installPhantomJS", "php artisan optimize" ], "post-update-cmd": [ "php artisan clear-compiled", "PhantomInstaller\\Installer::installPhantomJS", "php artisan optimize" ], "post-create-project-cmd": [ "php -r \"copy('.env.example', '.env');\"", "php artisan key:generate" ] }, "config": { "preferred-install": "dist", "bin-dir": "bin" } }

And it working now, but I know is a workaround