Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

First of all I have recorded the script in Selenium IDE, then exported into the junit4 (RC), then copied the junit4 (RC) code into Eclipse IDE. When I run the project with junit test, I found the error below. (I have included all the jars in eclipse.)


java.lang.NoClassDefFoundError: com/google/common/base/Charsets
    at com.thoughtworks.selenium.HttpCommandProcessor.getOutputStreamWriter(
    at com.thoughtworks.selenium.HttpCommandProcessor.getCommandResponseAsString(
    at com.thoughtworks.selenium.HttpCommandProcessor.executeCommandOnServlet(
    at com.thoughtworks.selenium.HttpCommandProcessor.doCommand(
    at com.thoughtworks.selenium.HttpCommandProcessor.getString(
    at com.thoughtworks.selenium.HttpCommandProcessor.start(
    at com.thoughtworks.selenium.DefaultSelenium.start(
    at com.example.tests.MyFirstSelenium.setUp(
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(
    at org.junit.internal.runners.statements.RunBefores.evaluate(
    at org.junit.internal.runners.statements.RunAfters.evaluate(
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(
    at org.junit.runners.ParentRunner.runChildren(
    at org.junit.runners.ParentRunner.access$000(
    at org.junit.runners.ParentRunner$1.evaluate(
    at org.junit.internal.runners.statements.RunBefores.evaluate(
    at org.junit.internal.runners.statements.RunAfters.evaluate(
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(

I am really stuck at this point. Below is my exported code:

package com.example.tests;

import com.thoughtworks.selenium.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

public class MyFirstSelenium extends SeleneseTestBase {
    public void setUp() throws Exception {
        selenium = new DefaultSelenium("localhost", 4444, "*chrome", "");

    public void testUntitled() throws Exception {"/friend_circle/admin/login");
        selenium.type("id=username", "admin");
        selenium.type("id=pass", "admin");"id=submit");

    public void tearDown() throws Exception {
share|improve this question
Welcome to SQA, vinod. Selenium ships with lots of additional jar files. Is is possible that your Eclipse project does not include them all? com/google/common/base/Charsets is part of the guava jar. – user246 Apr 17 '12 at 14:08
Hi i Include all the external jars into my eclipse IDE ,But i did not include the guava.jar. Has guava.jar is useful to the run the Test case. – vinod guneja Apr 18 '12 at 6:05

I assume that you are not using stand-alone jar of selenium. Can you download Selenium Server Standalone jar and use it in eclipse. This is the only jar you need from selenium-java as it encompasses all required class files. You can remove other Selenium related jars from your eclipse.

share|improve this answer
HI tarun, Thanks for your replay, Now Its working for me. – vinod guneja Apr 18 '12 at 9:14
@vinodguneja once an answer helps you, you can accept it as right answer – Tarun Apr 18 '12 at 11:01

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.