Share this page

com.hp.lft.sdk.web

## Class EmulatedDevice

- java.lang.Object
- - com.hp.lft.sdk.web.EmulatedDevice

- All Implemented Interfaces:
    Environment, EmulatedEnvironment

      public class EmulatedDevice
      extends java.lang.Object
      implements EmulatedEnvironment

  The description of an emulated mobile device test object.

- - ### Constructor Summary

    Constructor and Description
    `EmulatedDevice()` Initializes a new instance of the EmulatedDevice class.
    `EmulatedDevice(java.lang.String name, int width, int height, double scaleFactor, boolean touchable, boolean mobile, java.lang.String userAgent)` Initializes a new instance of the EmulatedDevice class with the initialization parameters.

  - ### Method Summary

    Modifier and Type | Method and Description
    --- | ---
    `static EmulatedDevice` | `GalaxyS5()` Returns the predefined Samsung Galaxy S5 emulated device.
    `int` | `getHeight()` Returns the height of the emulated device screen (in pixels).
    `java.lang.String` | `getName()` Returns the name of the emulated device.
    `double` | `getScaleFactor()` Returns the scale factor of the emulated device screen.
    `java.lang.String` | `getUserAgent()` Returns the userAgent property of the emulated device.
    `int` | `getWidth()` Returns the width of the emulated device screen (in pixels).
    `static EmulatedDevice` | `IPad()` Returns the predefined IPad emulated device.
    `static EmulatedDevice` | `IPhone5()` Returns the predefined iPhone 5 emulated device.
    `static EmulatedDevice` | `IPhone6()` Returns the predefined iPhone 6 emulated device.
    `static EmulatedDevice` | `IPhone6Plus()` Returns the predefined iPhone 6 Plus emulated device.
    `boolean` | `isMobile()` Returns true if the emulated device is mobile device.
    `boolean` | `isTouchable()` Returns true if the emulated device screen touch feature is enabled.
    `static EmulatedDevice` | `Nexus5X()` Returns the predefined Nexus 5X emulated device.
    `static EmulatedDevice` | `Nexus6P()` Returns the predefined Nexus 6P emulated device.
    `void` | `setHeight(int height)` Sets height of the emulated device screen (in pixels).
    `void` | `setMobile(boolean mobile)` Sets the mobile property of the emulated device.
    `void` | `setName(java.lang.String name)` Sets name of the emulated device.
    `void` | `setScaleFactor(double scaleFactor)` Sets the scale factor of the emulated device screen.
    `void` | `setTouchable(boolean touchable)` Sets the touchable property of the emulated device screen.
    `void` | `setUserAgent(java.lang.String userAgent)` Sets the userAgent property of the emulated device.
    `void` | `setWidth(int width)` Sets width of the emulated device screen (in pixels).

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### EmulatedDevice

          public EmulatedDevice()

      Initializes a new instance of the EmulatedDevice class.

    - #### EmulatedDevice

          public EmulatedDevice(java.lang.String name,
                                int width,
                                int height,
                                double scaleFactor,
                                boolean touchable,
                                boolean mobile,
                                java.lang.String userAgent)

      Initializes a new instance of the EmulatedDevice class with the initialization parameters.
      Parameters:
        `name` - the emulated device name.
        `width` - the emulated device screen width.
        `height` - the emulated device screen height.
        `scaleFactor` - the emulated device screen scale factor.
        `touchable` - the emulated device screen can use the touch feature.
        `userAgent` - the emulated device user agent.
        `mobile` - the emulated device is mobile device.

  - ### Method Detail

    - #### setName

          public void setName(java.lang.String name)

      Sets name of the emulated device.
      Specified by:
        `setName` in interface `EmulatedEnvironment`
      Parameters:
        `name` - the device name.

    - #### getName

          public java.lang.String getName()

      Returns the name of the emulated device.
      Specified by:
        `getName` in interface `EmulatedEnvironment`
      Returns:
        name of the emulated device.

    - #### setWidth

          public void setWidth(int width)

      Sets width of the emulated device screen (in pixels).
      Specified by:
        `setWidth` in interface `EmulatedEnvironment`
      Parameters:
        `width` - the width of the emulated device screen (in pixels).

    - #### getWidth

          public int getWidth()

      Returns the width of the emulated device screen (in pixels).
      Specified by:
        `getWidth` in interface `EmulatedEnvironment`
      Returns:
        the width of the emulated device screen (in pixels).

    - #### setHeight

          public void setHeight(int height)

      Sets height of the emulated device screen (in pixels).
      Specified by:
        `setHeight` in interface `EmulatedEnvironment`
      Parameters:
        `height` - the height of the emulated device screen (in pixels).

    - #### getHeight

          public int getHeight()

      Returns the height of the emulated device screen (in pixels).
      Specified by:
        `getHeight` in interface `EmulatedEnvironment`
      Returns:
        the height of the emulated device screen (in pixels).

    - #### setScaleFactor

          public void setScaleFactor(double scaleFactor)

      Sets the scale factor of the emulated device screen.
      Specified by:
        `setScaleFactor` in interface `EmulatedEnvironment`
      Parameters:
        `scaleFactor` - the scale factor of the emulated device screen.

    - #### getScaleFactor

          public double getScaleFactor()

      Returns the scale factor of the emulated device screen.
      Specified by:
        `getScaleFactor` in interface `EmulatedEnvironment`
      Returns:
        the scale factor of the emulated device screen.

    - #### setTouchable

          public void setTouchable(boolean touchable)

      Sets the touchable property of the emulated device screen.
      Specified by:
        `setTouchable` in interface `EmulatedEnvironment`
      Parameters:
        `touchable` - the touchable property of the emulated device screen.

    - #### isTouchable

          public boolean isTouchable()

      Returns true if the emulated device screen touch feature is enabled.
      Specified by:
        `isTouchable` in interface `EmulatedEnvironment`
      Returns:
        true if the emulated device screen touch feature is enabled.

    - #### setUserAgent

          public void setUserAgent(java.lang.String userAgent)

      Sets the userAgent property of the emulated device.
      Specified by:
        `setUserAgent` in interface `EmulatedEnvironment`
      Parameters:
        `userAgent` - the userAgent property of the emulated device.

    - #### getUserAgent

          public java.lang.String getUserAgent()

      Returns the userAgent property of the emulated device.
      Specified by:
        `getUserAgent` in interface `EmulatedEnvironment`
      Returns:
        the userAgent property of the emulated device.

    - #### setMobile

          public void setMobile(boolean mobile)

      Sets the mobile property of the emulated device.
      Specified by:
        `setMobile` in interface `EmulatedEnvironment`
      Parameters:
        `mobile` - the mobile property of the emulated device.

    - #### isMobile

          public boolean isMobile()

      Returns true if the emulated device is mobile device.
      Specified by:
        `isMobile` in interface `EmulatedEnvironment`
      Returns:
        true if the emulated device is mobile device.

    - #### GalaxyS5

          public static EmulatedDevice GalaxyS5()

      Returns the predefined Samsung Galaxy S5 emulated device.
      Returns:
        the predefined Samsung Galaxy S5 emulated device.

    - #### Nexus5X

          public static EmulatedDevice Nexus5X()

      Returns the predefined Nexus 5X emulated device.
      Returns:
        the predefined Nexus 5X emulated device.

    - #### Nexus6P

          public static EmulatedDevice Nexus6P()

      Returns the predefined Nexus 6P emulated device.
      Returns:
        the predefined Nexus 6P emulated device.

    - #### IPhone5

          public static EmulatedDevice IPhone5()

      Returns the predefined iPhone 5 emulated device.
      Returns:
        the predefined iPhone 5 emulated device.

    - #### IPhone6

          public static EmulatedDevice IPhone6()

      Returns the predefined iPhone 6 emulated device.
      Returns:
        the predefined iPhone 6 emulated device.

    - #### IPhone6Plus

          public static EmulatedDevice IPhone6Plus()

      Returns the predefined iPhone 6 Plus emulated device.
      Returns:
        the predefined iPhone 6 Plus emulated device.

    - #### IPad

          public static EmulatedDevice IPad()

      Returns the predefined IPad emulated device.
      Returns:
        the predefined IPad emulated device.

Tips to improve your search results... UFT Developer Java SDK Reference Version 15.0-15.0.2 UFT Developer SDK Reference All View Local Help Center View Online Help Center back Go back in browser history forward Go forward in browser history Remove search highlights next topic Go to next topic previous topic Go to previous topic Print the current topic Version: