Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import org.openqa.selenium.By;
- import org.openqa.selenium.Keys;
- import org.openqa.selenium.firefox.FirefoxDriver;
- import org.openqa.selenium.firefox.FirefoxOptions;
- import org.openqa.selenium.firefox.FirefoxProfile;
- import org.openqa.selenium.firefox.internal.ProfilesIni;
- public class Test {
- public static void main(String[] args) {
- ProfilesIni prof = new ProfilesIni();
- FirefoxProfile profile= prof.getProfile ("default");
- profile.setAcceptUntrustedCertificates(true) ;
- profile.setAssumeUntrustedCertificateIssuer(false);
- FirefoxOptions options = new FirefoxOptions();
- options.setProfile(profile);
- FirefoxDriver browser = new FirefoxDriver(options);
- browser.get("https://www.google.com");
- browser.findElement(By.xpath("//body")).sendKeys(Keys.chord(Keys.CONTROL, "t"));
- }
- }
Add Comment
Please, Sign In to add comment