Skip to content

Facebook\WebDriver\Exception\NoSuchWindowException : no such window: target window already closed from unknown error: web view not found #180

@devnix

Description

@devnix

Hi! I'm getting this exception at random times:

/bin/php /home/devnix/dev/symfony/dynamic-forms/vendor/phpunit/phpunit/phpunit --configuration /home/devnix/dev/symfony/dynamic-forms/phpunit.xml.dist --teamcity
Testing started at 17:55 ...
PHPUnit 9.6.25 by Sebastian Bergmann and contributors.

Testing 

Facebook\WebDriver\Exception\NoSuchWindowException : no such window: target window already closed
from unknown error: web view not found
  (Session info: chrome=139.0.7258.66)
 /home/devnix/dev/symfony/dynamic-forms/vendor/php-webdriver/webdriver/lib/Exception/WebDriverException.php:124
 /home/devnix/dev/symfony/dynamic-forms/vendor/php-webdriver/webdriver/lib/Remote/HttpCommandExecutor.php:359
 /home/devnix/dev/symfony/dynamic-forms/vendor/php-webdriver/webdriver/lib/Remote/RemoteWebDriver.php:601
 /home/devnix/dev/symfony/dynamic-forms/vendor/php-webdriver/webdriver/lib/Remote/RemoteWebDriver.php:282
 /home/devnix/dev/symfony/dynamic-forms/vendor/symfony/panther/src/Client.php:553
 /home/devnix/dev/symfony/dynamic-forms/vendor/symfony/panther/src/Client.php:280
 /home/devnix/dev/symfony/dynamic-forms/vendor/zenstruck/browser/src/Browser/Session/Driver/PantherDriver.php:63
 /home/devnix/dev/symfony/dynamic-forms/vendor/zenstruck/browser/src/Browser/Session.php:86
 /home/devnix/dev/symfony/dynamic-forms/vendor/zenstruck/browser/src/Browser.php:60
 /home/devnix/dev/symfony/dynamic-forms/tests/E2ETest.php:23
 


Saved Browser Artifacts:

  Symfonycasts\DynamicForms\Tests\E2ETest::testRecursiveDynamicFields
    Saved Source Files:
      * ./tests/fixtures/var/browser/source/error_Symfonycasts-DynamicForms-Tests-E2ETest__testRecursiveDynamicFields__0.html:

Time: 00:00.916, Memory: 22.00 MB


ERRORS!
Tests: 5, Assertions: 33, Errors: 1.

Remaining indirect deprecation notices (4)

  1x: Method "Behat\Mink\Driver\CoreDriver::evaluateScript()" might add "mixed" as a native return type declaration in the future. Do the same in child class "Zenstruck\Browser\Session\Driver\PantherDriver" now to avoid errors or add an explicit @return annotation to suppress this message.
    1x in E2ETest::testRecursiveDynamicFields from Symfonycasts\DynamicForms\Tests

  1x: Method "JsonSerializable::jsonSerialize()" might add "mixed" as a native return type declaration in the future. Do the same in implementation "Facebook\WebDriver\Firefox\FirefoxOptions" now to avoid errors or add an explicit @return annotation to suppress this message.
    1x in E2ETest::testRecursiveDynamicFields from Symfonycasts\DynamicForms\Tests

  1x: The "Facebook\WebDriver\Local\LocalWebDriver::createBySessionID()" method will require a new "bool $isW3cCompliant" argument in the next major version of its parent class "Facebook\WebDriver\Remote\RemoteWebDriver", not defining it is deprecated.
    1x in E2ETest::testRecursiveDynamicFields from Symfonycasts\DynamicForms\Tests

  1x: The "Facebook\WebDriver\Local\LocalWebDriver::createBySessionID()" method will require a new "WebDriverCapabilities|null $existingCapabilities" argument in the next major version of its parent class "Facebook\WebDriver\Remote\RemoteWebDriver", not defining it is deprecated.
    1x in E2ETest::testRecursiveDynamicFields from Symfonycasts\DynamicForms\Tests

Process finished with exit code 2

Here's my code from the beginning to line 23:

<?php

/*
 * This file is part of the SymfonyCasts DynamicForms package.
 * Copyright (c) SymfonyCasts <https://symfonycasts.com/>
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfonycasts\DynamicForms\Tests;

use Symfony\Component\Panther\PantherTestCase;
use Symfonycasts\DynamicForms\Tests\fixtures\DynamicFormsTestKernel;
use Zenstruck\Browser\Test\HasBrowser;

class E2ETest extends PantherTestCase
{
    use HasBrowser;

    public function testRecursiveDynamicFields()
    {
        $browser = $this->pantherBrowser();
        $browser->visit('/form-pizza-selected')

I'm opening an issue here since I'm out of ideas, I suspect the problem may be external to Zenstruck but I didn't find anything relevant in my research 😅

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions