From da92eb066e7c80ae4ae9d1b3ac42ccc5831e23f2 Mon Sep 17 00:00:00 2001 From: AutomatedTester Date: Wed, 29 Apr 2015 00:14:03 +0100 Subject: [PATCH 1/3] Documenting the process of handling capabilities --- 03_capabilities.html | 180 +++++++++++++++++++++++++++++++++++++++++- webdriver-spec.html | 181 ++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 359 insertions(+), 2 deletions(-) diff --git a/03_capabilities.html b/03_capabilities.html index d43ea7b4b..bd82e4b3b 100644 --- a/03_capabilities.html +++ b/03_capabilities.html @@ -1 +1,179 @@ - \ No newline at end of file +
+

Capabilities

+

+ Webdriver capabilities allow the local end to specify what + features it requires the remote end to fulfil to be able to create a + new session +

+

Processing Capabilities

+

+

The remote end steps to process capabilities are:

+
    +
  1. Let server capabilities be a JSON Object with the following entries:

  2. +
      +
    1. Let "browserName" be an entry with value equal to the lowercase name of the user agent

    2. +
    3. Let "browserVersion" be an entry with the value equal to the version of the user agent

    4. +
    5. Let "platformName" be an entry with the value equal to the lowercase name of the platform.

    6. +
    7. Let "platformVersion" be an entry with the value equal to the version of the platform

    8. +
    9. Let "acceptSslCerts" be an entry with the value equal to true if it can handle + Invalid SSL Certifications else let it be equal to + false.

    10. +
    11. Let "takesScreenshot" be an entry with the value equal to true if it can capture + a screenshot of the viewport described in Take Screenshot.

    12. +
    13. Let "takesElementScreenshot" be an entry with the value equal to true if it can capture + a screenshot of an element as described in Take Screenshot.

    14. +
    +
  3. Let capabilities be the result of getting a property + named "capabilities" from the parameters argument.

  4. +
  5. let required capabilities be the result of getting a property + name "required capabilities" from capabilities.

  6. +
  7. let desired capabilities be the result of getting a property + name "desired capabilities" from capabilities.

  8. +
  9. If required capabilities is undefined and + desired capabilities is undefined, go to the last step of this algorithm.

  10. +
  11. Let length be the length of required capabilities + if required capabilities is defined else let it be 0.

  12. +
  13. Let k be 0

  14. +
  15. While k < length:

    +
      +
    1. Let capability be the value in required capabilities at index k.

    2. +
    3. If the name of the capability entry is in desired capabilities + remove the entry from desired capabilities.

      +
    4. +
    5. Increase k by 1.
    6. +
    +
  16. +
  17. Let unmet capabilities be equal to an empty JSON List.

  18. +
  19. +

    Let unprocessed capabilities be a JSON List that contains required + capabilities if defined and desired capabilities if defined.

    +
  20. +
  21. +

    Let j be 0

    +
  22. +
  23. +

    Let capabilties length be the length of unprocessed capabilities.

    +
  24. +
  25. +

    While j < capabilities length: +

      +
    1. +

      + Let caps be the entry at index j in unprocessed + capabilities. +

      +
    2. +
    3. +

      Let browser name be the result of getting a property + named "browserName" from caps. If browser name + is undefined move to the next step. If caps equals required + capabilities do the following:

      +
        +
      1. +

        + If browser name is defined + and is not equal to "browserName" from server capabilities append a string + containing the differences between browser name and "browserName" + in server capabilities. +

        +
      2. +
      +
    4. +
    5. +

      Let browser version be the result of getting a property + named "browserVersion" from caps. If browser name + is undefined move to the next step. + If caps equals required capabilities do the following:

      +
        +
      1. +

        If browser name is defined + and is not equal to "browserVersion" from server capabilities append a string + containing the differences between browser version and "browserVersion" + in server capabilities. +

        +
      2. +
      +
    6. +
    7. +

      Let platform name be the result of getting a property + named "platformName" from caps. If platform name + is undefined move to the next step. + If caps equals required capabilities do the following:

      +
        +
      1. +

        If platform name is defined + and is not equal to "platformName" from server capabilities append a string + containing the differences between browser name and "platformName" + in server capabilities. +

        +
      2. +
      +
    8. +
    9. +

      Let platform version be the result of getting a property + named "platformVersion" from caps. If platform version + is undefined move to the next step. + If caps equals required capabilities do the following:

      +
        +
      1. +

        If platform version is defined + and is not equal to "platformVersion" from server capabilities append a string + containing the differences between platform version and "platformVersion" + in server capabilities. +

        +
      2. +
      +
    10. +
    11. +

      Let proxy be the result of getting a property + named "proxy" from caps. If proxy + is undefined move to the next step. If proxy is defined and not a map + append a string saying that a map is required else call setup proxy + passing in proxy. + If caps equals required capabilities do the following:

      +
        +
      1. +

        If any errors are returned from setup proxy + append to unmet capabilities else set the entry "proxy" in server + capabilities to the value in proxy. +

        +
      2. +
      +
    12. +
    13. +

      Let page load strategy be the result of getting a property + named "pageLoadStrategy" from caps. If page load strategy + is undefined then set the entry "pageLoadStrategy" in server capabilities to normal. + If caps equals required capabilities do the following:

      +
        +
      1. +

        If page load strategy is defined and not equal to normal, eager and none + then append a string saying that it contains an invalid value else set the entry + "pageLoadStrategy" in server capabilities to the value in page load + strategy. +

        +
      2. +
      +

      + If caps equals desired capabilities: +

      +
        +
      1. +

        + If page load strategy is defined and not equal to normal, eager and none + then set the entry "pageLoadStrategy" in server capabilities to normal.. +

        +
      2. +
      +
    14. +
    +

    +
  26. +
  27. +

    If the length of unmet capabilities is not equal to 0 return + session not created with data unmet capabilities.

    +
  28. +
  29. Return server capabilities

  30. +
