JBehave
  1. JBehave
  2. JBEHAVE-400

Error in WebDriverProvider initialize method ignored due to NPE in StoryRunner

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: web-3.1
    • Fix Version/s: 3.2
    • Component/s: Web Selenium
    • Labels:
      None
    • Number of attachments :
      1

      Description

       
      new WebDriverProvider() {
         public void initialize() { 
           throw new RuntimeException(); //  or Error or something
         } 
      } 
      

      ... does not get reported. It's consumed because of a later NPE

      The NPE is in StoryRunner, concerning member variable 'reporter' which is not set before use, in this situation.

        Activity

        Hide
        Paul Hammant added a comment -

        See the Etsy tutorial. If you change the WebDriver sys-prop to 'DoesNotExist' and run the tests, you'll get the NPE described in this bug report.

        It is because new FirefoxDriver() fails during the initialize() of WebDriverProvider as described, but that is totally hidden by a reference to StoryRunner.runner being null and causing a NPE.

        • Paul
        Show
        Paul Hammant added a comment - See the Etsy tutorial. If you change the WebDriver sys-prop to 'DoesNotExist' and run the tests, you'll get the NPE described in this bug report. It is because new FirefoxDriver() fails during the initialize() of WebDriverProvider as described, but that is totally hidden by a reference to StoryRunner.runner being null and causing a NPE. Paul
        Hide
        Paul Hammant added a comment -

        To reproduce this, implicate a non-existant FireFox profile in EtsyDotComStories:

        static

        { System.setProperty("webdriver.firefox.profile", "NonExistantWebDriverProfile"); }
        Show
        Paul Hammant added a comment - To reproduce this, implicate a non-existant FireFox profile in EtsyDotComStories: static { System.setProperty("webdriver.firefox.profile", "NonExistantWebDriverProfile"); }
        Hide
        Paul Hammant added a comment -

        or have firefox in a non-standard location

        Show
        Paul Hammant added a comment - or have firefox in a non-standard location
        Mauro Talevi made changes -
        Field Original Value New Value
        Fix Version/s 3.2 [ 16757 ]
        Affects Version/s web-3.1 [ 16756 ]
        Affects Version/s 3.2 [ 16757 ]
        Mauro Talevi made changes -
        Fix Version/s 3.3 [ 17108 ]
        Fix Version/s 3.2 [ 16757 ]
        Mauro Talevi made changes -
        Fix Version/s 3.x [ 16979 ]
        Fix Version/s 3.3 [ 17108 ]
        Mauro Talevi made changes -
        Component/s Core [ 11086 ]
        Component/s Web Selenium [ 14124 ]
        Mauro Talevi made changes -
        Summary Error in WebDriverProvider intialize method ignored because of consequential NPE for StoryRunner.reporter Error in WebDriverProvider initialize method causes NPE in StoryRunner
        Fix Version/s web-3.3 [ 17272 ]
        Fix Version/s 3.x [ 16979 ]
        Component/s Web Selenium [ 14124 ]
        Component/s Core [ 11086 ]
        Mauro Talevi made changes -
        Summary Error in WebDriverProvider initialize method causes NPE in StoryRunner Error in WebDriverProvider initialize method ignored due to NPE in StoryRunner
        Hide
        Mauro Talevi added a comment -

        Fixed in Core 3.3. Added unit test to verify error not ignored.

        Show
        Mauro Talevi added a comment - Fixed in Core 3.3. Added unit test to verify error not ignored.
        Mauro Talevi made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Paul Hammant added a comment -

        yay!

        Show
        Paul Hammant added a comment - yay!
        Paul Hammant made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Paul Hammant made changes -
        Status Reopened [ 4 ] Closed [ 6 ]
        Fix Version/s 3.2 [ 16757 ]
        Fix Version/s web-3.3 [ 17272 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Paul Hammant
          • Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: