selenium failed to start browser in iexplore mode when selenium server is started dynamically in code

>In a previous post, i have written about how i have been starting/ stoping the selenium server dynamically. What i didnt mention was that i was not able to run my tests using Internet Explorer. I got this error

11:56:55.272 INFO - Command request: getNewBrowserSession[*iexplore, http://localhost:8080, ] on session null
11:56:55.272 INFO - creating new remote session
11:56:55.381 INFO - Allocated session 688eff769c8b4751b5fb9477bba213f3 for http://localhost:8080, launching...
11:56:55.397 ERROR - Failed to start new browser session, shutdown browser and clear all session data
java.lang.RuntimeException: C:\DOCUME~1\SAdesoga\LOCALS~1\Temp\customProfileDir688eff769c8b4751b5fb9477bba213f3\core\RemoteRunner.html (The system cannot find the file specified)
at org.openqa.selenium.server.browserlaunchers.HTABrowserLauncher.createHTAFiles(
at org.openqa.selenium.server.browserlaunchers.HTABrowserLauncher.launch(
at org.openqa.selenium.server.browserlaunchers.HTABrowserLauncher.launchRemoteSession(
at org.openqa.selenium.server.browserlaunchers.InternetExplorerLauncher.launchRemoteSession(
at org.openqa.selenium.server.BrowserSessionFactory.createNewRemoteSession(
at org.openqa.selenium.server.BrowserSessionFactory.getNewBrowserSession(
at org.openqa.selenium.server.BrowserSessionFactory.getNewBrowserSession(
at org.openqa.selenium.server.SeleniumDriverResourceHandler.getNewBrowserSession(
at org.openqa.selenium.server.SeleniumDriverResourceHandler.doCommand(
at org.openqa.selenium.server.SeleniumDriverResourceHandler.handleCommandRequest(
at org.openqa.selenium.server.SeleniumDriverResourceHandler.handle(
at org.mortbay.http.HttpContext.handle(
at org.mortbay.http.HttpContext.handle(
at org.mortbay.http.HttpServer.service(
at org.mortbay.http.HttpConnection.service(
at org.mortbay.http.HttpConnection.handleNext(
at org.mortbay.http.HttpConnection.handle(
at org.mortbay.http.SocketListener.handleConnection(
at org.mortbay.util.ThreadedServer.handle(
at org.mortbay.util.ThreadPool$
Caused by: C:\DOCUME~1\SAdesoga\LOCALS~1\Temp\customProfileDir688eff769c8b4751b5fb9477bba213f3\core\RemoteRunner.html (The system cannot find the file specified)
at Method)
at Source)
at org.openqa.selenium.server.browserlaunchers.HTABrowserLauncher.createHTAFiles(
... 19 more

This points out that selenium is trying to start in the iehta mode, even though i have specified that it start in iexplore mode. Doing i quick search i discovered that there has been some work to start up selenium in iehta even when iexplore is being specified. And the only way to get the original *iexplore is to try *iexploreproxy or piiexplore

So i changed my config file to start selenium using “*iexploreproxy” instead of “*iexplore” and voila i am able run my test on ie.

Hope this helps you too

This entry was posted in Software Testing and tagged , , , , , . Bookmark the permalink.

4 Responses to selenium failed to start browser in iexplore mode when selenium server is started dynamically in code

  1. daxel says:

    >I think this problem does not depends on Selenium Server start configuration. In my project the same code works runnning in eclipse and doesn't work starting from maven. I'm trying to understand the problem…..

  2. leumascom says:

    >the only reason i have said that the problem is due to selenium server being started dynamically in code is because when i remove that bit of the code and run selenium server from a bat file, i didnt get the same problem

  3. Padma Madala says:

    Padma: Hi Samuel, Thank you so much for ur post bcoz I had been searching for one full day to resolve this. everything works when I start testing using Eclipse + testNG, but it didnt work with maven. So finally I got ur link and it solved me the problem. But still a small problem is that IE is asking for confirmation like do you want to proceed kinda warnings. so this is something annoys, every time I cant keep track of the warnings.. 😦 and we are trying to use Jenkins to build this test cases
    Thanks in advance

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s