Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 5 of 5

Thread: Failed to start new browser session: Error while launching browser on session null

  1. #1
    Junior Member
    Join Date
    Apr 2014
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Failed to start new browser session: Error while launching browser on session null

    Dear Experts,

    I am running selenium test case on eclipse IDE , but getting below error. I tried with chrome / firefox and now with exploer also.
    It gives error "Failed to start new browser session: Error while launching browser on session null" .

    What I did is :

    1. Open the selenium IDE and start running test case
    2. save the test case
    3. Export to the java remote control/webdriver/testing ( because of this error I tried all these exports).
    4. Paste the code in eclipse
    5. Added necessary jar files like junit4/selenium server/ selenium client driver ,plus two more....
    6. Run the Selenium RC server
    7. After started run the unit test case


    Please help me to solve this problem. Below is the error and code also available for your review.

    Thanks,

    ================================================== ============================================
    07:15:26.567 INFO - Checking Resource aliases
    07:15:26.617 INFO - Command request: getNewBrowserSession[*iexplore, Amazon.fr : livres, DVD, jeux vidéo, MP3, high-tech, informatique, jouets, chaussures, vêtements, sport, maison et plus encore !, ] on session null
    07:15:26.621 INFO - creating new remote session
    07:15:40.243 INFO - Allocated session ca810baec4c2448dac91d29f6e4903a1 for Amazon.fr : livres, DVD, jeux vidéo, MP3, high-tech, informatique, jouets, chaussures, vêtements, sport, maison et plus encore !, launching...
    07:15:40.249 INFO - Backing up registry settings...
    07:15:45.951 INFO - Modifying registry settings...
    07:15:46.783 ERROR - Failed to start new browser session, shutdown browser an clear all session data
    org.openqa.selenium.server.browserlaunchers.Window sUtils$WindowsRegistryException: Problem while managing the registry, OS Version '6.1', regVersion1 = false
    at org.openqa.selenium.server.browserlaunchers.Window sUtils.writeIntRegistryValue(WindowsUtils.java:555 )
    at org.openqa.selenium.server.browserlaunchers.Window sUtils.writeBooleanRegistryValue(WindowsUtils.java :560)
    at org.openqa.selenium.server.browserlaunchers.Window sProxyManager.changeRegistrySettings(WindowsProxyM anager.java:177)
    at org.openqa.selenium.server.browserlaunchers.Intern etExplorerCustomProxyLauncher.changeRegistrySettin gs(InternetExplorerCustomProxyLauncher.java:58)
    at org.openqa.selenium.server.browserlaunchers.Intern etExplorerCustomProxyLauncher.setupSystemProxy(Int ernetExplorerCustomProxyLauncher.java:156)
    at org.openqa.selenium.server.browserlaunchers.Intern etExplorerCustomProxyLauncher.setupSystem(Internet ExplorerCustomProxyLauncher.java:81)
    at org.openqa.selenium.server.browserlaunchers.Intern etExplorerCustomProxyLauncher.launch(InternetExplo rerCustomProxyLauncher.java:66)
    at org.openqa.selenium.server.browserlaunchers.Abstra ctBrowserLauncher.launchRemoteSession(AbstractBrow serLauncher.java:26)
    at org.openqa.selenium.server.BrowserSessionFactory.c reateNewRemoteSession(BrowserSessionFactory.java:3 18)
    at org.openqa.selenium.server.BrowserSessionFactory.g etNewBrowserSession(BrowserSessionFactory.java:115 )
    at org.openqa.selenium.server.BrowserSessionFactory.g etNewBrowserSession(BrowserSessionFactory.java:80)
    at org.openqa.selenium.server.SeleniumDriverResourceH andler.getNewBrowserSession(SeleniumDriverResource Handler.java:673)
    at org.openqa.selenium.server.SeleniumDriverResourceH andler.doCommand(SeleniumDriverResourceHandler.jav a:376)
    at org.openqa.selenium.server.SeleniumDriverResourceH andler.handleCommandRequest(SeleniumDriverResource Handler.java:353)
    at org.openqa.selenium.server.SeleniumDriverResourceH andler.handle(SeleniumDriverResourceHandler.java:1 14)
    at org.mortbay.http.HttpContext.handle(HttpContext.ja va:1530)
    at org.mortbay.http.HttpContext.handle(HttpContext.ja va:1482)
    at org.mortbay.http.HttpServer.service(HttpServer.jav a:909)
    at org.mortbay.http.HttpConnection.service(HttpConnec tion.java:816)
    at org.mortbay.http.HttpConnection.handleNext(HttpCon nection.java:982)
    at org.mortbay.http.HttpConnection.handle(HttpConnect ion.java:833)
    at org.mortbay.http.SocketListener.handleConnection(S ocketListener.java:244)
    at org.mortbay.util.ThreadedServer.handle(ThreadedSer ver.java:357)
    at org.mortbay.util.ThreadPool$PoolThread.run(ThreadP ool.java:534)
    Caused by: java.lang.RuntimeException: exec return code 1: ERROR: Cannot create a stable subkey under a volatile parent key.

    at org.openqa.selenium.server.browserlaunchers.Window sUtils$WindowsRegistryException.<init>(WindowsUtil s.java:647)
    ... 24 more
    07:15:46.979 INFO - Restoring registry settings (won't affect running browsers)...
    07:15:47.596 INFO - Got result: Failed to start new browser session: Error while launching browser on session null

    ================================================== ===============================

    Code is :

    =======================

     
    package Selenium1;
     
     
    import com.thoughtworks.selenium.*;
     
    import org.junit.After;
    import org.junit.Before;
    import org.junit.Test;
    import static org.junit.Assert.*;
    //import java.util.regex.Pattern;
     
    	public class ama_sel_jremoteControl {
    		private Selenium selenium;
     
    		@Before
    		public void setUp() throws Exception {
    			selenium = new DefaultSelenium("localhost", 4444, "*iexplore", "http://www.amazon.fr/");
    			selenium.start();
    		}
     
    		@Test
    		public void testAma_sel_jremoteControl() throws Exception {
    			selenium.open("/");
    			selenium.select("id=searchDropdownBox", "label=Informatique");
    			selenium.click("css=option[value=\"search-alias=computers\"]");
    			selenium.type("id=twotabsearchtextbox", "ddr2 pc2-5300 sodimm 4go");
    			selenium.click("css=input.nav-submit-input");
    			selenium.waitForPageToLoad("3000");
    			selenium.click("css=#result_1 > h3.newaps > a > span.lrg.bold");
    			selenium.waitForPageToLoad("30000");
    			assertEquals("Komputerbay 4Go 2X 2Go DDR2 667 MHz PC2-5300 PC2-5400 DDR2 667 (200 PIN) SODIMM mémoire d'ordinateur portable: Amazon.fr: Informatique", selenium.getTitle());
    			verifyEquals("KOMPUTERBAY", selenium.getText("link=KOMPUTERBAY"));
    			verifyTrue(selenium.isElementPresent("link=KOMPUTERBAY"));
    		}
     
    		private void verifyTrue(boolean elementPresent) {
    			// TODO Auto-generated method stub
     
    		}
     
    		private void verifyEquals(String string, String text) {
    			// TODO Auto-generated method stub
     
    		}
     
    		@After
    		public void tearDown() throws Exception {
    			selenium.stop();
    		}
    	}
    Last edited by saoley; April 27th, 2014 at 06:06 AM.


  2. #2
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,517
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: Failed to start new browser session: Error while launching browser on session null

    Please post your code correctly. Since I failed to welcome you when you first visited, here's a link to read that shows how to post code in code or highlight tags and includes other useful info for new members. Posting complete error message/stack traces is also appreciated, but if long, posting in code or highlight tags is also helpful.

    Thread moved.

  3. #3
    Junior Member
    Join Date
    Apr 2014
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: Failed to start new browser session: Error while launching browser on session null

    Hello,
    Can you tell me, how to move thread from one to another like webframework to another?
    About message, I feel its important to present this much information for the reader to understand the problem.
    made changes in post as said in announcements. ....

  4. #4
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,517
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: Failed to start new browser session: Error while launching browser on session null

    Just let me know where you think it best fits.

  5. #5
    Junior Member
    Join Date
    Apr 2014
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: Failed to start new browser session: Error while launching browser on session null

    As I am new to this forum, also completely new in java . Cant decide the "best fits" .
    But after searching here about selenium, most threads are in 'whats wrong with my code'. So probably this is the "best" or you think (since you are expert ) this should be in web framework, then also fine. I just want solution of it. thnk u

Similar Threads

  1. Replies: 16
    Last Post: March 7th, 2014, 02:22 AM
  2. How to check if a session object exists (or is not null)?
    By BimmyJim in forum What's Wrong With My Code?
    Replies: 1
    Last Post: January 6th, 2014, 10:10 AM
  3. Replies: 2
    Last Post: August 20th, 2013, 11:06 AM
  4. Replies: 0
    Last Post: May 22nd, 2012, 09:08 AM