+

+
diff --git a/webdriver-spec.html b/webdriver-spec.html index 7058d29f1..189703221 100644 --- a/webdriver-spec.html +++ b/webdriver-spec.html @@ -746,7 +746,186 @@

Handling of Status Codes at the Local End

-
+
+

Capabilities

+

+ Webdriver capabilities allow the local end to specify what + features it requires the remote end to fulfil to be able to create a + new session +

+

Processing Capabilities

+

+

The remote end steps to process capabilities are:

+
    +
  1. Let server capabilities be a JSON Object with the following entries:

  2. +
      +
    1. Let "browserName" be an entry with value equal to the lowercase name of the user agent

    2. +
    3. Let "browserVersion" be an entry with the value equal to the version of the user agent

    4. +
    5. Let "platformName" be an entry with the value equal to the lowercase name of the platform.

    6. +
    7. Let "platformVersion" be an entry with the value equal to the version of the platform

    8. +
    9. Let "acceptSslCerts" be an entry with the value equal to true if it can handle + Invalid SSL Certifications else let it be equal to + false.

    10. +
    11. Let "takesScreenshot" be an entry with the value equal to true if it can capture + a screenshot of the viewport described in Take Screenshot.

    12. +
    13. Let "takesElementScreenshot" be an entry with the value equal to true if it can capture + a screenshot of an element as described in Take Screenshot.

    14. +
    +
  3. Let capabilities be the result of getting a property + named "capabilities" from the parameters argument.

  4. +
  5. let required capabilities be the result of getting a property + name "required capabilities" from capabilities.

  6. +
  7. let desired capabilities be the result of getting a property + name "desired capabilities" from capabilities.

  8. +
  9. If required capabilities is undefined and + desired capabilities is undefined, go to the last step of this algorithm.

  10. +
  11. Let length be the length of required capabilities + if required capabilities is defined else let it be 0.

  12. +
  13. Let k be 0

  14. +
  15. While k < length:

    +
      +
    1. Let capability be the value in required capabilities at index k.

    2. +
    3. If the name of the capability entry is in desired capabilities + remove the entry from desired capabilities.

      +
    4. +
    5. Increase k by 1.
    6. +
    +
  16. +
  17. Let unmet capabilities be equal to an empty JSON List.

  18. +
  19. +

    Let unprocessed capabilities be a JSON List that contains required + capabilities if defined and desired capabilities if defined.

    +
  20. +
  21. +

    Let j be 0

    +
  22. +
  23. +

    Let capabilties length be the length of unprocessed capabilities.

    +
  24. +
  25. +

    While j < capabilities length: +

      +
    1. +

      + Let caps be the entry at index j in unprocessed + capabilities. +

      +
    2. +
    3. +

      Let browser name be the result of getting a property + named "browserName" from caps. If browser name + is undefined move to the next step. If caps equals required + capabilities do the following:

      +
        +
      1. +

        + If browser name is defined + and is not equal to "browserName" from server capabilities append a string + containing the differences between browser name and "browserName" + in server capabilities. +

        +
      2. +
      +
    4. +
    5. +

      Let browser version be the result of getting a property + named "browserVersion" from caps. If browser name + is undefined move to the next step. + If caps equals required capabilities do the following:

      +
        +
      1. +

        If browser name is defined + and is not equal to "browserVersion" from server capabilities append a string + containing the differences between browser version and "browserVersion" + in server capabilities. +

        +
      2. +
      +
    6. +
    7. +

      Let platform name be the result of getting a property + named "platformName" from caps. If platform name + is undefined move to the next step. + If caps equals required capabilities do the following:

      +
        +
      1. +

        If platform name is defined + and is not equal to "platformName" from server capabilities append a string + containing the differences between browser name and "platformName" + in server capabilities. +

        +
      2. +
      +
    8. +
    9. +

      Let platform version be the result of getting a property + named "platformVersion" from caps. If platform version + is undefined move to the next step. + If caps equals required capabilities do the following:

      +
        +
      1. +

        If platform version is defined + and is not equal to "platformVersion" from server capabilities append a string + containing the differences between platform version and "platformVersion" + in server capabilities. +

        +
      2. +
      +
    10. +
    11. +

      Let proxy be the result of getting a property + named "proxy" from caps. If proxy + is undefined move to the next step. If proxy is defined and not a map + append a string saying that a map is required else call setup proxy + passing in proxy. + If caps equals required capabilities do the following:

      +
        +
      1. +

        If any errors are returned from setup proxy + append to unmet capabilities else set the entry "proxy" in server + capabilities to the value in proxy. +

        +
      2. +
      +
    12. +
    13. +

      Let page load strategy be the result of getting a property + named "pageLoadStrategy" from caps. If page load strategy + is undefined then set the entry "pageLoadStrategy" in server capabilities to normal. + If caps equals required capabilities do the following:

      +
        +
      1. +

        If page load strategy is defined and not equal to normal, eager and none + then append a string saying that it contains an invalid value else set the entry + "pageLoadStrategy" in server capabilities to the value in page load + strategy. +

        +
      2. +
      +

      + If caps equals desired capabilities: +

      +
        +
      1. +

        + If page load strategy is defined and not equal to normal, eager and none + then set the entry "pageLoadStrategy" in server capabilities to normal.. +

        +
      2. +
      +
    14. +
    +

    +
  26. +
  27. +

    If the length of unmet capabilities is not equal to 0 return + session not created with data unmet capabilities.

    +
  28. +
  29. Return server capabilities

  30. +
