Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Junit/selenium adapter Error

I'm trying to run Test cases using Junit/selenium adapter.  I get these error below in my Results.


com.ibm.dashboard.AutomationMain:initializationError() java.lang.Exception: No runnable methods at org.junit.runners.BlockJUnit4ClassRunner.validateInstanceMethods(BlockJUnit4ClassRunner.java:169) at

Not sure about the values that need to be entered in Test Class, Class path fields?

Can some one please help me?


0 votes

Comments

As stated below, I was getting the same error but I was able to resolve it by:
(1)Adding these import statements to my script:
import org.junit.Before;

annotations
import org.junit.Test;
(2)Added these JUnit annotations to my script:
@Before
@Test

import java.io.File;

import org.apache.commons.io.FileUtils;
import org.openqa.selenium.OutputType;
import org.openqa.selenium.TakesScreenshot;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.junit.Before;
import org.junit.Test;

public class MyClass {
    public WebDriver driver;
    
    @Before
    public void setUp()throws Exception{
        driver = new FirefoxDriver();
    }
    
    @Test
    public void myTest() throws Exception{
           driver.get("http://www.ibm.com");
          String i = driver.getCurrentUrl();
          System.out.println(i);
          MyClass me = new MyClass();
          driver.close();
    }
}



2 answers

Permanent link
 Aparna,
If you have a moment, take a quick look at this article

https://jazz.net/library/article/755

..its a great overview on running JUnit tests in RQM

0 votes

Comments

I'm getting the error below, after following all the steps from the Article. Any recommendations to fix this error.

at java.net.URLClassLoader$1.run(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at com.ibm.rqm.adapter.commandline.JUnitLauncher.main(JUnitLauncher.java:115)

I am having a similar issue.



automationFramework.FirstTestCase:initializationError()
java.lang.Exception: No runnable methods
    at org.junit.runners.BlockJUnit4ClassRunner.validateInstanceMethods(BlockJUnit4ClassRunner.java:191)
    at org.junit.runners.BlockJUnit4ClassRunner.collectInitializationErrors(BlockJUnit4ClassRunner.java:128)
    at org.junit.runners.ParentRunner.validate(ParentRunner.java:416)
    at org.junit.runners.ParentRunner.(ParentRunner.java:84)
    at org.junit.runners.BlockJUnit4ClassRunner.(BlockJUnit4ClassRunner.java:65)
    at org.junit.internal.builders.JUnit4Builder.runnerForClass(JUnit4Builder.java:10)
    at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)


Permanent link
I was getting the same error but I was able to resolve it by:
(1)Adding these import statements to my script:
import org.junit.Before;
annotations
import org.junit.Test;
(2)Added these JUnit annotations to my script:
@Before
@Test

0 votes

Comments

After working more with RQM and Selenium I found these annotations to be more useful, @BeforeClass, @Test, and @AfterClass.  These import statements are needed to use these annotations:
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.AfterClass;

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 12,020

Question asked: Mar 27 '14, 7:24 p.m.

Question was seen: 4,277 times

Last updated: Oct 06 '15, 2:50 a.m.

Confirmation Cancel Confirm