Sunday, November 9, 2008

PseudoTestRunner.html to run Selenium Chrome by cmdline

Launch Selenium Chrome TestRunner by cmdline: firefox.exe -chrome "chrome://selenium-ide-testrunner/content/selenium/TestRunner.html..." will cause many weird issues on Firefox.
I'm not sure the root cause which maybe related to Firefox Chrome Security Strategy for -chrome parameter.

Here is a workaround:
Hijack selenium-ide.xpi. Under selenium-ide\content\selenium\ add a file PseudoTestRunner.html
<head><title>Pseudo Test Runner - Used for launch Chrome by Cmdline</title></head>
  <script language="javascript"> 
  var strHref;
  var intParamsStartIndex;
  var strParams;
  strHref = window.location.href;
  intParamsStartIndex = strHref.indexOf("?");
  strParams = strHref.substring(intParamsStartIndex);"chrome://selenium-ide-testrunner/content/selenium/TestRunner.html" + strParams);
Then please always use PseudoTestRunner.html instead of TestRunner.html in cmdline, keep the same parameter list in URL.

Refer to topic:

No comments:

Post a Comment