3
  1. I installed MFTF and selenium accoring to https://devdocs.magento.com/mftf/docs/getting-started.html

  2. I run:

    $ java -Dwebdriver.chrome.driver=chromedriver -jar selenium-server-standalone-3.141.59.jar 
    17:27:35.423 INFO [GridLauncherV3.parse] - Selenium server version: 3.141.59, revision: e82be7d358
    17:27:35.480 INFO [GridLauncherV3.lambda$buildLaunchers$3] - Launching a standalone Selenium Server on port 4444
    2021-03-21 17:27:35.514:INFO::main: Logging initialized @232ms to org.seleniumhq.jetty9.util.log.StdErrLog
    17:27:35.667 INFO [WebDriverServlet.<init>] - Initialising WebDriverServlet
    17:27:35.727 INFO [SeleniumServer.boot] - Selenium Server is up and running on port 4444
    
  3. From another console I run:

    vendor/bin/codecept run functional -c dev/tests/acceptance/codeception.yml
    Codeception PHP Testing Framework v4.1.18
    Powered by PHPUnit 9.1.5 by Sebastian Bergmann and contributors.
    
    Magento\FunctionalTestingFramework.functional Tests (4097) -------------------------------------------------------------------------------------------
    - AdminAdobeStockConfigTestCest: Admin adobe stock config test
    /******** Beginning execution of AdobeStockIntegrationConfigurationSuite suite before block ********/
    
    In MagentoWebDriver.php line 853:
    
      Suite condition failure:                   
      Call to a member function close() on null  
    

I see that Chromium was started, but I don't see any activity there. What am I doing wrong? How to run tests properly?

Magento 2.4.2(MFTF3)

Chromium 89.0.4389.90 snap (webd

OS Ubuntu 20.04

During installation I spotted these issue: vendor/bin/mftf generate:tests

NOTICE: 324 Section name violations detected. See mftf.log for details.[]
NOTICE: 780 section element name violations detected. See mftf.log for details.[]
NOTICE: 388 data entity name violations detected. See mftf.log for details.[]
NOTICE: 18 data entity key violations detected. See mftf.log for details.[]
NOTICE: 470 action group name violations detected. See mftf.log for details.[]
NOTICE: 47 Page name violations detected. See mftf.log for details.[]
NOTICE: Suite 'InventoryB2bSingleModeSuite' contains no tests and won't be generated.[]
NOTICE: Suite 'InventoryEeSingleModeSuite' contains no tests and won't be generated.[]
Generate Tests Command Run

When I run

$ vendor/bin/mftf doctor


 Requesting API token for admin user through cURL ...

                                                                                                                        
 [OK] Successful                                                                                                        
                                                                                                                        

 Connecting to Selenium Server ...

                                                                                                                        
 [ERROR] Failed to connect Selenium WebDriver at: http://127.0.0.1:4444/wd/hub.                                         
         Please make sure that Selenium Server is running.                                                              
                                                                                                                        

 Loading Admin page ...

                                                                                                                        
 [ERROR] Failed to load page at url: http://esw-serhiy.ngrok.io/magento24ee/pub/admin/admin                             
         Please check Selenium Browser session have access to Magento instance.                                         
                                                                                                                        

 Loading Storefront page ...

                                                                                                                        
 [ERROR] Failed to load page at url: http://esw-serhiy.ngrok.io/magento24ee/pub/                                        
         Please check Selenium Browser session have access to Magento instance.                                         
                                                                                                                        

 Running Magento CLI ...

                                                                                                                        
 [ERROR] Failed to run Magento CLI command                                                                              
         Please reference Magento DevDoc to setup command.php and .htaccess files.                                      

                                                                                                                    

http://127.0.0.1:4444/wd/hub is responding, i see "No sessions" by that URL.

5
  • Any success on this, I am getting the same issue
    – Yogita
    Commented May 6, 2021 at 16:54
  • @Yogita, Serhiy Do you done? this
    – Magento007
    Commented May 21, 2021 at 13:21
  • @Magento007, No still the same, issue is might I am accessing the server using public IP but in MFTF PHP the url is given using server's local IP as the public IP not working for MFTF when it hits Magento API internally. And I still haven't got any solution.
    – Yogita
    Commented May 21, 2021 at 13:39
  • @Yogita no solution was found that day, I switched to another task. Commented Aug 2, 2021 at 8:40
  • Got the same issue. In attempt to debug I started selenium-server manually (to watch the log): "brew services stop selenium-server", "/opt/homebrew/opt/selenium-server/bin/selenium-server standalone --port 4444" Somehow that resolved the issue (brew plist has the same configuration) Commented Nov 10, 2022 at 21:07

1 Answer 1

2

Check if curl has an access to "/dev/tests/acceptance/utils/command.php"

i`m using nginx and have this nginx config as a part of nginx.conf:

location ~* ^/dev/tests/acceptance/utils($|/) {
    root $MAGE_ROOT;
    location ~ ^/dev/tests/acceptance/utils/command.php {
        fastcgi_pass   fastcgi_backend;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        include        fastcgi_params;
    }
}

if you find file Magento/FunctionalTestingFramework/Module/MagentoWebDriver.php, you can see there how $baseUrl is generated. And this url must be accessible. In your case seems it's not. So just check access to this url.

4
  • Hi @Anthony, I'm not using Nginx. I'm using Apache on my localhost. Still I renamed nginx.conf.sample to nginx.conf in magento_root and added the script you mentioned (as it is recommended in MFTF documentation as well), but no luck. Commented Jan 8, 2023 at 20:23
  • @MuhammadSaeedKhan what kind of error do you have?
    – Anthony
    Commented Jan 10, 2023 at 12:48
  • This has solved the problem for me
    – snez
    Commented Oct 25, 2023 at 10:15
  • NOTE: It has to be added near the top of the conf file, otherwise other directives will not allow it to take effect.
    – snez
    Commented Oct 25, 2023 at 11:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.