<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>27097</bug_id>
          
          <creation_ts>2014-10-18 13:37:01 +0000</creation_ts>
          <short_desc>Mandate ordering which required capabilities must be checked</short_desc>
          <delta_ts>2014-10-22 23:51:36 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Browser Test/Tools WG</product>
          <component>WebDriver</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Andreas Tolfsen">ato</reporter>
          <assigned_to name="Browser Testing and Tools WG">public-browser-tools-testing</assigned_to>
          <cc>dburns</cc>
    
    <cc>mike</cc>
    
    <cc>vlotoshnikov</cc>
          
          <qa_contact name="Browser Testing and Tools WG">public-browser-tools-testing</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>113414</commentid>
    <comment_count>0</comment_count>
    <who name="Andreas Tolfsen">ato</who>
    <bug_when>2014-10-18 13:37:01 +0000</bug_when>
    <thetext>In section 4.1.1 we should mandate, and not merely suggest, the ordering in which the required capabilities must be checked.

This is important for interoperability so that one remote end doesn&apos;t parse browserVersion before browserName.

The mandated order should be:

1. browserName
2. browserVersion
3. platformName
4. platformVersion</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>113488</commentid>
    <comment_count>1</comment_count>
    <who name="David Burns :automatedtester">dburns</who>
    <bug_when>2014-10-20 20:11:32 +0000</bug_when>
    <thetext>Since we are should check them all, should we even have this note? I copied this across but thinking about it I think we should be returning all capabilites that do not match in the error message(this is currently missing from the prose and I need to add it).

Since all errors are being returned what value would there be (for interop) in mandating the order of capabilities?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>113491</commentid>
    <comment_count>2</comment_count>
    <who name="David Burns :automatedtester">dburns</who>
    <bug_when>2014-10-20 20:58:05 +0000</bug_when>
    <thetext>https://treeherder.mozilla.org/ui/#/jobs?repo=try&amp;revision=e1e1b23f7739 is an example of what I mean, patch isnt complete but at least it&apos;s working</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>113558</commentid>
    <comment_count>3</comment_count>
    <who name="seva">vlotoshnikov</who>
    <bug_when>2014-10-22 10:59:46 +0000</bug_when>
    <thetext>In certain cases, when a remote returns an error, it might not be very clear which capabilities are or aren&apos;t met. Example: an intermediary remote node (selenium-java-server/grid) receives a startSession with required browserName=firefox and browserVersion=20. But it does not have any firefoxes available. So it knows that browserName is a cap that it cannot match. browserVersion=20: was its presense or value a reason for it to return an error response? No, it would return an error regardless. Should it include browserVersion as a capability it couldn&apos;t match? Unclear.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>113559</commentid>
    <comment_count>4</comment_count>
    <who name="seva">vlotoshnikov</who>
    <bug_when>2014-10-22 11:17:02 +0000</bug_when>
    <thetext>Re the patch (full file: https://hg.mozilla.org/try/file/dc7d0afee49c/testing/marionette/marionette-server.js ).

That code will handle unknown (to that driver) capabilities in a way that looks both non-compliant and sub-optimal: it will include all unknown capabilities in this.sessionCapabilities and (I assume) will be returning them as &quot;actual capabilities&quot; of the session. So the local end may check the returned actual capabilities and conclude the capability it asked for (required) is met - while marionette doesn&apos;t know anything about it and likely doesn&apos;t actually provide it.

I agree with Andreas who suggested that drivers MUST ignore requested capabilities they don&apos;t know about***. And I think drivers definitely must not return capabilities they do not know about (and they should assume they therefore don&apos;t provide them) as &quot;actual capabilities&quot; of the session.

*** &quot;know about&quot; is a tricky concept, has edge cases, the spec should define that very specifically.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>113562</commentid>
    <comment_count>5</comment_count>
    <who name="seva">vlotoshnikov</who>
    <bug_when>2014-10-22 11:41:22 +0000</bug_when>
    <thetext>When we include intermediary remote end nodes in the picture of matching capabilities and returning actual capabilities for a session, it becomes a little tricky, with some hard to reconcile edge cases. (I could give a couple of examples)

Not sure how deeply into intermediary-nodes considerations the spec should go.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>113622</commentid>
    <comment_count>6</comment_count>
    <who name="David Burns :automatedtester">dburns</who>
    <bug_when>2014-10-22 23:51:36 +0000</bug_when>
    <thetext>(In reply to seva from comment #3)
&gt; In certain cases, when a remote returns an error, it might not be very clear
&gt; which capabilities are or aren&apos;t met. Example: an intermediary remote node
&gt; (selenium-java-server/grid) receives a startSession with required
&gt; browserName=firefox and browserVersion=20. But it does not have any
&gt; firefoxes available. So it knows that browserName is a cap that it cannot
&gt; match. browserVersion=20: was its presense or value a reason for it to
&gt; return an error response? No, it would return an error regardless. Should it
&gt; include browserVersion as a capability it couldn&apos;t match? Unclear.

I agree that all errors should be returned, so ALL capabilities passed in should be tested and if they all fail then all of them should be in the error message returned to the local end.

(In reply to seva from comment #4)
&gt; I agree with Andreas who suggested that drivers MUST ignore requested
&gt; capabilities they don&apos;t know about***. And I think drivers definitely must
&gt; not return capabilities they do not know about (and they should assume they
&gt; therefore don&apos;t provide them) as &quot;actual capabilities&quot; of the session.

The reason why I left it in is that I think that I can see a use case where the local end might want to store information in the capabilities. E.g. test run number, revision that the session was created against and then use the capabilites for a bit of state.

(In reply to seva from comment #5)
&gt; When we include intermediary remote end nodes in the picture of matching
&gt; capabilities and returning actual capabilities for a session, it becomes a
&gt; little tricky, with some hard to reconcile edge cases. (I could give a
&gt; couple of examples)
&gt; 
&gt; Not sure how deeply into intermediary-nodes considerations the spec should
&gt; go.

We should probably specify this :)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>