-3

Code:

package demo1;

public class helloworld {

    public static void main(String[] args) {
        // TODO Auto-generated method stub
        // Create a new instance of the Firefox driver
                WebDriver driver = new FirefoxDriver();

                //Launch the Online Store Website
                driver.get("http://www.store.demoqa.com");

                // Print a Log In message to the screen
                System.out.println("Successfully opened the website www.Store.Demoqa.com");

                //Wait for 5 Sec
                Thread.sleep(5000);

Error:

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 demo1.helloworld.main(helloworld.java:8)
cruisepandey
  • 28,520
  • 6
  • 20
  • 38
Manu
  • 1

2 Answers2

0

Import these two lines :

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

Assuming all pre-requisites have already been taken care.

cruisepandey
  • 28,520
  • 6
  • 20
  • 38
0

You can use use selenium-java.x.jar in your classpath. Compile and run...

Pankaj
  • 67
  • 7