Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Eclipse Java import and method not resolved

Posted on 2017-02-25
4
Medium Priority
?
1,470 Views
Last Modified: 2017-03-07
Hello,
I have a couple of "unresolved" issues.  I tried fixing my problems using the options within Eclipse, but nothing works.
I know that I have in import/install the org.opeqa.selenium API, yet can't find the API at org.openqa, and I know that my Selenium API needs to be installed as well.  I thought I did have it via Selinity - Selenium plugin, but I guess not.
These are my issues;
import org.openqa...cannot be resolved
FirefoxDriver cannot be resolved to a type
Method undined for WebDriver

This is the code;
import org.junit.Test;

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

public class MyFirstWebdriverTest<WebDriver> {
      @Test
      public void checkSeleniumHQinFirefox(){
        WebDriver driver = new FirefoxDriver();
        driver.get("http://seleniumhq.org");
        driver.quit();
      }
}
0
Comment
Question by:chima
  • 2
  • 2
4 Comments
 
LVL 23

Expert Comment

by:Siva Prasanna Kumar
ID: 42024564
Hi Chima,

You need to download the selenium web driver jars from here and add this to your project build path..

http://selenium-release.storage.googleapis.com/3.1/selenium-java-3.1.0.zip

Download the above link and then you find selenium jar which needs to be added to build path.
0
 

Author Comment

by:chima
ID: 42025922
Siva, I downloaded the Selenium zip file, extracted the file/folder, and added the path to the System Environmental variable path;
C:\Selenium-java-3.1.0\lib     Yet this did not solve my "resolve" issue.  I'll search for the solution, yet I thought I'd enter this comment here/now.
0
 
LVL 23

Accepted Solution

by:
Siva Prasanna Kumar earned 2000 total points
ID: 42025999
Chima, you are using eclipse right?

You need to add the jar files to the build path of the project, no need to add them to the path.

You can refer to this tutorial:

http://www.wikihow.com/Add-JARs-to-Project-Build-Paths-in-Eclipse-(Java)

Method 2 [Add external jars] as that's the easiest one, but method 1 ensures all dependencies are in one project.
0
 

Author Closing Comment

by:chima
ID: 42038233
Thanks
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
What do responsible coders do? They don't take detrimental shortcuts. They do take reasonable security precautions, create important automation, implement sufficient logging, fix things they break, and care about users.
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses

926 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question