Guest User

Untitled

a guest
Nov 19th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. import org.openqa.selenium.By;
  2. import org.openqa.selenium.Keys;
  3. import org.openqa.selenium.firefox.FirefoxDriver;
  4. import org.openqa.selenium.firefox.FirefoxOptions;
  5. import org.openqa.selenium.firefox.FirefoxProfile;
  6. import org.openqa.selenium.firefox.internal.ProfilesIni;
  7.  
  8. public class Test {
  9.  
  10. public static void main(String[] args) {
  11. ProfilesIni prof = new ProfilesIni();
  12. FirefoxProfile profile= prof.getProfile ("default");
  13. profile.setAcceptUntrustedCertificates(true) ;
  14. profile.setAssumeUntrustedCertificateIssuer(false);
  15.  
  16. FirefoxOptions options = new FirefoxOptions();
  17. options.setProfile(profile);
  18. FirefoxDriver browser = new FirefoxDriver(options);
  19.  
  20. browser.get("https://www.google.com");
  21. browser.findElement(By.xpath("//body")).sendKeys(Keys.chord(Keys.CONTROL, "t"));
  22. }
  23. }
Add Comment
Please, Sign In to add comment