SeleniumException: Timed out after 3000ms

122 views
Skip to first unread message

rechu

unread,
Dec 21, 2009, 6:30:34 AM12/21/09
to Selenium Users
Hi,

I am in the process of creating a Selenium Base Test Framework using
Selenium RC, and JUnit. I have java class as below mentioned. When I
execute google_indira.java SeleniumException is thrown after
selenium.open(/itsc); line. I tried increasing the timeout.But after
that also i am getting the same exception.

package testscripts;

import com.thoughtworks.selenium.*;
import java.util.regex.Pattern;

public class google_indira extends SeleneseTestCase {
public void setUp() throws Exception {
setUp("http://www.google.co.in/#hl=en&source=hp&q=indira+gandhi
+biography&meta=&aq=1&oq=indira+gandhi&fp=1&cad=b/", "*chrome");
}
public void testGoogle_indira() throws Exception {
selenium.open("/#hl=en&source=hp&q=indira+gandhi
+biography&meta=&aq=1&oq=indira+gandhi&fp=4d4253465e0f1045");
selenium.click("//ol[@id='rso']/li[1]/h3/a/em[1]");
selenium.click("//a[contains(text(),'Bhagat\n Singh')]");
selenium.waitForPageToLoad("30000");
selenium.click("//a[contains(text(),'Rajiv\n Gandhi')]");
selenium.waitForPageToLoad("30000");
selenium.click("//a[contains(text(),'Sarojini\n Naidu')]");
selenium.waitForPageToLoad("30000");
}
}

and the error trace is

com.thoughtworks.selenium.SeleniumException: Timed out after 30000ms
at
com.thoughtworks.selenium.HttpCommandProcessor.throwAssertionFailureExceptionOrError
(HttpCommandProcessor.java:97)
at com.thoughtworks.selenium.HttpCommandProcessor.doCommand
(HttpCommandProcessor.java:91)
at com.thoughtworks.selenium.DefaultSelenium.open
(DefaultSelenium.java:335)
at testscripts.google_indira.testGoogle_indira(google_indira.java:11)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at junit.framework.TestCase.runTest(TestCase.java:168)
at junit.framework.TestCase.runBare(TestCase.java:134)
at com.thoughtworks.selenium.SeleneseTestCase.runBare
(SeleneseTestCase.java:212)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at org.junit.internal.runners.JUnit38ClassRunner.run
(JUnit38ClassRunner.java:90)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run
(JUnit4TestReference.java:38)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run
(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests
(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests
(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run
(RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main
(RemoteTestRunner.java:196)

Please provide me a solution for this exception.

darrell

unread,
Dec 21, 2009, 1:41:39 PM12/21/09
to Selenium Users
Have you tried using:

setUp("http://www.google.co.in/", "*chrome");

I've never tried using the base url with context root in the call to
setUp(). I use just the base url then place the context root in the
open() call.

Volvox

unread,
Dec 21, 2009, 1:51:00 PM12/21/09
to Selenium Users
I'm new at answering questions, but I'll give it a shot.

I see that the setUp URL ends in a slash and the open one starts with
one. Maybe the two slashes together cause an invalid URL? I'm
guessing the timeouts you manually specify do not matter since it
cannot get past the open call.

rechu

unread,
Dec 22, 2009, 12:30:33 AM12/22/09
to Selenium Users
i tried using base_url..its not working same error is happening.

On Dec 21, 11:41 pm, darrell <darrell.grain...@gmail.com> wrote:
> Have you tried using:
>
>         setUp("http://www.google.co.in/", "*chrome");
>
> I've never tried using the base url with context root in the call to
> setUp(). I use just the base url then place the context root in the
> open() call.
>
> On Dec 21, 6:30 am, rechu <resmisan...@gmail.com> wrote:
>
> > Hi,
>
> > I am in the process of creating aSeleniumBase Test Framework using

> >SeleniumRC, and JUnit. I have java class as below mentioned. When I

rechu

unread,
Dec 22, 2009, 12:31:19 AM12/22/09
to Selenium Users
i removed the slash and checked it...in the browser its showing the
correct url but the response is timeout

On Dec 21, 11:51 pm, Volvox <vol...@inbox.com> wrote:
> I'm new at answering questions, but I'll give it a shot.
>
> I see that the setUp URL ends in a slash and the open one starts with
> one.  Maybe the two slashes together cause an invalid URL?  I'm
> guessing the timeouts you manually specify do not matter since it
> cannot get past the open call.
>
> On Dec 21, 3:30 am, rechu <resmisan...@gmail.com> wrote:
>
> > Hi,
>

> > I am in the process of creating aSeleniumBase Test Framework using

> >SeleniumRC, and JUnit. I have java class as below mentioned. When I

Belter

unread,
Dec 22, 2009, 3:53:56 AM12/22/09
to Selenium Users
You don't seem to have a selenium.start(); step, maybe it is not
required when the setup() method is used.

I use the 'defaultSelenium' setup which includes the following:

Selenium selenium = new DefaultSelenium("localhost", 4444,
"*chrome", "http://www.google.co.in");
selenium.start();
selenium.selectWindow("null");
selenium.open("http://www.google.co.in/
#hl=en&source=hp&q=indira+gandhi");

I have put the full http line in the selenium.open step, but the split
one starting /#hl should work aswell.

The 'start' method opens the selenium control window and the 'open'
command starts the test browser.

HTH

> > > com.thoughtworks.selenium.HttpCommandProcessor.throwAssertionFailureExcepti­onOrError

> > > Please provide me a solution for thisexception.- Hide quoted text -
>
> - Show quoted text -

Reply all
Reply to author
Forward
0 new messages