public class OperaMobileEmulation extends Object implements EmulationProfile
OperaMobileEmulation.Builder profile = OperaMobileEmulation.builder();
profile.setResolution(new Dimension(480, 800));
profile.setPPI(123);
profile.setUserAgent(UserAgent.ANDROID);
profile.setIME(IME.TABLET);
OperaSettings settings = new OperaSettings();
settings.emulate(profile.build());
WebDriver driver = new OperaDriver(settings);
| Modifier and Type | Class and Description |
|---|---|
static class |
OperaMobileEmulation.Builder
A builder for creating
OperaMobileEmulation emulation profiles. |
static class |
OperaMobileEmulation.UserAgent |
EmulationProfile.IME| Constructor and Description |
|---|
OperaMobileEmulation() |
| Modifier and Type | Method and Description |
|---|---|
static OperaMobileEmulation.Builder |
builder()
Returns a new builder.
|
boolean |
equals(Object o) |
static EmulationProfile |
fromJson(org.json.JSONObject json) |
EmulationProfile.IME |
getIME()
Gets the input mechanism of this profile.
|
int |
getPPI()
Gets the pixel density of the device's screen.
|
String |
getProfileName()
Gets a unique name describing the emulation profile.
|
org.openqa.selenium.Dimension |
getResolution()
Gets the resolution of the device's screen.
|
String |
getUserAgent()
Gets the user agent string.
|
org.json.JSONObject |
toJson() |
String |
toString() |
public String getProfileName()
EmulationProfilegetProfileName in interface EmulationProfilepublic org.openqa.selenium.Dimension getResolution()
EmulationProfilegetResolution in interface EmulationProfilepublic int getPPI()
EmulationProfilegetPPI in interface EmulationProfilepublic EmulationProfile.IME getIME()
EmulationProfilegetIME in interface EmulationProfilepublic String getUserAgent()
EmulationProfilegetUserAgent in interface EmulationProfilepublic org.json.JSONObject toJson()
throws org.json.JSONException
org.json.JSONExceptionpublic static EmulationProfile fromJson(org.json.JSONObject json) throws org.json.JSONException
org.json.JSONExceptionpublic static OperaMobileEmulation.Builder builder()
OperaMobileEmulation.Builder constructor.Copyright © 2012. All Rights Reserved.