Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-41555

Catch generic unknown driver exception to provide a few tips about the most usual problems

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      To perform this test need:

      • Have Firefox 23 installed (last released version in ubunut 12.04 right now 2013-09-04)
      • Use PHP 5.4
      1. Install & enable your behat site
      2. Run vendor/bin/behat --config /path/to/config/behat.yml --tags @mod_survey
      3. You SHOULD see the tests results (dots) and it SHOULD all pass and finished as expected
      4. Run vendor/bin/behat --config /path/to/config/behat.yml
      5. You SHOULD see an exception stating that selenium server is not running
      6. Download selenium 2.33 and 2.35 (or the latest one)
      7. Start selenium server 2.33 in another CLI
      8. You SHOULD see an exception stating that something went wrong with selenium or the browser and proposing to try to upgrade selenium to solve the problems
      9. Stop selenium 2.33 and start selenium 2.35
      10. Check again the behat CLI window or the firefox browser in a minute or so, you SHOULD see how tests are running, you can stop the suite run
      11. Stop your web server (the built-in one, apache or whatever you are using)
      12. You SHOULD see and exception with something like *http://yoursiteurl.com/master is not available, ensure you started your PHP built-in server or your web server is correctly started and set up. More info in http://docs.moodle.org/dev/Acceptance_testing#Running_tests*
      13. In case it was enabled, disable $CFG->behat_switchcompletely and admin/tool/behat/cliutil.php --enable again
      14. Start the built-in server in /var/www/whatever/other/directory/without/a/moodle/site directory
      15. Run behat
      16. You SHOULD see an exception stating something like The base URL (http://localhost:8000) is not a behat test site
      Show
      To perform this test need: Have Firefox 23 installed (last released version in ubunut 12.04 right now 2013-09-04) Use PHP 5.4 Install & enable your behat site Run vendor/bin/behat --config /path/to/config/behat.yml --tags @mod_survey You SHOULD see the tests results (dots) and it SHOULD all pass and finished as expected Run vendor/bin/behat --config /path/to/config/behat.yml You SHOULD see an exception stating that selenium server is not running Download selenium 2.33 and 2.35 (or the latest one) http://selenium.googlecode.com/files/selenium-server-standalone-2.33.0.jar http://selenium.googlecode.com/files/selenium-server-standalone-2.35.0.jar (replace 35 for 36 or whatever if there are new versions when this is tested) Start selenium server 2.33 in another CLI You SHOULD see an exception stating that something went wrong with selenium or the browser and proposing to try to upgrade selenium to solve the problems Stop selenium 2.33 and start selenium 2.35 Check again the behat CLI window or the firefox browser in a minute or so, you SHOULD see how tests are running, you can stop the suite run Stop your web server (the built-in one, apache or whatever you are using) You SHOULD see and exception with something like * http://yoursiteurl.com/master is not available, ensure you started your PHP built-in server or your web server is correctly started and set up. More info in http://docs.moodle.org/dev/Acceptance_testing#Running_tests* In case it was enabled, disable $CFG->behat_switchcompletely and admin/tool/behat/cliutil.php --enable again Start the built-in server in /var/www/whatever/other/directory/without/a/moodle/site directory Run behat You SHOULD see an exception stating something like The base URL ( http://localhost:8000 ) is not a behat test site
    • Affected Branches:
      MOODLE_25_STABLE, MOODLE_26_STABLE
    • Fixed Branches:
      MOODLE_25_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-41555_master

      Description

      Recently Firefox is being updated to it's 23 version in Ubuntu 12.04 (LTS) systems, which is not compatible with old Selenium versions 2.33 and lower IIRC, throwing an unknown driver exception like waiting for evaluate.js load failed

      We can catch this exception (WebDriver\Exception\UnknownError in general) adding something like:
      There was a problem with selenium or the browser, try to upgrade Selenium to the latest version . $originalexceptionmessage

      I don't like to be that specific about selenium being just one more behat driver, but with the current message users would be really lost about where is the problem. Opinions would be much appreciated.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  14/May/13