PhantomJsCloud Automation API
    Preparing search index...

    Class Touchscreen

    allows interaction with the touchscreen

    Hierarchy

    • _PlatformObjBinding
      • Touchscreen
    Index
      • x <number>
      • y <number>
      • returns: <Promise>

      Dispatches a touchstart and touchend event.

      Parameters

      • x: number
      • y: number

      Returns Promise<void>

    • Dispatches a touchend event for the first active touch and ends it. Fails when no touch is active.

      Returns Promise<void>

    • Dispatches a touchmove event that moves the first active touch to (x, y). Fails when no touch is active (start one with Touchscreen.touchStart). Chrome may throttle touchmove events, so not every call fires one in the page.

      Parameters

      • x: number

        horizontal position in CSS pixels

      • y: number

        vertical position in CSS pixels

      Returns Promise<void>

    • Dispatches a touchstart event at (x, y) and returns the started touch as a :class; the touch stays active until it is ended. Several touches can be active at once.

      const touch = await page.touchscreen.touchStart(100, 200);
      await touch.move(100, 120);
      await touch.end();

      Parameters

      • x: number

        horizontal position in CSS pixels

      • y: number

        vertical position in CSS pixels

      Returns Promise<TouchHandle>