test class not found in selected project

1,435 views
Skip to first unread message

Prasad Bodke

unread,
Apr 11, 2011, 7:07:48 AM4/11/11
to seleniu...@googlegroups.com
Hi

I am facing error in JUnit 4.8.2 with eclipse
test class not found in selected project.

import com.thoughtworks.selenium.*;
import junit.framework.*;
import junit.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import java.util.regex.Pattern;

public class GoogleSignIn extends SeleneseTestCase
{
    @Before
    public void setUp() throws Exception
    {
        selenium = new DefaultSelenium("localhost", 4444, "*chrome", "https://www.google.com/");
        selenium.start();
        System.out.println("Server Started");
    }

    @Test
    public void GoogleSignIn() throws Exception
    {
        selenium.open("/accounts/ServiceLogin?service=mail&passive=true&rm=false&continue=http%3A%2F%2Fmail.google.com%2Fmail%2F%3Fui%3Dhtml%26zy%3Dl&bsv=llya694le36z&scc=1&ltmpl=default&ltmplcache=2");
        selenium.type("Email", "---------------");
        selenium.type("Passwd", "-----------------");
        selenium.click("signIn");
        selenium.waitForPageToLoad("30000");
        selenium.waitForPageToLoad("");
        selenium.click(":qy");
        selenium.waitForPageToLoad("30000");
    }

    @After
    public void tearDown() throws Exception
    {
        selenium.stop();
    }
}

--
Prasad Bodke
9320675131

Lutfi Dughman

unread,
Apr 11, 2011, 12:04:04 PM4/11/11
to seleniu...@googlegroups.com
which class is not found? Also when you do imports dont use the star '*' every class should have its own import. (this is just a convention and wont make a difference for compiler)

--
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.

Prasad Bodke

unread,
Apr 12, 2011, 2:35:38 AM4/12/11
to seleniu...@googlegroups.com
Hi
Thanks for reply.

now I got another error, if I insert same code with try catch block

java.lang.RuntimeException: Could not contact Selenium Server; have you started it on 'localhost:4444' ?
Read more at http://seleniumhq.org/projects/remote-control/not-started.html
Connection refused: connect
 
and If I started selenium server from console, its only launch browser but test case steps not process.

Why selenium server not starting automatically through given code???
--
Prasad Bodke
9320675131

Prasad Bodke

unread,
Apr 12, 2011, 2:55:36 AM4/12/11
to V Ramasamy, seleniu...@googlegroups.com
Hi Ramasamy,

still its not starting, also I change port number.

code is as follows:
   @Before
    public void setUp()
    {
        try
        {
            Selenium selenium = new DefaultSelenium("localhost", 4545, "*chrome", "https://www.google.com/");

            selenium.start();
            System.out.println("Server Started");
        }
        catch(Exception e)
        {
            e.printStackTrace();
        }
    }


On Tue, Apr 12, 2011 at 12:09 PM, V Ramasamy <ramasamy....@gmail.com> wrote:
Can you change your code like below and see if it works?

public void setUp() throws Exception 
    {
        Selenium selenium = new DefaultSelenium("localhost", 4444, "*chrome", "https://www.google.com/");



--
Prasad Bodke
9320675131

V Ramasamy

unread,
Apr 12, 2011, 4:05:16 AM4/12/11
to Prasad Bodke, seleniu...@googlegroups.com
Can you try like below
 

import org.openqa.selenium.server.SeleniumServer;

public class GoogleSignIn extends SeleneseTestCase

{

private static SeleniumServer seleniumServer;

private static Selenium selenium = new DefaultSelenium("localhost",4444,"*chrome","http://www.google.com");

 

@Before

public static void setUp() throws Exception seleniumServer = new SeleniumServer();

        seleniumServer.start();

        selenium.start();

}

 

@After

public static void tearDown() throws Exception

{

    selenium.stop();

    seleniumServer.stop();

}

 

}

Reply all
Reply to author
Forward
0 new messages