Junit/selenium adapter Error
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?
2 answers
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)
(1)Adding these import statements to my script:
import org.junit.Before;
(2)Added these JUnit annotations to my script:
@Before
@Test
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;
Comments
Brian Lahaie
Aug 18 '15, 12:19 a.m.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;
(2)Added these JUnit annotations to my script:
@Before
@Test
Brian Lahaie
Aug 18 '15, 12:20 a.m.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();
}
}