A Problem debuging simple code with selenium webdriver

I m start development with “Keyword Driven Framework” and when I run the line bellow occurs error and I not know a solution.

I follow step by step the example on http://www.toolsqa.com/selenium-webdriver/keyword-driven-framework/introduction/.

driver = new ChromeDriver();

” Source not found” the source attachment does not contain the source for the file Preconditions.class.

complete code bellow:

package executionEngine;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;

import org.openqa.selenium.WebDriver;

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

import org.openqa.selenium.chrome.ChromeDriver;
public class DriverScript {

private static WebDriver driver = null;

public static void main(String[] args) {
//driver = new FirefoxDriver();

System.setProperty("webdrive.chrome.driver", "C:/Users/joliena/workspace/eclipse-keller/KeywordDrivenFramework-Keller/jars/chromedriver_win32/chromedriver.exe");
driver = new ChromeDriver();
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);





driver.findElement (By.xpath(".//*[@id='account_logout']/a")).click();




Default Asked on October 13, 2014 in Selenium WebDriver.
Add Comment
  • 3 Answer(s)

    Hi jviegas,

    This seems to work for me. Can you try downloading the latest version of Chromedriver.exe from the below link.



    Doctor Answered on October 14, 2014.

    Thanks Vishal

    on October 14, 2014.
    Add Comment

    Hi Lakshay,

    I do it, but to run my code occurs erro:

    Exception in thread “main” java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.chrome.driver system property; for more information, see http://code.google.com/p/selenium/wiki/ChromeDriver. The latest version can be downloaded from http://chromedriver.storage.googleapis.com/index.html
    at com.google.common.base.Preconditions.checkState(Preconditions.java:177)
    at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:105)
    at org.openqa.selenium.chrome.ChromeDriverService.createDefaultService(ChromeDriverService.java:89)
    at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:117)
    at executionEngine.DriverScript.main(DriverScript.java:17)

    In debug I have the same problem.

    ” Source not found” the source attachment does not contain the source for the file Preconditions.class.” Source not found” the source attachment does not contain the source for the file Preconditions.class.

    Default Answered on October 16, 2014.
    Add Comment

    Please somebody can help me.

    Default Answered on October 17, 2014.
    Add Comment
  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.