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(); } }