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

  • SEARCH
  • Home
  • 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 8801161
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T00:45:51+00:00 2026-06-14T00:45:51+00:00

I am trying to run test cases using JUNIT 4.10 with Selenium for a

  • 0

I am trying to run test cases using JUNIT 4.10 with Selenium for a Web Application using Maven in Eclipse.

I have created a simple java project with JUNIT Test cases added proper dependency.
It works perfectly fine with Run as a JUNIT Test case but it does not work as Maven Test so something like mvn clean test is not working.

Here is my excerpt of pom.xml

    <build>
<plugins>
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.12.4</version>
    </plugin>
</plugins>

<dependencies>
<dependency>
  <groupId>junit</groupId>
  <artifactId>junit</artifactId>
  <version>4.10</version>
  <scope>test</scope>
</dependency>
<dependency>
  <groupId>org.apache.poi</groupId>
  <artifactId>poi</artifactId>
  <version>3.8</version>
  <scope>compile</scope>
</dependency>
<dependency>
    <groupId>org.seleniumhq.selenium</groupId>
    <artifactId>selenium-java</artifactId>
    <version>2.25.0</version>
    <type>jar</type>
    <scope>test</scope>
</dependency>

also here is my JUnit Test case which I wrote,

@Test()
public void testTC101() throws InterruptedException{
    driver.get(ADMIN_BASE_URL_QA);
    driver.manage().timeouts().implicitlyWait(12, TimeUnit.SECONDS);
    driver.findElement(By.xpath("//*[@id='top30Events']"));
    WebElement loanModFullEvent = driver.findElement(By.partialLinkText(QA_MOD_FULL_EVENT));
    loanModFullEvent.click();
    String clickedFullEventId = loanModFullEvent.findElement(By.xpath("..")).getAttribute("id").split("_")[1];
    List<WebElement> nearbyEvents = driver.findElements(By.id("nearby_events_" + clickedFullEventId));
    ListIterator<WebElement> wIterator = nearbyEvents.listIterator();
    WebElement element = null;
    String registerNowId = null;
    while(wIterator.hasNext()) {
        element = wIterator.next().findElement(By.linkText(QA_MOD_NONFULL_EVENT));
        element.click();
        registerNowId = element.getAttribute("onclick").replaceAll("\\D+", "");
    }
    registerNowId = "top30_" + registerNowId;
    driver.findElement(By.xpath("//*[@id='" + registerNowId + "']/div[3]/div/a")).click();              
    WebElement dropDownListBox = driver.findElement(By.xpath("//*[@id='list']"));
    Select clickThis = new Select(dropDownListBox);
    clickThis.selectByValue("mod");
    driver.findElement(By.xpath("//*[@id='situationdropdown']/div/div/div[1]/span/span/span/input")).click();
    RegistrationForm.fillFormAndSubmit();

}

Code is just for the idea, but the problem is It is running in JUnit Test case why not using maven. It says tests : 0 runs : 0 skips : 0

Why it is not recognizing the tests, I am still not sure why? Can someone help?

  • 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-14T00:45:53+00:00Added an answer on June 14, 2026 at 12:45 am

    You say that your test class name ends with Tests. That is not one of the default patterns according to the surefire plugin site: http://maven.apache.org/plugins/maven-surefire-plugin/examples/inclusion-exclusion.html

    **/Test*.java" - includes all of its subdirectories and all java filenames that start with "Test
    **/*Test.java" - includes all of its subdirectories and all java filenames that end with "Test
    **/*TestCase.java" - includes all of its subdirectories and all java filenames that end with "TestCase
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to run Selenium RC 1.0.3 using Java 6, JUnit 4, and Eclipse
I'm trying to run JUnit4 test cases on Eclipse 3.4.2 but it's not even
I'm trying to run a test version of a web using the File System
When trying to run a junit test I get the following error - java.lang.ClassCastException:
I'm using Hibernate 4.0.1.Final. I'm trying to run a JUnit test on my DAO
I am writing my unit test cases for a Java project using Scala (JUnit
I am using selenium python webdriver for my python test cases. I have a
I'm trying to import a IntelliJ java web application project (Maven Project) from a
I'm trying to run multiple test cases for a login Activity using ActivityInstrumentationTestCase2. The
I am trying to run android instrumentation Junit test using command line.I am using

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.