0 Replies Latest reply on Nov 20, 2012 2:08 PM by Dan Allen

    Fixing the semantics of the qualifier attribute in the extension configuration

    Dan Allen Master

      Now that I see it's possible to have qualified extension configurations, I think we need to revisit the choice of attribute names for identifiying an extension configuration.

       

      Here's an example of the webdriver configuration w/ multiple qualifiers (from the test suite):

       

          <extension qualifier="webdriver">
              <property name="browserCapabilities">chrome</property>
              <property name="chromeDriverBinary">/opt/google/chrome/chromedriver</property>
          </extension>
      
          <extension qualifier="webdriver-reusable">
              <property name="remoteAddress">http://localhost:4444/wd/hub/</property>
              <property name="remoteReusable">true</property>
              <property name="browserCapabilities">chrome</property>
              <property name="chromeDriverBinary">/opt/google/chrome/chromedriver</property>
          </extension>
      
          <extension qualifier="webdriver-legacyconfiguration">
              <property name="implementationClass">org.openqa.selenium.firefox.FirefoxDriver</property>
          </extension>
      

       

      It's clear to see we are overloading the qualifier attribute.

       

      Instead of using the term qualifier to identify an extension, I think we should use one of the following:

       

      • id
      • name

       

      The attribute "id" is probably more correct semantically, since we can assume that every extension has a globally unique identifier (we already assume that now). Internally, however, we refer to this identifier as the extension name, thus "name" may be a more natural transition.

       

      By using either "id" or "name" for the purpose of identifying the extension to which the configuration maps, that frees up qualifier to use it for it's true purpose, to qualify the different sets of properties. Assuming we choose "name" for the globally unique identifier for a configuration, the above configuration becomes:

       

          <extension name="webdriver">
              <property name="browserCapabilities">chrome</property>
              <property name="chromeDriverBinary">/opt/google/chrome/chromedriver</property>
          </extension>
      
          <extension name="webdriver" qualifier="reusable">
              <property name="remoteAddress">http://localhost:4444/wd/hub/</property>
              <property name="remoteReusable">true</property>
              <property name="browserCapabilities">chrome</property>
              <property name="chromeDriverBinary">/opt/google/chrome/chromedriver</property>
          </extension>
      
          <extension name="webdriver" qualifier="legacyconfiguration">
              <property name="implementationClass">org.openqa.selenium.firefox.FirefoxDriver</property>
          </extension>
      

       

      I think we can offer support for this new syntax while maintaining backwards compatibility.

       

      WDYT? Should I file an issue?