"Fossies" - the Fresh Open Source Software Archive

Member "selenium-selenium-4.8.1/dotnet/src/webdriver/DriverCommand.cs" (17 Feb 2023, 15115 Bytes) of package /linux/www/selenium-selenium-4.8.1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C# source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "DriverCommand.cs" see the Fossies "Dox" file reference documentation.

    1 // <copyright file="DriverCommand.cs" company="WebDriver Committers">
    2 // Licensed to the Software Freedom Conservancy (SFC) under one
    3 // or more contributor license agreements. See the NOTICE file
    4 // distributed with this work for additional information
    5 // regarding copyright ownership. The SFC licenses this file
    6 // to you under the Apache License = string.Empty; Version 2.0 (the "License");
    7 // you may not use this file except in compliance with the License.
    8 // You may obtain a copy of the License at
    9 //
   10 //     http://www.apache.org/licenses/LICENSE-2.0
   11 //
   12 // Unless required by applicable law or agreed to in writing = string.Empty; software
   13 // distributed under the License is distributed on an "AS IS" BASIS = string.Empty;
   14 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND = string.Empty; either express or implied.
   15 // See the License for the specific language governing permissions and
   16 // limitations under the License.
   17 // </copyright>
   18 
   19 using System;
   20 using System.Collections.Generic;
   21 
   22 namespace OpenQA.Selenium
   23 {
   24     /// <summary>
   25     /// Values describing the list of commands understood by a remote server using the JSON wire protocol.
   26     /// </summary>
   27     public static class DriverCommand
   28     {
   29         /// <summary>
   30         /// Represents the Status command.
   31         /// </summary>
   32         public static readonly string Status = "status";
   33 
   34         /// <summary>
   35         /// Represents a New Session command
   36         /// </summary>
   37         public static readonly string NewSession = "newSession";
   38 
   39         /// <summary>
   40         /// Represents a Browser close command
   41         /// </summary>
   42         public static readonly string Close = "close";
   43 
   44         /// <summary>
   45         /// Represents a browser quit command
   46         /// </summary>
   47         public static readonly string Quit = "quit";
   48 
   49         /// <summary>
   50         /// Represents a GET command
   51         /// </summary>
   52         public static readonly string Get = "get";
   53 
   54         /// <summary>
   55         /// Represents a Browser going back command
   56         /// </summary>
   57         public static readonly string GoBack = "goBack";
   58 
   59         /// <summary>
   60         /// Represents a Browser going forward command
   61         /// </summary>
   62         public static readonly string GoForward = "goForward";
   63 
   64         /// <summary>
   65         /// Represents a Browser refreshing command
   66         /// </summary>
   67         public static readonly string Refresh = "refresh";
   68 
   69         /// <summary>
   70         /// Represents adding a cookie command
   71         /// </summary>
   72         public static readonly string AddCookie = "addCookie";
   73 
   74         /// <summary>
   75         /// Represents getting all cookies command
   76         /// </summary>
   77         public static readonly string GetAllCookies = "getCookies";
   78 
   79         /// <summary>
   80         /// Represents getting cookie command
   81         /// </summary>
   82         public static readonly string GetCookie = "getCookie";
   83 
   84         /// <summary>
   85         /// Represents deleting a cookie command
   86         /// </summary>
   87         public static readonly string DeleteCookie = "deleteCookie";
   88 
   89         /// <summary>
   90         /// Represents Deleting all cookies command
   91         /// </summary>
   92         public static readonly string DeleteAllCookies = "deleteAllCookies";
   93 
   94         /// <summary>
   95         /// Represents FindElement command
   96         /// </summary>
   97         public static readonly string FindElement = "findElement";
   98 
   99         /// <summary>
  100         /// Represents FindElements command
  101         /// </summary>
  102         public static readonly string FindElements = "findElements";
  103 
  104         /// <summary>
  105         /// Represents FindChildElement command
  106         /// </summary>
  107         public static readonly string FindChildElement = "findChildElement";
  108 
  109         /// <summary>
  110         /// Represents FindChildElements command
  111         /// </summary>
  112         public static readonly string FindChildElements = "findChildElements";
  113 
  114         /// <summary>
  115         /// Represents FindShadowChildElement command
  116         /// </summary>
  117         public static readonly string FindShadowChildElement = "findShadowChildElement";
  118 
  119         /// <summary>
  120         /// Represents FindShadosChildElements command
  121         /// </summary>
  122         public static readonly string FindShadowChildElements = "findShadowChildElements";
  123 
  124         /// <summary>
  125         /// Describes an element
  126         /// </summary>
  127         //public static readonly string DescribeElement = "describeElement";
  128 
  129         /// <summary>
  130         /// Represents ClearElement command
  131         /// </summary>
  132         public static readonly string ClearElement = "clearElement";
  133 
  134         /// <summary>
  135         /// Represents ClickElement command
  136         /// </summary>
  137         public static readonly string ClickElement = "clickElement";
  138 
  139         /// <summary>
  140         /// Represents SendKeysToElements command
  141         /// </summary>
  142         public static readonly string SendKeysToElement = "sendKeysToElement";
  143 
  144         /// <summary>
  145         /// Represents GetCurrentWindowHandle command
  146         /// </summary>
  147         public static readonly string GetCurrentWindowHandle = "getCurrentWindowHandle";
  148 
  149         /// <summary>
  150         /// Represents GetWindowHandles command
  151         /// </summary>
  152         public static readonly string GetWindowHandles = "getWindowHandles";
  153 
  154         /// <summary>
  155         /// Represents SwitchToWindow command
  156         /// </summary>
  157         public static readonly string SwitchToWindow = "switchToWindow";
  158 
  159         /// <summary>
  160         /// Represents NewWindow command
  161         /// </summary>
  162         public static readonly string NewWindow = "newWindow";
  163 
  164         /// <summary>
  165         /// Represents SwitchToFrame command
  166         /// </summary>
  167         public static readonly string SwitchToFrame = "switchToFrame";
  168 
  169         /// <summary>
  170         /// Represents SwitchToParentFrame command
  171         /// </summary>
  172         public static readonly string SwitchToParentFrame = "switchToParentFrame";
  173 
  174         /// <summary>
  175         /// Represents GetActiveElement command
  176         /// </summary>
  177         public static readonly string GetActiveElement = "getActiveElement";
  178 
  179         /// <summary>
  180         /// Represents GetCurrentUrl command
  181         /// </summary>
  182         public static readonly string GetCurrentUrl = "getCurrentUrl";
  183 
  184         /// <summary>
  185         /// Represents GetPageSource command
  186         /// </summary>
  187         public static readonly string GetPageSource = "getPageSource";
  188 
  189         /// <summary>
  190         /// Represents GetTitle command
  191         /// </summary>
  192         public static readonly string GetTitle = "getTitle";
  193 
  194         /// <summary>
  195         /// Represents ExecuteScript command
  196         /// </summary>
  197         public static readonly string ExecuteScript = "executeScript";
  198 
  199         /// <summary>
  200         /// Represents ExecuteAsyncScript command
  201         /// </summary>
  202         public static readonly string ExecuteAsyncScript = "executeAsyncScript";
  203 
  204         /// <summary>
  205         /// Represents GetElementText command
  206         /// </summary>
  207         public static readonly string GetElementText = "getElementText";
  208 
  209         /// <summary>
  210         /// Represents GetElementTagName command
  211         /// </summary>
  212         public static readonly string GetElementTagName = "getElementTagName";
  213 
  214         /// <summary>
  215         /// Represents IsElementSelected command
  216         /// </summary>
  217         public static readonly string IsElementSelected = "isElementSelected";
  218 
  219         /// <summary>
  220         /// Represents IsElementEnabled command
  221         /// </summary>
  222         public static readonly string IsElementEnabled = "isElementEnabled";
  223 
  224         /// <summary>
  225         /// Represents IsElementDisplayed command
  226         /// </summary>
  227         public static readonly string IsElementDisplayed = "isElementDisplayed";
  228 
  229         /// <summary>
  230         /// Represents GetElementRect command
  231         /// </summary>
  232         public static readonly string GetElementRect = "getElementRect";
  233 
  234         /// <summary>
  235         /// Represents GetElementAttribute command
  236         /// </summary>
  237         public static readonly string GetElementAttribute = "getElementAttribute";
  238 
  239         /// <summary>
  240         /// Represents GetElementProperty command
  241         /// </summary>
  242         public static readonly string GetElementProperty = "getElementProperty";
  243 
  244         /// <summary>
  245         /// Represents GetElementValueOfCSSProperty command
  246         /// </summary>
  247         public static readonly string GetElementValueOfCssProperty = "getElementValueOfCssProperty";
  248 
  249         /// <summary>
  250         /// Represents GetComputedAccessibleLabel command
  251         /// </summary>
  252         public static readonly string GetComputedAccessibleLabel = "getComputedAccessibleLabel";
  253 
  254         /// <summary>
  255         /// Represents GetComputedAccessibleRole command
  256         /// </summary>
  257         public static readonly string GetComputedAccessibleRole = "getComputedAccessibleRole";
  258 
  259         /// <summary>
  260         /// Represents the GetElementShadowRoot command.
  261         /// </summary>
  262         public static readonly string GetElementShadowRoot = "getElementShadowRoot";
  263 
  264         /// <summary>
  265         /// Represents ElementEquals command
  266         /// </summary>
  267         public static readonly string ElementEquals = "elementEquals";
  268 
  269         /// <summary>
  270         /// Represents Screenshot command
  271         /// </summary>
  272         public static readonly string Screenshot = "screenshot";
  273 
  274         /// <summary>
  275         /// Represents the ElementScreenshot command
  276         /// </summary>
  277         public static readonly string ElementScreenshot = "elementScreenshot";
  278 
  279         /// <summary>
  280         /// Represents the Print command
  281         /// </summary>
  282         public static readonly string Print = "print";
  283 
  284         /// <summary>
  285         /// Represents GetWindowRect command
  286         /// </summary>
  287         public static readonly string GetWindowRect = "getWindowRect";
  288 
  289         /// <summary>
  290         /// Represents SetWindowRect command
  291         /// </summary>
  292         public static readonly string SetWindowRect = "setWindowRect";
  293 
  294         /// <summary>
  295         /// Represents MaximizeWindow command
  296         /// </summary>
  297         public static readonly string MaximizeWindow = "maximizeWindow";
  298 
  299         /// <summary>
  300         /// Represents MinimizeWindow command
  301         /// </summary>
  302         public static readonly string MinimizeWindow = "minimizeWindow";
  303 
  304         /// <summary>
  305         /// Represents FullScreenWindow command
  306         /// </summary>
  307         public static readonly string FullScreenWindow = "fullScreenWindow";
  308 
  309         /// <summary>
  310         /// Represents the DismissAlert command
  311         /// </summary>
  312         public static readonly string DismissAlert = "dismissAlert";
  313 
  314         /// <summary>
  315         /// Represents the AcceptAlert command
  316         /// </summary>
  317         public static readonly string AcceptAlert = "acceptAlert";
  318 
  319         /// <summary>
  320         /// Represents the GetAlertText command
  321         /// </summary>
  322         public static readonly string GetAlertText = "getAlertText";
  323 
  324         /// <summary>
  325         /// Represents the SetAlertValue command
  326         /// </summary>
  327         public static readonly string SetAlertValue = "setAlertValue";
  328 
  329         /// <summary>
  330         /// Represents the SetTimeout command
  331         /// </summary>
  332         public static readonly string SetTimeouts = "setTimeouts";
  333 
  334         /// <summary>
  335         /// Represents the SetTimeout command
  336         /// </summary>
  337         public static readonly string GetTimeouts = "getTimeouts";
  338 
  339         /// <summary>
  340         /// Represents the Actions command.
  341         /// </summary>
  342         public static readonly string Actions = "actions";
  343 
  344         /// <summary>
  345         /// Represents the CancelActions command.
  346         /// </summary>
  347         public static readonly string CancelActions = "cancelActions";
  348 
  349         /// <summary>
  350         /// Represents the UploadFile command.
  351         /// </summary>
  352         public static readonly string UploadFile = "uploadFile";
  353 
  354         /// <summary>
  355         /// Represents the GetAvailableLogTypes command.
  356         /// </summary>
  357         public static readonly string GetAvailableLogTypes = "getAvailableLogTypes";
  358 
  359         /// <summary>
  360         /// Represents the GetLog command.
  361         /// </summary>
  362         public static readonly string GetLog = "getLog";
  363 
  364         // Virtual Authenticator API
  365         // http://w3c.github.io/webauthn#sctn-automation
  366         public static readonly string AddVirtualAuthenticator = "addVirtualAuthenticator";
  367         public static readonly string RemoveVirtualAuthenticator = "removeVirtualAuthenticator";
  368         public static readonly string AddCredential = "addCredential";
  369         public static readonly string GetCredentials = "getCredentials";
  370         public static readonly string RemoveCredential = "removeCredential";
  371         public static readonly string RemoveAllCredentials = "removeAllCredentials";
  372         public static readonly string SetUserVerified = "setUserVerified";
  373 
  374         public static readonly IList<string> KnownCommands = new List<string>()
  375         {
  376             Status,
  377             NewSession,
  378             Quit,
  379             GetTimeouts,
  380             SetTimeouts,
  381             Get,
  382             GetCurrentUrl,
  383             GoBack,
  384             GoForward,
  385             Refresh,
  386             GetTitle,
  387             GetCurrentWindowHandle,
  388             Close,
  389             SwitchToWindow,
  390             GetWindowHandles,
  391             SwitchToFrame,
  392             SwitchToParentFrame,
  393             GetWindowRect,
  394             SetWindowRect,
  395             MaximizeWindow,
  396             MinimizeWindow,
  397             FullScreenWindow,
  398             FindElement,
  399             FindElements,
  400             FindChildElement,
  401             FindChildElements,
  402             FindShadowChildElement,
  403             FindShadowChildElements,
  404             GetActiveElement,
  405             GetElementShadowRoot,
  406             IsElementSelected,
  407             GetElementAttribute,
  408             GetElementProperty,
  409             GetElementValueOfCssProperty,
  410             GetElementText,
  411             GetElementTagName,
  412             GetElementRect,
  413             IsElementEnabled,
  414             GetComputedAccessibleRole,
  415             GetComputedAccessibleLabel,
  416             ClickElement,
  417             ClearElement,
  418             SendKeysToElement,
  419             GetPageSource,
  420             ExecuteScript,
  421             ExecuteAsyncScript,
  422             GetAllCookies,
  423             GetCookie,
  424             AddCookie,
  425             DeleteCookie,
  426             DeleteAllCookies,
  427             Actions,
  428             CancelActions,
  429             AcceptAlert,
  430             DismissAlert,
  431             GetAlertText,
  432             SetAlertValue,
  433             Screenshot,
  434             ElementScreenshot,
  435             Print,
  436             IsElementDisplayed,
  437             UploadFile,
  438             GetLog,
  439             GetAvailableLogTypes,
  440             AddVirtualAuthenticator,
  441             RemoveVirtualAuthenticator,
  442             AddCredential,
  443             GetCredentials,
  444             RemoveCredential,
  445             RemoveAllCredentials,
  446             SetUserVerified
  447         }.AsReadOnly();
  448     }
  449 }