You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been fighting with Panther and Selenium for two or three days on and off at this point, and so far they both keep eluding me.
I've given up on using Selenium Grid to use a remote browser and I just want to get the basic testing example to work.
I'm using the provided Dockerfile through Compose so I can specify the same network as the rest of my project; I have also changed PANTHER_NO_SANDBOX to false.
Then, for the test, I made the following modifications trying to understand what arguments, options and capabilities are needed:
public function testMyApp(): void
{
// dd($_SERVER);
$arguments = ['--headless', '--window-size=1200,1100', '--disable-gpu'];
$options = [
'scheme' => 'https',
'host' => 'NAME',
'path' => '/',
'chromedriver_arguments' => [],
'capabilities' => ['acceptInsecureCerts' => true],
'external_base_uri' => 'NAME',
];
$client = Client::createChromeClient('/usr/bin/chromedriver', $arguments, $options, 'NAME'); // Your app is automatically started using the built-in web server
$client->request('GET', '/');
[...]
I get this error:
1) App\Tests\E2E\pantherTest::testMyApp
RuntimeException: Could not connect to chrome after 30 seconds (OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to NAME:9515 for "https://NAME:9515/".).
I have replaced the actual local name for NAME in these snippets.
Before it times out, I can see the panther and chromedriver processes spawning, but that is as far as I get.
What I'm doing wrong?
Any feedback would be greatly appreciated.
The text was updated successfully, but these errors were encountered:
I wonder if you need to use Client::createSeleniumClient()? I would guess that the browser-specific static methods are for the WebDriver implementation, not Selenium.
FWIW, I have set up a remote Geckodriver instance (instrumentisto/geckodriver) instead of Selenium and that seems to work well. However Panther had to rather be hacked to get it to work:
I use a custom FirefoxManager as I needed it not to be final
Some of the private properties in the above class needed to be switched to protected
I extended the above class to overwrite start(), so that the browser process start is skipped (it is permanently running in another container)
I will stick with what I have, but it is not great code. The authors of Panther really did not want it to be extended in this fashion! Perhaps I will submit an improvement request, so that this can be done in a more elegant way.
Now that I look at it afresh, it might have been easier just to copy FirefoxManager and amend the start() method in situ. Still not a nice solution though.
For now, if you want to run your browser as a separate container, using Selenium probably is the most straightforward way.
I've been fighting with Panther and Selenium for two or three days on and off at this point, and so far they both keep eluding me.
I've given up on using Selenium Grid to use a remote browser and I just want to get the basic testing example to work.
I'm using the provided Dockerfile through Compose so I can specify the same network as the rest of my project; I have also changed
PANTHER_NO_SANDBOX
to false.Then, for the test, I made the following modifications trying to understand what arguments, options and capabilities are needed:
I get this error:
I have replaced the actual local name for NAME in these snippets.
Before it times out, I can see the panther and chromedriver processes spawning, but that is as far as I get.
What I'm doing wrong?
Any feedback would be greatly appreciated.
The text was updated successfully, but these errors were encountered: