Skip to content

Commit

Permalink
Feat: improving doc for switch_window keyword
Browse files Browse the repository at this point in the history
  • Loading branch information
aaltat committed Jun 20, 2024
1 parent 8014b88 commit fdbfef6
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -906,7 +906,7 @@
},
"switch_window": {
"name": "vaihda_ikkuna",
"doc": "Switches to browser window matching ``locator``.\n\n If the window is found, all subsequent commands use the selected\n window, until this keyword is used again. If the window is not\n found, this keyword fails. The previous windows handle is returned\n and can be used to switch back to it later.\n\n Notice that alerts should be handled with\n `Handle Alert` or other alert related keywords.\n\n The ``locator`` can be specified using different strategies somewhat\n similarly as when `locating elements` on pages.\n\n - By default, the ``locator`` is matched against window handle, name,\n title, and URL. Matching is done in that order and the first\n matching window is selected.\n\n - The ``locator`` can specify an explicit strategy by using the format\n ``strategy:value`` (recommended) or ``strategy=value``. Supported\n strategies are ``name``, ``title``, and ``url``. These matches windows\n using their name, title, or URL, respectively. Additionally, ``default``\n can be used to explicitly use the default strategy explained above.\n\n - If the ``locator`` is ``NEW`` (case-insensitive), the latest\n opened window is selected. It is an error if this is the same\n as the current window.\n\n - If the ``locator`` is ``MAIN`` (default, case-insensitive),\n the main window is selected.\n\n - If the ``locator`` is ``CURRENT`` (case-insensitive), nothing is\n done. This effectively just returns the current window handle.\n\n - If the ``locator`` is not a string, it is expected to be a list\n of window handles _to exclude_. Such a list of excluded windows\n can be got from `Get Window Handles` before doing an action that\n opens a new window.\n\n The ``timeout`` is used to specify how long keyword will poll to select\n the new window. The ``timeout`` is new in SeleniumLibrary 3.2.\n\n Example:\n | `Click Link` | popup1 | | # Open new window |\n | `Switch Window` | example | | # Select window using default strategy |\n | `Title Should Be` | Pop-up 1 | |\n | `Click Button` | popup2 | | # Open another window |\n | ${handle} = | `Switch Window` | NEW | # Select latest opened window |\n | `Title Should Be` | Pop-up 2 | |\n | `Switch Window` | ${handle} | | # Select window using handle |\n | `Title Should Be` | Pop-up 1 | |\n | `Switch Window` | MAIN | | # Select the main window |\n | `Title Should Be` | Main | |\n | ${excludes} = | `Get Window Handles` | | # Get list of current windows |\n | `Click Link` | popup3 | | # Open one more window |\n | `Switch Window` | ${excludes} | | # Select window using excludes |\n | `Title Should Be` | Pop-up 3 | |\n\n The ``browser`` argument allows with ``index_or_alias`` to implicitly switch to\n a specific browser when switching to a window. See `Switch Browser`\n\n - If the ``browser`` is ``CURRENT`` (case-insensitive), no other browser is\n selected.\n\n *NOTE:*\n\n - The ``strategy:value`` syntax is only supported by SeleniumLibrary\n 3.0 and newer.\n - Prior to SeleniumLibrary 3.0 matching windows by name, title\n and URL was case-insensitive.\n - Earlier versions supported aliases ``None``, ``null`` and the\n empty string for selecting the main window, and alias ``self``\n for selecting the current window. Support for these aliases was\n removed in SeleniumLibrary 3.2.\n ",
"doc": "Vaihtaa selenium ikkunan joka vasataa``locator``.\n\n If the window is found, all subsequent commands use the selected\n window, until this keyword is used again. If the window is not\n found, this keyword fails. The previous windows handle is returned\n and can be used to switch back to it later.\n\n Notice that alerts should be handled with\n `Handle Alert` or other alert related keywords.\n\n The ``locator`` can be specified using different strategies somewhat\n similarly as when `locating elements` on pages.\n\n - By default, the ``locator`` is matched against window handle, name,\n title, and URL. Matching is done in that order and the first\n matching window is selected.\n\n - The ``locator`` can specify an explicit strategy by using the format\n ``strategy:value`` (recommended) or ``strategy=value``. Supported\n strategies are ``name``, ``title``, and ``url``. These matches windows\n using their name, title, or URL, respectively. Additionally, ``default``\n can be used to explicitly use the default strategy explained above.\n\n - If the ``locator`` is ``NEW`` (case-insensitive), the latest\n opened window is selected. It is an error if this is the same\n as the current window.\n\n - If the ``locator`` is ``MAIN`` (default, case-insensitive),\n the main window is selected.\n\n - If the ``locator`` is ``CURRENT`` (case-insensitive), nothing is\n done. This effectively just returns the current window handle.\n\n - If the ``locator`` is not a string, it is expected to be a list\n of window handles _to exclude_. Such a list of excluded windows\n can be got from `Get Window Handles` before doing an action that\n opens a new window.\n\n The ``timeout`` is used to specify how long keyword will poll to select\n the new window. The ``timeout`` is new in SeleniumLibrary 3.2.\n\n Example:\n | `Click Link` | popup1 | | # Open new window |\n | `Switch Window` | example | | # Select window using default strategy |\n | `Title Should Be` | Pop-up 1 | |\n | `Click Button` | popup2 | | # Open another window |\n | ${handle} = | `Switch Window` | NEW | # Select latest opened window |\n | `Title Should Be` | Pop-up 2 | |\n | `Switch Window` | ${handle} | | # Select window using handle |\n | `Title Should Be` | Pop-up 1 | |\n | `Switch Window` | MAIN | | # Select the main window |\n | `Title Should Be` | Main | |\n | ${excludes} = | `Get Window Handles` | | # Get list of current windows |\n | `Click Link` | popup3 | | # Open one more window |\n | `Switch Window` | ${excludes} | | # Select window using excludes |\n | `Title Should Be` | Pop-up 3 | |\n\n The ``browser`` argument allows with ``index_or_alias`` to implicitly switch to\n a specific browser when switching to a window. See `Switch Browser`\n\n - If the ``browser`` is ``CURRENT`` (case-insensitive), no other browser is\n selected.\n\n *NOTE:*\n\n - The ``strategy:value`` syntax is only supported by SeleniumLibrary\n 3.0 and newer.\n - Prior to SeleniumLibrary 3.0 matching windows by name, title\n and URL was case-insensitive.\n - Earlier versions supported aliases ``None``, ``null`` and the\n empty string for selecting the main window, and alias ``self``\n for selecting the current window. Support for these aliases was\n removed in SeleniumLibrary 3.2.\n ",
"sha256": "2ae583a5179810f31a4f7ae665918443d1f068c53e255c552b51bd1f5205c608"
},
"__init__": {
Expand Down

0 comments on commit fdbfef6

Please sign in to comment.