4.1
FirefoxDriver
75
JSON
public class StoringAndCreatingTheProfile {
public static void main(String... args){
FirefoxProfile profile = new FirefoxProfile();
String json="";
try {
profile.addExtension(new File("C:\\firebug-1.12.0-fx.xpi"));
json = profile.toJson();
System.out.println(json);
} catch (IOException e) {
e.printStackTrace();
}
try {
FirefoxDriver driver = new
FirefoxDriver(FirefoxProfile.fromJson(json));
} catch (IOException e) {
e.printStackTrace();
}
}
}
try-catch
JSON
JSON
2
try-catch
JSON