History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: SRC-334
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: ac
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Selenium Remote Control

browser startup in "iehta" mode fails when selenium server is started programmatically

Created: 28/Aug/07 03:56 PM   Updated: 12/Aug/08 05:35 PM
Component/s: Client Driver - Java
Affects Version/s: 0.9.0
Fix Version/s: None

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown
Environment: winXP/IE 6.x


 Description  « Hide
I am using TestNG with ant to run Selenium scripts.

Selenium jars are located 2 directories down below ant build file.

My ant build file location: \perforce\WebEng\monthly\javaweb
Selenium jars location: \perforce\WebEng\monthly\javaweb\qa_test\lib

If I start selenium server manually and run TestNG+ant script, "ieahta" works fine.

However, selenium.start() in "iehta" mode fails when I start server programmaticaly from within TestNG+ant script.

Exception:

[testng] Starting browser...
  [testng] GET: cmd=getNewBrowserSession&1=*iehta&2=http%3A%2F%2Fqa.test.com%2FLogin
  [testng] overriding browser mode w/ forced browser mode setting: *iehta
  [testng] Aug 28, 2007 1:29:19 PM org.mortbay.http.HttpConnection exception
  [testng] WARNING: GET /selenium-server/driver/?cmd=getNewBrowserSession&1=*iehta&2=http%3A%2F%2Fqa.test.com%2FLog
n HTTP/1.1
  [testng] java.lang.RuntimeException: java.io.FileNotFoundException: C:\DOCUME~1\qa\LOCALS~1\Temp\customProfileD
r959482\core\RemoteRunner.html (The system cannot find the file specified)
  [testng] at org.openqa.selenium.server.browserlaunchers.HTABrowserLauncher.createHTAFiles(HTABrowserLauncher.java
87)
  [testng] at org.openqa.selenium.server.browserlaunchers.HTABrowserLauncher.launch(HTABrowserLauncher.java:56)
  [testng] at org.openqa.selenium.server.browserlaunchers.HTABrowserLauncher.launchRemoteSession(HTABrowserLauncher
java:114)
  [testng] at org.openqa.selenium.server.SeleniumDriverResourceHandler.getNewBrowserSession(SeleniumDriverResourceH
ndler.java:470)
  [testng] at org.openqa.selenium.server.SeleniumDriverResourceHandler.doCommand(SeleniumDriverResourceHandler.java
316)
  [testng] at org.openqa.selenium.server.SeleniumDriverResourceHandler.handleCommandRequest(SeleniumDriverResourceH
ndler.java:296)
  [testng] at org.openqa.selenium.server.SeleniumDriverResourceHandler.handle(SeleniumDriverResourceHandler.java:12
)
  [testng] at org.mortbay.http.HttpContext.handle(HttpContext.java:1530)
  [testng] at org.mortbay.http.HttpContext.handle(HttpContext.java:1482)
  [testng] at org.mortbay.http.HttpServer.service(HttpServer.java:909)
  [testng] at org.mortbay.http.HttpConnection.service(HttpConnection.java:816)
  [testng] at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:982)
  [testng] at org.mortbay.http.HttpConnection.handle(HttpConnection.java:833)
  [testng] at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)
  [testng] at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
  [testng] at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
  [testng] Caused by: java.io.FileNotFoundException: C:\DOCUME~1\qa\LOCALS~1\Temp\customProfileDir959482\core\RemoteRunner.html (The system cannot find the file specified)
  [testng] at java.io.FileInputStream.open(Native Method)
  [testng] at java.io.FileInputStream.<init>(FileInputStream.java:106)
  [testng] at org.apache.tools.ant.util.FileUtils.copyFile(FileUtils.java:630)
  [testng] at org.apache.tools.ant.util.FileUtils.copyFile(FileUtils.java:477)

  [testng] at org.apache.tools.ant.util.FileUtils.copyFile(FileUtils.java:442)

  [testng] at org.apache.tools.ant.util.FileUtils.copyFile(FileUtils.java:410)
  [testng] at org.apache.tools.ant.util.FileUtils.copyFile(FileUtils.java:347)
  [testng] at org.openqa.selenium.server.browserlaunchers.HTABrowserLauncher.createHTAFiles(HTABrowserLauncher.java
85)
  [testng] ... 15 more
  [testng] SERVER MODE2:*iehta



Exmple of my code:
SeleniumServer server = new SeleniumServer(4444);
server.start();
sleep(10000);
SeleniumServer.setForcedBrowserMode("*iehta");
QAReporter.log("CREATING BROWSER SESSION (executed browserSession = new DefauttSelenium(localhost,4444, *iehta,()...");
DefaultSelenium browserSession = new DefaultSelenium("localhost",4444, "*iehta","http://qa.test.com/Login");
sleep(10000);
QAReporter.log("BROWSER STARTUP (executed browserSession.start())...");
browserSession.start();
sleep(10000);
QAReporter.log("SERVER MODE2:"+SeleniumServer.getForcedBrowserMode());









 All   Comments   Work Log   Change History      Sort Order:
ac - 28/Aug/07 07:37 PM
Code sample provided in the bugs works fine in "iexplorer" mode pointed to a non-https utl and fails with "iehta" (to the same regular http url).

selvan - 30/May/08 01:16 AM
"createHTAFiles" method of HTABrowserLauncher, tries to copy files under "/core" before lanuching IE HTA browser. Unfortunately, "/core" folder exists in selenium-server-XXX.jar and selenium-server-XXX-standalone.jar.
"core" folder inside selenium-server-XXX.jar contains only "selenium-version.js", where as "core" folder inside selenium-server-XXX-standalone.jar contains all required files to drive the test.

Quick fix to above problem is : add selenium-server-XXX-standalone.jar into your classpath before selenium-server-XXX.jar.