panther icon indicating copy to clipboard operation
panther copied to clipboard

Cannot launch tests using panther getting runtime exception

Open theTestingApproach opened this issue 3 years ago • 7 comments

Hello,

I have just started learning panther but getting this issue when launching the tests:

Symfony\Component\Process\Exception\RuntimeException: The provided cwd "/home/anuradha/Documents/Projects/panther/vendor/symfony/panther/src/../../../../public" does not exist.

/home/anuradha/Documents/Projects/panther/vendor/symfony/process/Process.php:344 /home/anuradha/Documents/Projects/panther/vendor/symfony/panther/src/ProcessManager/WebServerManager.php:80 /home/anuradha/Documents/Projects/panther/vendor/symfony/panther/src/PantherTestCaseTrait.php:135 /home/anuradha/Documents/Projects/panther/vendor/symfony/panther/src/PantherTestCaseTrait.php:164 /home/anuradha/Documents/Projects/panther/src/Features/Browser/OpenBrowserTest.php:14

Someone said to add some config in the projects root document here: https://github.com/symfony/panther/issues/152

Can someone please guide me where this is actually?

This is my code below which i am trying to launch..

request('GET', 'www.xxx.com');//This is an example url } } Thank you

theTestingApproach avatar May 31 '21 11:05 theTestingApproach

You foggoten install drivers for Chrome.

`Installing ChromeDriver and geckodriver Panther uses the WebDriver protocol to control the browser used to crawl websites.

On all systems, you can use dbrekelmans/browser-driver-installer to install ChromeDriver and geckodriver locally:

composer require --dev dbrekelmans/bdi vendor/bin/bdi detect drivers Panther will detect and use automatically drivers stored in the drivers/ directory.

Alternatively, you can use the package manager of your operating system to install them.

On Ubuntu, run:

apt-get install chromium-chromedriver firefox-geckodriver On Mac, using Homebrew:

brew install chromedriver geckodriver On Windows, using chocolatey:

choco install chromedriver selenium-gecko-driver Finally, you can download manually ChromeDriver (for Chromium or Chrome) and GeckoDriver (for Firefox) and put them anywhere in your PATH or in the drivers/ directory of your project.`

Mepcuk avatar May 31 '21 13:05 Mepcuk

https://github.com/symfony/panther

Mepcuk avatar May 31 '21 13:05 Mepcuk

Hi @Mepcuk , I have tried them but still getting the same issues: image

theTestingApproach avatar May 31 '21 13:05 theTestingApproach

@theTestingApproach what Client do you use ? Curl ? Chrome?

Mepcuk avatar May 31 '21 13:05 Mepcuk

I use panther client: This is my code..I am just trying to open the site and its failing already

<?php

namespace E2E\Features\Browser;

use Symfony\Component\Panther\PantherTestCase;
use Symfony\Component\Panther\WebTestCase;
use Symfony\Component\Panther\Client;
use PHPUnit\Framework\TestCase;
class OpenBrowserTest extends PantherTestCase{

    public function testBrowserOpen(): void{
        $client = self::createPantherClient(); 
        $client->request('GET', 'www.xxx.com');//This is an example url
    }
}

theTestingApproach avatar May 31 '21 13:05 theTestingApproach

Hello, Is there anything i can try pls? Tried to setup everything again got the same issue. Thanks

theTestingApproach avatar May 31 '21 21:05 theTestingApproach

same problem

joe94113 avatar Nov 07 '22 06:11 joe94113