1

I am learning Selenium with the aim of exporting UI tests into JUnit tests and then running them in a CI build.

As a basic test I have a Suite.java and a BasicTest.java which is a test case.

I have used the Selenium export and saved the files to the same location.

When I try and compile the tests it fails.

1st Error - http://pastebin.com/0j37KZ08

To get past this error I add an import to the Suite.java for the BasicTest class, which then gives me the following error:

2nd Error - http://pastebin.com/PKxmdj3L

Source code:

Suite.java - http://pastebin.com/Q6HVNtqT
BasicTest.java - http://pastebin.com/fKCk6iN2
Ant build.xml - http://pastebin.com/x16zHKP0

Any help appreciated.

2
  • what IDE do you use to develop your tests? Commented Mar 25, 2014 at 13:59
  • They have been generated through Selenium IDE and I'm using Ant to compile/run Commented Mar 25, 2014 at 14:04

1 Answer 1

1

I don't know if you need a Suite here. The issue seems to be that you are calling addTestSuite() with your BasicTest.class which does not extend junit.framework.TestCase. You should see this if you scrutinize the second error message closely. Of course, you would not subclass junit.framework.TestCase for a JUnit4-style test, so there's a disconnect here as far as what the Suite/framework expects and what you are providing. Maybe just avoid using a suite altogether--personally, I haven't bothered much with suites for some time now. Or, if you are following an example that insists on a suite, you can switch over to the JUnit3-style for purposes of learning.

EDIT: This link should help with JUnit4-style suites if you decide you want to keep the suite.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks to move forward I have ditched the Suite and just using the TestCases.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.