i just opened Facebook with the help of Selenium:
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public class class1 {
public static void main(String[] args) {
System.setProperty("webdriver.gecko.driver","C:\\Users\\Hi\\Desktop\\selenium\\geckodriver.exe");
WebDriver driver = new FirefoxDriver();
driver.get("http://www.facebook.com");
}
}
But on that site is no Firebug. When i open the browser normally without Selenium, then the Firebug icon is there. Can someone help?
Edit: Thanks to the help of yong. I also found a very good way to solve the problem with the help of this code i found here http://toolsqa.com/selenium-webdriver/custom-firefox-profile/
ProfilesIni profile = new ProfilesIni();
FirefoxProfile myProfile = profile.getProfile("default");
System.setProperty("webdriver.gecko.driver","C:\\Users\\Hi\\Desktop\\selenium\\geckodriver.exe");
WebDriver driver = new FirefoxDriver(myProfile);
driver.get("http://www.facebook.com");
Analysis:
Selenium use a default profile to open firefox, this profile not same as the one you open by manual. In general the default profile will not includes the plugins you istalled on firefox.
Solution
Create a firefox profile manually,by default the newly profile will includes
http://kb.mozillazine.org/Creating_a_new_Firefox_profile_on_Windows
Tell selenium use the created profile when open firefox
How to use custom Firefox Profile with Selenium? (Java) (And pass HTML Authorization Window)