User Tag List

Results 1 to 2 of 2
  1. #1
    Junior Member
    Join Date
    Feb 2010
    Post Thanks / Like
    0 Post(s)
    0 Thread(s)

    Problem executing Selenium script (Eclipse/Junit)

    Hi ,

    I am trying to use Selenium RC and Java to Automate my test cases. The RC version i am using is selenium-remote-control-1.0-beta-2 . And the browers i have are Firefox 3.6 and internet explorer 7.0.6000

    Here is my sample script

    package com.example.tests;
    import com.thoughtworks.selenium.*;
    //This is the driver's import. You'll use this for instantiating a
    //browser and making it do what you need.

    import java.util.regex.Pattern;
    //Selenium-IDE add the Pattern module because it's sometimes used for
    //regex validations. You can remove the module if it's not used in your

    public class Mytest extends SeleneseTestCase {
    // We create our Selenium test case

    public void setUp() throws Exception {
    setUp("http://google.com", "*iehta");
    // We instantiate and start the browser

    public void testNew() throws Exception {
    selenium.type("q", "selenium rc");
    assertTrue(selenium.isTextPresent("Results * for selenium rc"));
    // These are the real test steps

    The problem is , when i use the browser option as Firefox or chrome , and when i run in junit i am getting below exception . And its not opening the firefox window and not running the test case

    15:22:04.117 ERROR - Failed to start new browser session, shutdown browser and c
    lear all session data
    java.lang.RuntimeException: Firefox refused shutdown while preparing a profile
    at org.openqa.selenium.server.browserlaunchers.Firefo xChromeLauncher.wai
    tForFullProfileToBeCreated(FirefoxChromeLauncher.j ava:267)

    When i use the browser as internet explorer, and run the test case , i can see that test case starts running ,but after explorer opens my website ( google.com ), it is getting hanged and am getting the below exception

    <error>com.thoughtworks.selenium.SeleniumExc eption: Timed out after 30000ms at com.thoughtworks.selenium.HttpCommandProcessor.thr owAssertionFailureExceptionOrError(HttpCommandProc essor.java:97) at com.thoughtworks.selenium.HttpCommandProcessor.doC ommand(HttpCommandProcessor.java:91) at com.thoughtworks.selenium.DefaultSelenium.open(Def aultSelenium.java:335) at com.example.tests.Mytest.testNew(Mytest.java:20) at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknow n Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Un known Source) at java.lang.reflect.Method.invoke(Unknown Source) 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.ja va: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:2 32) at junit.framework.TestSuite.run(TestSuite.java:227) at org.junit.internal.runners.JUnit38ClassRunner.run( JUnit38ClassRunner.java:83) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestR eference.run(JUnit4TestReference.java:46) at org.eclipse.jdt.internal.junit.runner.TestExecutio n.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.main(RemoteTestRunner.java:197)</error>

    Can you please help me regarding this

    Thanks in advance

  2. #2
    Advanced Member
    Join Date
    Feb 2008
    Ahmedabad, India
    Post Thanks / Like
    0 Post(s)
    0 Thread(s)

    Re: Problem executing Selenium script (Eclipse/Junit)

    I don't think selenium yet supports firefox 3.6 try using firefox 3.5.

    And about the timeout error. Try using this before other lines of testcases.

    The default timeout for the page is 3 seconds which you can increase by the above method.
    GauranG Shah
    I don't make the software, Rather I make it better.
    My Blogs:
    All About Automation
    Spell Checker



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 02:16 PM.

Copyright BetaSoft Inc.