Class Input


  • public class Input
    extends java.lang.Object

    This class was built using the Chrome Remote Dev-Tools A.P.I., which is specified by two JSON-RPC Files. These files were obtained from the Chrome Dev Tools Protocol Git Hub Page, which has a "Tip of Tree" (the latest) API-Specification Page Here: JSON-RPC Protocol Specification.

    These files were converted into this Java-Browser (CDP) Library. The intention is to have them function in a similar fasion to the Node.js Tool known as 'Puppeteer', Microsoft's 'Playwright' and of course the Main-Stay 'Selenium.' The Java-HTML JAR Library merely implements the Java Types & Commands defined by Google's DevTools Protocol.

    🧠 View the Google CDP API:

    [No Description Provided by Google]

    The top-level description and explanation for this class (this comment, at the top this Java-Doc Page) is repeated, verbatim, across all of the domain classes which comprise Google's CDP API.

    This class is intended to be used with a Browser Instance

    These methods have been tested, to some degree, using Google Chrome. In order to use this class you must start a web-browser instance and make a connection to the browser using a Remote Debugging Port. Google-Corporation is the developer of this API, but any browser which accepts a Remote Debug Port Connection over Web-Sockets.

    Google-Chrome was used during the development process of the classes in this particular package. Lately, it has been asserted Microsoft has switched to using the Chrome Browser-Engine for its Microsoft Edge Internal Code-Base. Therefore, there may some functionality available when running the methods in this class with Microsoft-Edge.

    Check whether the your Web-Browser will allow itself to be driven by the Web-Socket RDP-Port 9223. See the examples available in package Torello.Browser to undertand how to build a PageConn and BrowserConn Web-Socket Connection, and how to build a WebSocketSender instance in order to execute the methods in this class.


    Web-Socket & JSON API:   
    Every one of the methods that reside in this class are designed to do nothing more than:

    1. Accept Parameters from the User, and "Marshall Them" into a Valid JSON-Request
    2. Transmit the Marshalled Request-JSON to a Headless Web-Browser over a Web-Socket Connection
    3. Receive BOTH that Command-Results AND any Browser Event-Firings from the Web-Socket
    4. Parse JSON Method-Results and Browser-Event Firings, and Subsequently Convert them to Standard Java-Types
    5. Report these Method-Results and Browser-Events to the User via a User-Registered, Event-Listener (Events) or a Promise Object (Command Responses / Results)

    Unlike the bulk of the Java HTML JAR Library, there is very little native Java-Code, and very little testing that may be done on any of the classes & methods in this package. The code inside these classes does nothing more than marshall-and-unmarshall Java-Types into Json-Requests (and vice-versa). The Java-Script & Browser modules inside of a Google-Chrome instance are, theoretically, handling these requests, and returning their results (or events) over the Web-Socket Connection.

    It has been asserted (by Google Chrome Developers) that some of these methods are only "partially working" or "experimental".


    Asking Chat-GPT for Help:   
    The LLM otherwise known as "Chat-GPT" does, indeed, have an expert level of knowledge about the "Remote DevTools Protocol". The API that the Chrome DevTools Protocl (CDP) exports is extremely well understood by the LLM, and generally I have found that Chat-GPT understands (by 2 or 3 orders of magnitude) better what my Auto-Generated JSON-Wrappers can do in controlling a Web-Browser than I could ever possibly hope to understand.

    Though not available today, there will soon be an automatically downloadable Token-Stream (AI Embeddings) BUTTON available on my Java-Doc Pages that should hopefully make it extremely easy to post my code-base, RAG Style, to Chat-GPT and other LLM's when 'interogating' them. Presently, because my "Get Token Stream Button" does not exist yet on any of my pages, what you can do is copy-and-paste any Method-Signature from any one of these pages and then ask Chat-GPT to explain what that Browser or Java-Script Function is actually doing. It is very likely to give you some pretty neat answers.

    I have found that every single one of the Domains, Types & Events which are offered by the CDP Protocol (though not documented very well by Google), are perfectly understood by the A.I. LLM - literally to the point where it does know (much better than I ever could) what my own code base actually does!

    Try it out, it's a lot of fun. Note that this package and these classes were originally developed solely to be able to execute the Java-Script that a browser executes when visiting a Web-Site. Complete HTML-Page Content can be scraped (using the HTML Data-Scraping Tools in Java-HTML) off of Web-Sites that have dynamic / Java-Script Generated Content.


    Conspicuous Boxed-Types Usage:
    You may notice that there are many methods that have parameters which accept, for instance, an Integer, instead of a primitive int. Just to remind the readiner, in Java Programs a Boxed Type is a standard Java-Primitive which has been converted into an Object-Reference. The use of Boxed-Types in this code base is an easy-and-fast-way to allow for the concept of "Optional Parameters" or "Optional Field Value."

    Whenever you see a method that accepts an Integer, the reason for this Parameter-Type choice is actually to allow a user to pass 'null' to it. This is a simple way to ELIDE passing any value at all to parameters which Google-Chrome would otherwise assert are "Optional." Whenever you pass 'null' to a Boxed-Types in this class, the Json-Processor will simply eliminate that Object-Property from the command altogether; and the browser will simply not receive any value for that parameter when that command is invoked.

    The Java Language Specification does not have an easy or well defined means of accepting optional method parameters; so Boxed-Types and 'null' are utilized here. Note that 'null' may be passed to any Command Method-Parameter that is listed as Optional on the Java-Doc Page description for that parameter.



    Stateless Class:
    This class neither contains any program-state, nor can it be instantiated. The @StaticFunctional Annotation may also be called 'The Spaghetti Report'. Static-Functional classes are, essentially, C-Styled Files, without any constructors or non-static member fields. It is a concept very similar to the Java-Bean's @Stateless Annotation.

    • 1 Constructor(s), 1 declared private, zero-argument constructor
    • 21 Method(s), 21 declared static
    • 3 Field(s), 3 declared static, 3 declared final


    • Nested Class Summary

       
      Type Nested Classes: Types / Classes that Are Used & Exported by this Domain
      Modifier and Type Class Description
      static class  Input.DragData
      [No Description Provided by Google]
      static class  Input.DragDataItem
      [No Description Provided by Google]
      static class  Input.TouchPoint
      [No Description Provided by Google]
       
      Event Nested Classes: Browser Events, as Java Inner Classes, Which are Fired by this Domain
      Modifier and Type Class Description
      static class  Input.dragIntercepted
      Emitted only when Input.setInterceptDrags is enabled.
    • Field Summary

       
      Enumerated Strings: Like Java 'enum' Types, but Converted to Read-Only String-Lists
      Modifier and Type Field Description
      static ReadOnlyList<String> GestureSourceType
      [No Description Provided by Google]
      static ReadOnlyList<String> MouseButton
      [No Description Provided by Google]
       
      Eliminated Types: Removed CDP Types which Have Been Re-Mapped to Basic Java String Constants
      Modifier and Type Field Description
      static String TimeSinceEpoch
      UTC time in seconds, counted from January 1, 1970.
    • Method Summary

       
      Input Domain Commands
      Script Returns Modifier and Type Method
      Void static Script<> cancelDragging()
      Cancels any active dragging in the page.
      Void static Script<> dispatchDragEvent​(String type, Number x, Number y, Input.DragData data, Integer modifiers)
      Dispatches a drag event into the page.
      Void static Script<> dispatchKeyEvent​(String type, Integer modifiers, Number timestamp, String text, String unmodifiedText, String keyIdentifier, String code, String key, Integer windowsVirtualKeyCode, Integer nativeVirtualKeyCode, Boolean autoRepeat, Boolean isKeypad, Boolean isSystemKey, Integer location, String[] commands)
      Dispatches a key event to the page.
      Void static Script<> dispatchMouseEvent​(String type, Number x, Number y, Integer modifiers, Number timestamp, String button, Integer buttons, Integer clickCount, Number force, Number tangentialPressure, Number tiltX, Number tiltY, Integer twist, Number deltaX, Number deltaY, String pointerType)
      Dispatches a mouse event to the page.
      Void static Script<> dispatchTouchEvent​(String type, Input.TouchPoint[] touchPoints, Integer modifiers, Number timestamp)
      Dispatches a touch event to the page.
      Void static Script<> emulateTouchFromMouseEvent​(String type, int x, int y, String button, Number timestamp, Number deltaX, Number deltaY, Integer modifiers, Integer clickCount)
      Emulates touch event from the mouse event parameters.
      Void static Script<> imeSetComposition​(String text, int selectionStart, int selectionEnd, Integer replacementStart, Integer replacementEnd)
      This method sets the current candidate text for IME.
      Void static Script<> insertText​(String text)
      This method emulates inserting text that doesn't come from a key press, for example an emoji keyboard or an IME.
      Void static Script<> setIgnoreInputEvents​(boolean ignore)
      Ignores input events (useful while auditing page).
      Void static Script<> setInterceptDrags​(boolean enabled)
      Prevents default drag and drop behavior and instead emits Input.dragIntercepted events.
      Void static Script<> synthesizePinchGesture​(Number x, Number y, Number scaleFactor, Integer relativeSpeed, String gestureSourceType)
      Synthesizes a pinch gesture over a time period by issuing appropriate touch events.
      Void static Script<> synthesizeScrollGesture​(Number x, Number y, Number xDistance, Number yDistance, Number xOverscroll, Number yOverscroll, Boolean preventFling, Integer speed, String gestureSourceType, Integer repeatCount, Integer repeatDelayMs, String interactionMarkerName)
      Synthesizes a scroll gesture over a time period by issuing appropriate touch events.
      Void static Script<> synthesizeTapGesture​(Number x, Number y, Integer duration, Integer tapCount, String gestureSourceType)
      Synthesizes a tap gesture over a time period by issuing appropriate touch events.
       
      Input Domain CommandBuilder Methods
      Modifier and Type Method Description
      static CommandBuilder
      <Void>
      dispatchDragEvent()
      Creates a buider for conveniently assigning parameters to this method.
      static CommandBuilder
      <Void>
      dispatchKeyEvent()
      Creates a buider for conveniently assigning parameters to this method.
      static CommandBuilder
      <Void>
      dispatchMouseEvent()
      Creates a buider for conveniently assigning parameters to this method.
      static CommandBuilder
      <Void>
      emulateTouchFromMouseEvent()
      Creates a buider for conveniently assigning parameters to this method.
      static CommandBuilder
      <Void>
      imeSetComposition()
      Creates a buider for conveniently assigning parameters to this method.
      static CommandBuilder
      <Void>
      synthesizePinchGesture()
      Creates a buider for conveniently assigning parameters to this method.
      static CommandBuilder
      <Void>
      synthesizeScrollGesture()
      Creates a buider for conveniently assigning parameters to this method.
      static CommandBuilder
      <Void>
      synthesizeTapGesture()
      Creates a buider for conveniently assigning parameters to this method.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • TimeSinceEpoch

        🡇     🗕  🗗  🗖
        public static final java.lang.String TimeSinceEpoch
        UTC time in seconds, counted from January 1, 1970.

        The Type TimeSinceEpoch has been eliminated, because it is a direct mapping to a basic Java-Type; it has no additional fields, or other distinguishing properties. Instead, this CDP defined type has been relegated to a simple String Constant, for documentation & reference purposes only.

        The code which is generated which employs this type replaces its use with the Standard Java-Type: Number

        Eliminated Type
        See Also:
        Constant Field Values
    • Method Detail

      • cancelDragging

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.Void> cancelDragging()
        Cancels any active dragging in the page.
        Returns:
        An instance of Script<Void>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<Void> to ensure that the Browser Function has run to completion.
      • dispatchDragEvent

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.Void> dispatchDragEvent​
                    (java.lang.String type,
                     java.lang.Number x,
                     java.lang.Number y,
                     Input.DragData data,
                     java.lang.Integer modifiers)
        
        Dispatches a drag event into the page.
        EXPERIMENTAL

        👍 Because of the sheer number of input parameters to this method, there is a a CommandBuilder variant to this method which may be invoked instead.

        Please View: dispatchDragEvent()
        Parameters:
        type - Type of the drag event.
        Acceptable Values: ["dragCancel", "dragEnter", "dragOver", "drop"]
        x - X coordinate of the event relative to the main frame's viewport in CSS pixels.
        y - Y coordinate of the event relative to the main frame's viewport in CSS pixels. 0 refers to the top of the viewport and Y increases as it proceeds towards the bottom of the viewport.
        data - -
        modifiers - Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0).
        OPTIONAL
        Returns:
        An instance of Script<Void>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<Void> to ensure that the Browser Function has run to completion.
      • dispatchKeyEvent

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.Void> dispatchKeyEvent​
                    (java.lang.String type,
                     java.lang.Integer modifiers,
                     java.lang.Number timestamp,
                     java.lang.String text,
                     java.lang.String unmodifiedText,
                     java.lang.String keyIdentifier,
                     java.lang.String code,
                     java.lang.String key,
                     java.lang.Integer windowsVirtualKeyCode,
                     java.lang.Integer nativeVirtualKeyCode,
                     java.lang.Boolean autoRepeat,
                     java.lang.Boolean isKeypad,
                     java.lang.Boolean isSystemKey,
                     java.lang.Integer location,
                     java.lang.String[] commands)
        
        Dispatches a key event to the page.

        👍 Because of the sheer number of input parameters to this method, there is a a CommandBuilder variant to this method which may be invoked instead.

        Please View: dispatchKeyEvent()
        Parameters:
        type - Type of the key event.
        Acceptable Values: ["char", "keyDown", "keyUp", "rawKeyDown"]
        modifiers - Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0).
        OPTIONAL
        timestamp - Time at which the event occurred.
        OPTIONAL
        text - Text as generated by processing a virtual key code with a keyboard layout. Not needed for for keyUp and rawKeyDown events (default: "")
        OPTIONAL
        unmodifiedText - Text that would have been generated by the keyboard if no modifiers were pressed (except for shift). Useful for shortcut (accelerator) key handling (default: "").
        OPTIONAL
        keyIdentifier - Unique key identifier (e.g., 'U+0041') (default: "").
        OPTIONAL
        code - Unique DOM defined string value for each physical key (e.g., 'KeyA') (default: "").
        OPTIONAL
        key - Unique DOM defined string value describing the meaning of the key in the context of active modifiers, keyboard layout, etc (e.g., 'AltGr') (default: "").
        OPTIONAL
        windowsVirtualKeyCode - Windows virtual key code (default: 0).
        OPTIONAL
        nativeVirtualKeyCode - Native virtual key code (default: 0).
        OPTIONAL
        autoRepeat - Whether the event was generated from auto repeat (default: false).
        OPTIONAL
        isKeypad - Whether the event was generated from the keypad (default: false).
        OPTIONAL
        isSystemKey - Whether the event was a system key event (default: false).
        OPTIONAL
        location - Whether the event was from the left or right side of the keyboard. 1=Left, 2=Right (default: 0).
        OPTIONAL
        commands - Editing commands to send with the key event (e.g., 'selectAll') (default: []). These are related to but not equal the command names used in document.execCommand and NSStandardKeyBindingResponding. See https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/editing/commands/editor_command_names.h for valid command names.
        OPTIONALEXPERIMENTAL
        Returns:
        An instance of Script<Void>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<Void> to ensure that the Browser Function has run to completion.
      • dispatchMouseEvent

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.Void> dispatchMouseEvent​
                    (java.lang.String type,
                     java.lang.Number x,
                     java.lang.Number y,
                     java.lang.Integer modifiers,
                     java.lang.Number timestamp,
                     java.lang.String button,
                     java.lang.Integer buttons,
                     java.lang.Integer clickCount,
                     java.lang.Number force,
                     java.lang.Number tangentialPressure,
                     java.lang.Number tiltX,
                     java.lang.Number tiltY,
                     java.lang.Integer twist,
                     java.lang.Number deltaX,
                     java.lang.Number deltaY,
                     java.lang.String pointerType)
        
        Dispatches a mouse event to the page.

        👍 Because of the sheer number of input parameters to this method, there is a a CommandBuilder variant to this method which may be invoked instead.

        Please View: dispatchMouseEvent()
        Parameters:
        type - Type of the mouse event.
        Acceptable Values: ["mouseMoved", "mousePressed", "mouseReleased", "mouseWheel"]
        x - X coordinate of the event relative to the main frame's viewport in CSS pixels.
        y - Y coordinate of the event relative to the main frame's viewport in CSS pixels. 0 refers to the top of the viewport and Y increases as it proceeds towards the bottom of the viewport.
        modifiers - Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0).
        OPTIONAL
        timestamp - Time at which the event occurred.
        OPTIONAL
        button - Mouse button (default: "none").
        OPTIONAL
        buttons - A number indicating which buttons are pressed on the mouse when a mouse event is triggered. Left=1, Right=2, Middle=4, Back=8, Forward=16, None=0.
        OPTIONAL
        clickCount - Number of times the mouse button was clicked (default: 0).
        OPTIONAL
        force - The normalized pressure, which has a range of [0,1] (default: 0).
        OPTIONALEXPERIMENTAL
        tangentialPressure - The normalized tangential pressure, which has a range of [-1,1] (default: 0).
        OPTIONALEXPERIMENTAL
        tiltX - The plane angle between the Y-Z plane and the plane containing both the stylus axis and the Y axis, in degrees of the range [-90,90], a positive tiltX is to the right (default: 0).
        OPTIONAL
        tiltY - The plane angle between the X-Z plane and the plane containing both the stylus axis and the X axis, in degrees of the range [-90,90], a positive tiltY is towards the user (default: 0).
        OPTIONAL
        twist - The clockwise rotation of a pen stylus around its own major axis, in degrees in the range [0,359] (default: 0).
        OPTIONALEXPERIMENTAL
        deltaX - X delta in CSS pixels for mouse wheel event (default: 0).
        OPTIONAL
        deltaY - Y delta in CSS pixels for mouse wheel event (default: 0).
        OPTIONAL
        pointerType - Pointer type (default: "mouse").
        Acceptable Values: ["mouse", "pen"]
        OPTIONAL
        Returns:
        An instance of Script<Void>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<Void> to ensure that the Browser Function has run to completion.
      • dispatchTouchEvent

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.Void> dispatchTouchEvent​
                    (java.lang.String type,
                     Input.TouchPoint[] touchPoints,
                     java.lang.Integer modifiers,
                     java.lang.Number timestamp)
        
        Dispatches a touch event to the page.
        Parameters:
        type - Type of the touch event. TouchEnd and TouchCancel must not contain any touch points, while TouchStart and TouchMove must contains at least one.
        Acceptable Values: ["touchCancel", "touchEnd", "touchMove", "touchStart"]
        touchPoints - Active touch points on the touch device. One event per any changed point (compared to previous touch event in a sequence) is generated, emulating pressing/moving/releasing points one by one.
        modifiers - Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0).
        OPTIONAL
        timestamp - Time at which the event occurred.
        OPTIONAL
        Returns:
        An instance of Script<Void>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<Void> to ensure that the Browser Function has run to completion.
      • emulateTouchFromMouseEvent

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.Void> emulateTouchFromMouseEvent​
                    (java.lang.String type,
                     int x,
                     int y,
                     java.lang.String button,
                     java.lang.Number timestamp,
                     java.lang.Number deltaX,
                     java.lang.Number deltaY,
                     java.lang.Integer modifiers,
                     java.lang.Integer clickCount)
        
        Emulates touch event from the mouse event parameters.
        EXPERIMENTAL

        👍 Because of the sheer number of input parameters to this method, there is a a CommandBuilder variant to this method which may be invoked instead.

        Please View: emulateTouchFromMouseEvent()
        Parameters:
        type - Type of the mouse event.
        Acceptable Values: ["mouseMoved", "mousePressed", "mouseReleased", "mouseWheel"]
        x - X coordinate of the mouse pointer in DIP.
        y - Y coordinate of the mouse pointer in DIP.
        button - Mouse button. Only "none", "left", "right" are supported.
        timestamp - Time at which the event occurred (default: current time).
        OPTIONAL
        deltaX - X delta in DIP for mouse wheel event (default: 0).
        OPTIONAL
        deltaY - Y delta in DIP for mouse wheel event (default: 0).
        OPTIONAL
        modifiers - Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0).
        OPTIONAL
        clickCount - Number of times the mouse button was clicked (default: 0).
        OPTIONAL
        Returns:
        An instance of Script<Void>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<Void> to ensure that the Browser Function has run to completion.
      • imeSetComposition

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.Void> imeSetComposition​
                    (java.lang.String text,
                     int selectionStart,
                     int selectionEnd,
                     java.lang.Integer replacementStart,
                     java.lang.Integer replacementEnd)
        
        This method sets the current candidate text for IME. Use imeCommitComposition to commit the final text. Use imeSetComposition with empty string as text to cancel composition.
        EXPERIMENTAL

        👍 Because of the sheer number of input parameters to this method, there is a a CommandBuilder variant to this method which may be invoked instead.

        Please View: imeSetComposition()
        Parameters:
        text - The text to insert
        selectionStart - selection start
        selectionEnd - selection end
        replacementStart - replacement start
        OPTIONAL
        replacementEnd - replacement end
        OPTIONAL
        Returns:
        An instance of Script<Void>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<Void> to ensure that the Browser Function has run to completion.
      • insertText

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.Void> insertText​(java.lang.String text)
        This method emulates inserting text that doesn't come from a key press, for example an emoji keyboard or an IME.
        EXPERIMENTAL
        Parameters:
        text - The text to insert.
        Returns:
        An instance of Script<Void>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<Void> to ensure that the Browser Function has run to completion.
      • setIgnoreInputEvents

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.Void> setIgnoreInputEvents​(boolean ignore)
        Ignores input events (useful while auditing page).
        Parameters:
        ignore - Ignores input events processing when set to true.
        Returns:
        An instance of Script<Void>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<Void> to ensure that the Browser Function has run to completion.
      • setInterceptDrags

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.Void> setInterceptDrags​(boolean enabled)
        Prevents default drag and drop behavior and instead emits Input.dragIntercepted events. Drag and drop behavior can be directly controlled via Input.dispatchDragEvent.
        EXPERIMENTAL
        Parameters:
        enabled - -
        Returns:
        An instance of Script<Void>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<Void> to ensure that the Browser Function has run to completion.
      • synthesizePinchGesture

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.Void> synthesizePinchGesture​
                    (java.lang.Number x,
                     java.lang.Number y,
                     java.lang.Number scaleFactor,
                     java.lang.Integer relativeSpeed,
                     java.lang.String gestureSourceType)
        
        Synthesizes a pinch gesture over a time period by issuing appropriate touch events.
        EXPERIMENTAL

        👍 Because of the sheer number of input parameters to this method, there is a a CommandBuilder variant to this method which may be invoked instead.

        Please View: synthesizePinchGesture()
        Parameters:
        x - X coordinate of the start of the gesture in CSS pixels.
        y - Y coordinate of the start of the gesture in CSS pixels.
        scaleFactor - Relative scale factor after zooming (>1.0 zooms in, <1.0 zooms out).
        relativeSpeed - Relative pointer speed in pixels per second (default: 800).
        OPTIONAL
        gestureSourceType - Which type of input events to be generated (default: 'default', which queries the platform for the preferred input type).
        OPTIONAL
        Returns:
        An instance of Script<Void>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<Void> to ensure that the Browser Function has run to completion.
      • synthesizeScrollGesture

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.Void> synthesizeScrollGesture​
                    (java.lang.Number x,
                     java.lang.Number y,
                     java.lang.Number xDistance,
                     java.lang.Number yDistance,
                     java.lang.Number xOverscroll,
                     java.lang.Number yOverscroll,
                     java.lang.Boolean preventFling,
                     java.lang.Integer speed,
                     java.lang.String gestureSourceType,
                     java.lang.Integer repeatCount,
                     java.lang.Integer repeatDelayMs,
                     java.lang.String interactionMarkerName)
        
        Synthesizes a scroll gesture over a time period by issuing appropriate touch events.
        EXPERIMENTAL

        👍 Because of the sheer number of input parameters to this method, there is a a CommandBuilder variant to this method which may be invoked instead.

        Please View: synthesizeScrollGesture()
        Parameters:
        x - X coordinate of the start of the gesture in CSS pixels.
        y - Y coordinate of the start of the gesture in CSS pixels.
        xDistance - The distance to scroll along the X axis (positive to scroll left).
        OPTIONAL
        yDistance - The distance to scroll along the Y axis (positive to scroll up).
        OPTIONAL
        xOverscroll - The number of additional pixels to scroll back along the X axis, in addition to the given distance.
        OPTIONAL
        yOverscroll - The number of additional pixels to scroll back along the Y axis, in addition to the given distance.
        OPTIONAL
        preventFling - Prevent fling (default: true).
        OPTIONAL
        speed - Swipe speed in pixels per second (default: 800).
        OPTIONAL
        gestureSourceType - Which type of input events to be generated (default: 'default', which queries the platform for the preferred input type).
        OPTIONAL
        repeatCount - The number of times to repeat the gesture (default: 0).
        OPTIONAL
        repeatDelayMs - The number of milliseconds delay between each repeat. (default: 250).
        OPTIONAL
        interactionMarkerName - The name of the interaction markers to generate, if not empty (default: "").
        OPTIONAL
        Returns:
        An instance of Script<Void>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<Void> to ensure that the Browser Function has run to completion.
      • synthesizeTapGesture

        🡅  🡇     🗕  🗗  🗖
        public static Script<java.lang.Void> synthesizeTapGesture​
                    (java.lang.Number x,
                     java.lang.Number y,
                     java.lang.Integer duration,
                     java.lang.Integer tapCount,
                     java.lang.String gestureSourceType)
        
        Synthesizes a tap gesture over a time period by issuing appropriate touch events.
        EXPERIMENTAL

        👍 Because of the sheer number of input parameters to this method, there is a a CommandBuilder variant to this method which may be invoked instead.

        Please View: synthesizeTapGesture()
        Parameters:
        x - X coordinate of the start of the gesture in CSS pixels.
        y - Y coordinate of the start of the gesture in CSS pixels.
        duration - Duration between touchdown and touchup events in ms (default: 50).
        OPTIONAL
        tapCount - Number of times to perform the tap (e.g. 2 for double tap, default: 1).
        OPTIONAL
        gestureSourceType - Which type of input events to be generated (default: 'default', which queries the platform for the preferred input type).
        OPTIONAL
        Returns:
        An instance of Script<Void>

        This Script instance must be executed before the browser receives the invocation-request.

        This Browser-Function does not have a return-value. You may choose to await the Promise<Void> to ensure that the Browser Function has run to completion.