Pages

Showing posts with label FirefoxDriver. Show all posts
Showing posts with label FirefoxDriver. Show all posts

Friday, 9 March 2012

How can I start Firefox with add-ons installed?

Create a Firefox profile and add required add-ons. 


Take ‘Firebug’ as an example, save the Firebug XPI into the C:FF_addons folder as firebug.xpi (Download XPI file from Firebug download page, right-click on the “Download Now” and save as C:FF_addonsfirebug.xpi).


Then create a Firefox profile and add Firebug add-on while instantiating FirefoxDriver as below:


   String firebugFilePath = "C:\FF_addons\firebug.xpi";
FirefoxProfile profile = new FirefoxProfile();
profile.addExtension(new File(firebugFilePath));
// Add more FF addons if required
WebDriver driver = new FirefoxDriver(profile);

Monday, 6 February 2012

How can I instantiate FirefoxDriver?

The FirefoxDriver can be instantiated as below:


WebDriver driver = new FirefoxDriver(); // Instantiate the class - org.openqa.selenium.firefox.FirefoxDriver

Sample code(Java Binding):


package tests;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

public class FirefoxDriverSample {
public static void main(String[] args) {
// Instantiate the FirefoxDriver
WebDriver driver = new FirefoxDriver();

// Visit the Selenium-WebDriver FAQ site
driver.get("http://seleniumwebdriverfaq.tumblr.com/");

// Print the title of the page - It should print "Selenium-WebDriver FAQ's"
System.out.println("Title of the page is: " + driver.getTitle());

//Close the browser window
driver.close();

//Quit the driver
driver.quit();
}
}

What are the different implementations of WebDriver available?

Below are the WebDriver implementations available as off now:


1. HtmlUnitDriver
2. FirefoxDriver
3. InternetExplorerDriver
4. ChromeDriver
5. OperaDriver


6. AdroidDriver
7. IPhoneDriver

You can find out more information about each of these by following the links.

From where can I download set of Selenium tools?

Link below is where you can find the latest releases of all the Selenium components:


http://seleniumhq.org/download/