Package com.hp.lft.sdk.web
Class EmulatedDevice
java.lang.Object
com.hp.lft.sdk.web.EmulatedDevice
- All Implemented Interfaces:
Environment
,EmulatedEnvironment
The description of an emulated mobile device test object.
-
Constructor Summary
ConstructorsConstructorDescriptionInitializes a new instance of the EmulatedDevice class.EmulatedDevice
(String name, int width, int height, double scaleFactor, boolean touchable, boolean mobile, String userAgent) Initializes a new instance of the EmulatedDevice class with the initialization parameters. -
Method Summary
Modifier and TypeMethodDescriptionstatic EmulatedDevice
GalaxyS5()
Returns the predefined Samsung Galaxy S5 emulated device.int
Returns the height of the emulated device screen (in pixels).getName()
Returns the name of the emulated device.double
Returns the scale factor of the emulated device screen.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
Returns the predefined iPhone 6 Plus emulated device.boolean
isMobile()
Returns true if the emulated device is mobile device.boolean
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
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
(String userAgent) Sets the userAgent property of the emulated device.void
setWidth
(int width) Sets width of the emulated device screen (in pixels).
-
Constructor Details
-
EmulatedDevice
public EmulatedDevice()Initializes a new instance of the EmulatedDevice class. -
EmulatedDevice
public EmulatedDevice(String name, int width, int height, double scaleFactor, boolean touchable, boolean mobile, 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 Details
-
setName
Sets name of the emulated device.- Specified by:
setName
in interfaceEmulatedEnvironment
- Parameters:
name
- the device name.
-
getName
Returns the name of the emulated device.- Specified by:
getName
in interfaceEmulatedEnvironment
- 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 interfaceEmulatedEnvironment
- 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 interfaceEmulatedEnvironment
- 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 interfaceEmulatedEnvironment
- 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 interfaceEmulatedEnvironment
- 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 interfaceEmulatedEnvironment
- 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 interfaceEmulatedEnvironment
- 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 interfaceEmulatedEnvironment
- 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 interfaceEmulatedEnvironment
- Returns:
- true if the emulated device screen touch feature is enabled.
-
setUserAgent
Sets the userAgent property of the emulated device.- Specified by:
setUserAgent
in interfaceEmulatedEnvironment
- Parameters:
userAgent
- the userAgent property of the emulated device.
-
getUserAgent
Returns the userAgent property of the emulated device.- Specified by:
getUserAgent
in interfaceEmulatedEnvironment
- 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 interfaceEmulatedEnvironment
- 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 interfaceEmulatedEnvironment
- Returns:
- true if the emulated device is mobile device.
-
GalaxyS5
Returns the predefined Samsung Galaxy S5 emulated device.- Returns:
- the predefined Samsung Galaxy S5 emulated device.
-
Nexus5X
Returns the predefined Nexus 5X emulated device.- Returns:
- the predefined Nexus 5X emulated device.
-
Nexus6P
Returns the predefined Nexus 6P emulated device.- Returns:
- the predefined Nexus 6P emulated device.
-
IPhone5
Returns the predefined iPhone 5 emulated device.- Returns:
- the predefined iPhone 5 emulated device.
-
IPhone6
Returns the predefined iPhone 6 emulated device.- Returns:
- the predefined iPhone 6 emulated device.
-
IPhone6Plus
Returns the predefined iPhone 6 Plus emulated device.- Returns:
- the predefined iPhone 6 Plus emulated device.
-
IPad
Returns the predefined IPad emulated device.- Returns:
- the predefined IPad emulated device.
-