+

+
+

Sessions

From 291d3a641d17b65c0a8c395dd0184e4f8de1431a Mon Sep 17 00:00:00 2001 From: AutomatedTester Date: Fri, 1 May 2015 01:02:22 +0100 Subject: [PATCH 2/3] update from notes --- 03_capabilities.html | 21 ++++++++++----------- webdriver-spec.html | 21 ++++++++++----------- 2 files changed, 20 insertions(+), 22 deletions(-) diff --git a/03_capabilities.html b/03_capabilities.html index bd82e4b3b..6a8828381 100644 --- a/03_capabilities.html +++ b/03_capabilities.html @@ -1,30 +1,29 @@

Capabilities

- Webdriver capabilities allow the local end to specify what + WebDriver capabilities allow the local end to specify what features it requires the remote end to fulfil to be able to create a new session

Processing Capabilities

-

The remote end steps to process capabilities are:

+

When asked to process capabilities with argument parameters a + remote end must run the following steps:

  1. Let server capabilities be a JSON Object with the following entries:

    1. -
    2. Let "browserName" be an entry with value equal to the lowercase name of the user agent

    3. -
    4. Let "browserVersion" be an entry with the value equal to the version of the user agent

    5. -
    6. Let "platformName" be an entry with the value equal to the lowercase name of the platform.

    7. -
    8. Let "platformVersion" be an entry with the value equal to the version of the platform

    9. -
    10. Let "acceptSslCerts" be an entry with the value equal to true if it can handle +

    11. browserName: the lowercase name of the user agent

    12. +
    13. browserVersion: the version of the user agent

    14. +
    15. platformName: the lowercase name of the platform.

    16. +
    17. platformVersion: the version of the platform

    18. +
    19. acceptSslCerts: be true if it can handle Invalid SSL Certifications else let it be equal to false.

    20. -
    21. Let "takesScreenshot" be an entry with the value equal to true if it can capture +

    22. takesScreenshot: be true if it can capture a screenshot of the viewport described in Take Screenshot.

    23. -
    24. Let "takesElementScreenshot" be an entry with the value equal to true if it can capture +

    25. takesElementScreenshot: be true if it can capture a screenshot of an element as described in Take Screenshot.

    -
  2. Let capabilities be the result of getting a property - named "capabilities" from the parameters argument.

  3. let required capabilities be the result of getting a property name "required capabilities" from capabilities.

  4. let desired capabilities be the result of getting a property diff --git a/webdriver-spec.html b/webdriver-spec.html index 189703221..09c853035 100644 --- a/webdriver-spec.html +++ b/webdriver-spec.html @@ -749,30 +749,29 @@

    Handling of Status Codes at the Local End

    Capabilities

    - Webdriver capabilities allow the local end to specify what + WebDriver capabilities allow the local end to specify what features it requires the remote end to fulfil to be able to create a new session

    Processing Capabilities

    -

    The remote end steps to process capabilities are:

    +

    When asked to process capabilities with argument parameters a + remote end must run the following steps:

    1. Let server capabilities be a JSON Object with the following entries:

      1. -
      2. Let "browserName" be an entry with value equal to the lowercase name of the user agent

      3. -
      4. Let "browserVersion" be an entry with the value equal to the version of the user agent

      5. -
      6. Let "platformName" be an entry with the value equal to the lowercase name of the platform.

      7. -
      8. Let "platformVersion" be an entry with the value equal to the version of the platform

      9. -
      10. Let "acceptSslCerts" be an entry with the value equal to true if it can handle +

      11. browserName: the lowercase name of the user agent

      12. +
      13. browserVersion: the version of the user agent

      14. +
      15. platformName: the lowercase name of the platform.

      16. +
      17. platformVersion: the version of the platform

      18. +
      19. acceptSslCerts: be true if it can handle Invalid SSL Certifications else let it be equal to false.

      20. -
      21. Let "takesScreenshot" be an entry with the value equal to true if it can capture +

      22. takesScreenshot: be true if it can capture a screenshot of the viewport described in Take Screenshot.

      23. -
      24. Let "takesElementScreenshot" be an entry with the value equal to true if it can capture +

      25. takesElementScreenshot: be true if it can capture a screenshot of an element as described in Take Screenshot.

      -
    2. Let capabilities be the result of getting a property - named "capabilities" from the parameters argument.

    3. let required capabilities be the result of getting a property name "required capabilities" from capabilities.

    4. let desired capabilities be the result of getting a property From e547c823b3987f6fe29a48c15d8edd7cc95940f0 Mon Sep 17 00:00:00 2001 From: AutomatedTester Date: Fri, 8 May 2015 00:06:32 +0100 Subject: [PATCH 3/3] cp --- 03_capabilities.html | 24 ++++++++++++------------ 04_sessions.html | 13 ------------- webdriver-spec.html | 37 ++++++++++++------------------------- 3 files changed, 24 insertions(+), 50 deletions(-) diff --git a/03_capabilities.html b/03_capabilities.html index 6a8828381..f4d6c9a61 100644 --- a/03_capabilities.html +++ b/03_capabilities.html @@ -7,7 +7,7 @@

      Capabilities

      Processing Capabilities

      -

      When asked to process capabilities with argument parameters a +

      When processng capabilities with argument parameters a remote end must run the following steps:

      1. Let server capabilities be a JSON Object with the following entries:

      2. @@ -16,7 +16,7 @@

        Processing Capabilities

      3. browserVersion: the version of the user agent

      4. platformName: the lowercase name of the platform.

      5. platformVersion: the version of the platform

      6. -
      7. acceptSslCerts: be true if it can handle +

      8. acceptSslCerts: be true if the User Agent can handle Invalid SSL Certifications else let it be equal to false.

      9. takesScreenshot: be true if it can capture @@ -25,9 +25,9 @@

        Processing Capabilities

        a screenshot of an element as described in Take Screenshot.

    5. let required capabilities be the result of getting a property - name "required capabilities" from capabilities.

    6. + name required capabilities from capabilities.

    7. let desired capabilities be the result of getting a property - name "desired capabilities" from capabilities.

    8. + name desired capabilities from capabilities.

    9. If required capabilities is undefined and desired capabilities is undefined, go to the last step of this algorithm.

    10. Let length be the length of required capabilities @@ -58,14 +58,14 @@

      Processing Capabilities

      1. - Let caps be the entry at index j in unprocessed + Let unprocessed capability be the entry at index j in unprocessed capabilities.

      2. Let browser name be the result of getting a property named "browserName" from caps. If browser name - is undefined move to the next step. If caps equals required + is undefined move to the next step. If unprocessed capability equals required capabilities do the following:

        1. @@ -82,7 +82,7 @@

          Processing Capabilities

          Let browser version be the result of getting a property named "browserVersion" from caps. If browser name is undefined move to the next step. - If caps equals required capabilities do the following:

          + If unprocessed capability equals required capabilities do the following:

          1. If browser name is defined @@ -97,7 +97,7 @@

            Processing Capabilities

            Let platform name be the result of getting a property named "platformName" from caps. If platform name is undefined move to the next step. - If caps equals required capabilities do the following:

            + If unprocessed capability equals required capabilities do the following:

            1. If platform name is defined @@ -112,7 +112,7 @@

              Processing Capabilities

              Let platform version be the result of getting a property named "platformVersion" from caps. If platform version is undefined move to the next step. - If caps equals required capabilities do the following:

              + If unprocessed capability equals required capabilities do the following:

              1. If platform version is defined @@ -129,7 +129,7 @@

                Processing Capabilities

                is undefined move to the next step. If proxy is defined and not a map append a string saying that a map is required else call setup proxy passing in proxy. - If caps equals required capabilities do the following:

                + If unprocessed capability equals required capabilities do the following:

                1. If any errors are returned from setup proxy @@ -143,7 +143,7 @@

                  Processing Capabilities

                  Let page load strategy be the result of getting a property named "pageLoadStrategy" from caps. If page load strategy is undefined then set the entry "pageLoadStrategy" in server capabilities to normal. - If caps equals required capabilities do the following:

                  + If unprocessed capability equals required capabilities do the following:

                  1. If page load strategy is defined and not equal to normal, eager and none @@ -154,7 +154,7 @@

                    Processing Capabilities

                  - If caps equals desired capabilities: + If unprocessed capability equals desired capabilities:

                  1. diff --git a/04_sessions.html b/04_sessions.html index d7eab5631..b8186c89a 100644 --- a/04_sessions.html +++ b/04_sessions.html @@ -197,19 +197,6 @@

                    New Session

    -
    -

    Remote End Matching of Capabilities

    -

    This section is non-normative.

    -

    The suggested order for comparing keys in the Capabilities instance when creating a session is:

    -
      -
    1. browserName
    2. -
    3. browserVersion
    4. -
    5. platformName
    6. -
    7. platformVersion
    8. -
    -

    For all comparisons, if the key is missing (as determined by a call to Capability.has() returning "false"), that particular criteria shall not factor into the - comparison.

    -

    Removing a Session

    diff --git a/webdriver-spec.html b/webdriver-spec.html index 09c853035..f12f2aac1 100644 --- a/webdriver-spec.html +++ b/webdriver-spec.html @@ -755,7 +755,7 @@

    Capabilities

    Processing Capabilities

    -

    When asked to process capabilities with argument parameters a +

    When processng capabilities with argument parameters a remote end must run the following steps:

    1. Let server capabilities be a JSON Object with the following entries:

    2. @@ -764,7 +764,7 @@

      Processing Capabilities

    3. browserVersion: the version of the user agent

    4. platformName: the lowercase name of the platform.

    5. platformVersion: the version of the platform

    6. -
    7. acceptSslCerts: be true if it can handle +

    8. acceptSslCerts: be true if the User Agent can handle Invalid SSL Certifications else let it be equal to false.

    9. takesScreenshot: be true if it can capture @@ -773,9 +773,9 @@

      Processing Capabilities

      a screenshot of an element as described in Take Screenshot.

  5. let required capabilities be the result of getting a property - name "required capabilities" from capabilities.

  6. + name required capabilities from capabilities.

  7. let desired capabilities be the result of getting a property - name "desired capabilities" from capabilities.

  8. + name desired capabilities from capabilities.

  9. If required capabilities is undefined and desired capabilities is undefined, go to the last step of this algorithm.

  10. Let length be the length of required capabilities @@ -806,14 +806,14 @@

    Processing Capabilities

    1. - Let caps be the entry at index j in unprocessed + Let unprocessed capability be the entry at index j in unprocessed capabilities.

    2. Let browser name be the result of getting a property named "browserName" from caps. If browser name - is undefined move to the next step. If caps equals required + is undefined move to the next step. If unprocessed capability equals required capabilities do the following:

      1. @@ -830,7 +830,7 @@

        Processing Capabilities

        Let browser version be the result of getting a property named "browserVersion" from caps. If browser name is undefined move to the next step. - If caps equals required capabilities do the following:

        + If unprocessed capability equals required capabilities do the following:

        1. If browser name is defined @@ -845,7 +845,7 @@

          Processing Capabilities

          Let platform name be the result of getting a property named "platformName" from caps. If platform name is undefined move to the next step. - If caps equals required capabilities do the following:

          + If unprocessed capability equals required capabilities do the following:

          1. If platform name is defined @@ -860,7 +860,7 @@

            Processing Capabilities

            Let platform version be the result of getting a property named "platformVersion" from caps. If platform version is undefined move to the next step. - If caps equals required capabilities do the following:

            + If unprocessed capability equals required capabilities do the following:

            1. If platform version is defined @@ -877,7 +877,7 @@

              Processing Capabilities

              is undefined move to the next step. If proxy is defined and not a map append a string saying that a map is required else call setup proxy passing in proxy. - If caps equals required capabilities do the following:

              + If unprocessed capability equals required capabilities do the following:

              1. If any errors are returned from setup proxy @@ -891,7 +891,7 @@

                Processing Capabilities

                Let page load strategy be the result of getting a property named "pageLoadStrategy" from caps. If page load strategy is undefined then set the entry "pageLoadStrategy" in server capabilities to normal. - If caps equals required capabilities do the following:

                + If unprocessed capability equals required capabilities do the following:

                1. If page load strategy is defined and not equal to normal, eager and none @@ -902,7 +902,7 @@

                  Processing Capabilities

                - If caps equals desired capabilities: + If unprocessed capability equals desired capabilities:

                1. @@ -1123,19 +1123,6 @@

                  New Session

                -
                -

                Remote End Matching of Capabilities

                -

                This section is non-normative.

                -

                The suggested order for comparing keys in the Capabilities instance when creating a session is:

                -
                  -
                1. browserName
                2. -
                3. browserVersion
                4. -
                5. platformName
                6. -
                7. platformVersion
                8. -
                -

                For all comparisons, if the key is missing (as determined by a call to Capability.has() returning "false"), that particular criteria shall not factor into the - comparison.

                -

                Removing a Session