|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.opera.core.systems.OperaProfile
public class OperaProfile
OperaProfile is an interface representing a profile (commonly a profile directory) for the Opera
web browser. It's typically used by passing in an instance object of this class to the
"opera.profile" capability at construction of OperaDriver, like this:
DesiredCapabilities capabilities = DesiredCapabilities.opera();
OperaProfile profile = new OperaProfile();
profile.preferences().set("foo", "bar", "baz");
capabilities.setCapability("opera.profile", profile);
WebDriver driver = new OperaDriver(capabilities);
Or by passing it in as an object directly to OperaDriver's constructor:
OperaProfile profile = new OperaProfile();
profile.preferences().set("foo", "bar", "baz");
WebDriver driver = new OperaDriver(profile);
Among Opera's command-line arguments the profile may be referred to as "pd", short for "personal
directory".
OperaPreferences| Constructor Summary | |
|---|---|
OperaProfile()
Creates a new, fresh random profile for Opera to use. |
|
OperaProfile(File profileDirectory)
Creates a representation of the profile in the given directory. |
|
OperaProfile(String profileDirectoryPath)
Creates a representation of the profile in the given directory path. |
|
| Method Summary | |
|---|---|
void |
cleanUp()
Cleans up the profile. |
static OperaProfile |
fromJson(String json)
Converts a JSON string object to a profile representation, returning a new instance of OperaProfile. |
File |
getDirectory()
Gets the current profile directory. |
OperaPreferences |
preferences()
Allows access to the preferences in the current profile. |
void |
setPreferences(OperaPreferences newPreferences)
Replaces the preferences in the profile with the given preferences. |
String |
toJson()
Converts this instance to its JSON representation. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public OperaProfile()
-pd command-line argument, such as
Opera Desktop. core-gogi and Opera Mobile is not supported.
public OperaProfile(String profileDirectoryPath)
profileDirectoryPath - the path to the profile directory to usepublic OperaProfile(File profileDirectory)
profileDirectory - the profile to use
IllegalArgumentException - if profileDirectory is not set| Method Detail |
|---|
public OperaPreferences preferences()
OperaPreferences object representing preferences in the current profilepublic void setPreferences(OperaPreferences newPreferences)
newPreferences - the new preferences to populate the profile withpublic File getDirectory()
public void cleanUp()
public String toJson()
throws IOException
IOException - if an I/O error occurs
public static OperaProfile fromJson(String json)
throws IOException
OperaProfile. This is used by the JsonWireProtocol to transfer a profile.
json - a base64-encoded JSON string (archive) representing a profile
IOException - if an I/O error occurs
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||