Unable to launch firefox browser | Selenium Forum

Unable to launch firefox browser | Selenium Forum

Unable to launch firefox browser

Below is sample code i used to launch firefox browser.

Please help me out to resolve this issue.

package webpackage; import org.openqa.selenium.firefox.FirefoxDriver;

public class First {

public static void main(String[] args) { System.out.println("Hello browser launch test"); // declaration and instantiation of objects/variables System.setProperty("webdriver.firefox.marionette","D:\\test\\testing\\Auto\\Browserdrivers\\firefox\\geckodriver-v0.23.0-win64\\geckodriver.exe"); WebDriver driver = new FirefoxDriver(); //comment the above 2 lines and uncomment below 2 lines to use Chrome //System.setProperty("webdriver.chrome.driver","G:\\chromedriver.exe"); //WebDriver driver = new ChromeDriver(); String baseUrl = "www.google.com"; // launch Fire fox and direct it to the Base URL driver.get(baseUrl); //close Fire fox driver.close(); } }

Exception in thread "main" java.lang.Error: Unresolved compilation problems: WebDriver cannot be resolved to a type FirefoxDriver cannot be resolved to a type

at webpackage.First.main(First.java:12)

Below is test environment:

Have you imported all the supplied jars that came with selenium?

If not, add all these jars and then try executing the code.

You need to add jars available in libs directory as well.

Yes, i have used single standalone jar( selenium-server-standalone-3.11.0.jar ). Is not equal to selenium-server-3.11.0.zip ?

I have added all jars from selenium-server-3.11.0.zip including lib folder jars. But still facing same issue. Please guide me. Below attaching screenshot for reference.

Please use jars from official resources. Additionally, make sure that you are not importing multiple jars for the same thing.

I already taken jars from official site only and not imported multiple jars. Not able to understand on which reason it is not working for me.

Please use the jars availlable in the link below.

https://www.seleniumhq.org/download/

Additionally ping me on skype at [email protected] if the issue still does'nt resolve after the newly added jars from the link provided.

We offer online selenium and UFT/QTP training. The course is very comprehensive and covers every aspect of automation testing with UFT/QTP and selenium. All types of frameworks are covered in depth - data driven framework, hybrid framework, page object model with a live project

© 2020 Whizdom Trainings. All rights Reserved - Powered by Whizdom Trainings

Recommended articles