document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. package samplescripts;
  2.  
  3. import java.io.File;
  4. import org.openqa.selenium.WebDriver;
  5. import org.openqa.selenium.firefox.FirefoxDriver;
  6. import org.openqa.selenium.firefox.FirefoxProfile;
  7. import org.testng.annotations.BeforeClass;
  8. import org.testng.annotations.Test;
  9.  
  10. public class Addons {
  11.    
  12.     public WebDriver driver;
  13.    
  14.   @Test
  15.   public void f() {
  16.       driver.get("http://www.google.com");
  17.   }
  18.   @BeforeClass
  19.   public void beforeClass() throws Exception {
  20.       //Get firebug path
  21.       File f = new File("D:\\\\addons\\\\firebug-2.0.9.xpi");
  22.       //get selenium-ide.xpi path
  23.       File f1 = new File("D:\\\\addons\\\\selenium-ide.xpi");
  24.       //create firefox profile
  25.       FirefoxProfile fp = new FirefoxProfile();
  26.       //adding extensions
  27.       fp.addExtension(f);
  28.       fp.addExtension(f1);
  29.       fp.setPreference("extensions.firebug.currentversion", "2.0.9");
  30.       fp.setPreference("extensions.selenium-ide.currentversion", "2.9.0");
  31.       driver = new FirefoxDriver(fp);
  32.      
  33.   }
  34.  
  35.  
  36. }
');