views:

124

answers:

4

i am using simpletest as my php unit test framework.

i put all my test cases into a single all_tests.php file

however, because of the tendency of our developers to use firefox to run the all_tests.php, we tend to miss out on fail cases that are browser specific, especially ie7.

is there a way that when somebody browse our all_tests.php in firefox, it will trigger automatically an ie window to open for the same page?

A: 

Not that I'm aware of - it would be something of a security hole if a web page could run arbitrary programs off your harddrive.

You could maybe write a simple Firefox extension to do it, or, if you are on Windows, use (or modify) IETab somehow.

robertc
you can't programmatically open an FF tab in IE can you? not in my experience.
thephpdeveloper
I don't think so, though there was someone who wrapped the Gecko rendering engine up as an ActiveX component a few years ago, so you could theoretically use that. However, I'm suggesting the opposite - programmatically opening an IE tab in FF using an extension.
robertc
ah ok wait. i said it the other way round. how can you use javascript to open an IEtab in FF?
thephpdeveloper
If you're running that javascript from within an extension, then yes.
robertc
+1  A: 

hi KS! write command batch file that opens all the windows.

@echo off
set URL="http://example.com/"
cd "C:\Program Files\Internet Explorer"
iexplore %URL%
cd "C:\Program Files\Mozilla Firefox"
firefox %URL%
thephpdeveloper
closest thing to do it without spending more time to write an extension from scratch.
keisimone
A: 

Aside from possibly making (or using an existing) addon, i would say no. It would pose a serious security threat.

code_burgar
+3  A: 

There is a way, but the browser will ask for permition before doing it.

You can use this script to open Internet Explorer (but don't forget it will only work if user accepts the security warning)

function runExeOnMozilla(path/*as string*/,args/*as array*/) {
    try{
     netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
     var file = Components.classes["@mozilla.org/file/local;1"]
                    .createInstance(Components.interfaces.nsILocalFile);
      file.initWithPath(path);
     var process = Components.classes["@mozilla.org/process/util;1"]
                    .createInstance(Components.interfaces.nsIProcess);
      process.init(file);
      process.run(false, args, args.length);
    } catch(err){
     alert('access denied');
    }
}
Cleiton
In current versions of FF, that fires an ACCESS_DENIED without a prompt unless you tweak your settings.
EricLaw -MSFT-