Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9230011
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T05:42:57+00:00 2026-06-18T05:42:57+00:00

I am new to JUnit and selenium server so any help is appreciated. I

  • 0

I am new to JUnit and selenium server so any help is appreciated.

I am running ubuntu 12 with java 7 and selenium ide and server. I created a simple login test script with selenium IDE, and exported it to Java/Junit4/webdriver.

I then compiled that script using the following command

javac -cp .:/usr/share/java/junit4.jar -cp .:/home/sakamoto/SeleniumServer/selenium-server-standalone-2.28.0.jar LoginTest.java

This seemed to go through without any errors (or any messages to the terminal for that matter).

I am seeing this error when trying to run the unit test that was generated from selenium ide exporting to JUnit4 webdriver:

java -cp /home/sakamoto/SeleniumServer/selenium-server-standalone-2.28.0.jar org.junit.runner.JUnitCore com.example.tests.LoginTest
JUnit version 4.11
Could not find class: com.example.tests.LoginTest

Time: 0.001

OK (0 tests)

sakamoto@ubuntu:~/Workspace$

I also have the following lines at the end of my .bashrc file and was able to run the sample test with junit4.

export CLASSPATH=.:/usr/share/java/junit4.jar
export CLASSPATH=.:/usr/share/java/junit.jar

So … How do I get rid of the Could not find class: problem and run the script?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T05:42:58+00:00Added an answer on June 18, 2026 at 5:42 am

    It seems that junit cannot find your LoginTest.class file on the classpath.

    Assuming you have a directory structure like this:

    /home/sakamoto/my-project/com/examples/tests/LoginTest.class
    

    Then, try explicitly including the path to the my-project directory inside the classpath. For example, try this:

     java -cp /home/sakamoto/SeleniumServer/selenium-server-standalone-2.28.0.jar:/home/sakamoto/my-project org.junit.runner.JUnitCore com.example.tests.LoginTest
    

    I think that junit is uses classpath+package name to determine the location of LoginTest test. I’m guessing/hoping that junit will 1) find /home/sakamoto/my-project is in the classpath and it will 2) append the package directory com/examples/tests so that it looks for LoginTest.class inside /home/sakamoto/my-project/com/examples/tests.

    It’s been a while since I used selenium and, unfortunately, I don’t have selenium set up or I’d test this! But hope that works.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am fairly new to Java. I have constructed a single JUnit test class
I am new to Selenium. I generated my first java selenium test case and
So I created a new Android junit test, which runs my ui-automation tests (Robotium,
I have following methods of my class Test : (Selenium RC, JUnit, Java, Eclipse)
Please, I am new to Java. How can I write a JUnit test for
I am new to junit testing. Can anyone help me , how to test
I am new to junit testing and I have the following test - public
I am very new to JUnit testing, I am trying to test the following
I am new to JUnit and Android and good test documentation for working with
I am attempting to run a JUnit Test from a Java Class with: JUnitCore

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.