Selenium - Java beginner question.

31 views
Skip to first unread message

Chinmay Shepal

unread,
Mar 24, 2011, 3:51:54 PM3/24/11
to Selenium Users
Hi All,

I am learning seleniumRC and trying to open google.com
I have added extenal jars as slelenium-client.jar and junit4.8.1.jar.
My java eclipse version is :
Version: 3.5.1.R35x_v20090910-9gEeG1_FthkNDSP2odXdThaOu9GFDPn83DGB7
Build id: M20090917-0800

I have written only code as :
package src;

import com.thoughtworks.selenium.*;

public class launcher extends SeleneseTestCase{
public void setUp()throws Exception {
System.out.println("...");
setUp("http://www.google.com", "*firefox");
System.out.println("setup");
}

public void launch() throws Exception {
selenium.open("/");
selenium.wait(30000);
}

}

and I am getting following error message:

launcher (1)
src.launcher
warning(junit.framework.TestSuite$1)
junit.framework.AssertionFailedError: No tests found in src.launcher
at junit.framework.Assert.fail(Assert.java:47)
at junit.framework.TestSuite$1.runTest(TestSuite.java:263)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at
org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:
130)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:
38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:
467)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:
683)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:
390)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:
197)

Can some one help me out?

Mohammed Sikander

unread,
Mar 28, 2011, 12:58:41 AM3/28/11
to seleniu...@googlegroups.com
Add @Test annotation to your test method... like the following.

@Test 
public void launch() throws Exception {
               selenium.open("/");
               selenium.wait(30000);
       }

Looking at the error description, adding @Test annotations to your test method your tests should work now.


--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.


Chinmay Shepal

unread,
Mar 28, 2011, 1:51:12 PM3/28/11
to seleniu...@googlegroups.com, Mohammed Sikander
Thanks for the inputs.
Actually I was using selenium-server 1.0.1 jar it was not starting firefox 3.6.16.
So I upgraded my selenium-server1.0.3 jar and now its working fine.
-
Chinmay
Reply all
Reply to author
Forward
0 new messages