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? |
2 answers
![]()
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 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:
|
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.
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;
(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();
}
}