Skleroz / js-test-driver

Automatically exported from code.google.com/p/js-test-driver
0 stars 0 forks source link

Is it possible to force to specific DOC-type/document mode? #447

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Running tests with IE9 installed on client machine.
2. Tests fails as production code expects "document mode" IE8. 

What is the expected output? What do you see instead?
Is there any way to start/run the js-test-driver in IE8 document mode when 
having IE9 installed, sending  your own DOC type and <meta>?

What version of the product are you using? On what operating system?
Js-test-driver 1.3.4, Windows7 and IE9

Please provide any additional information below.

I've tried to load a script that adds meta tags at start up by adding a script 
like this in the jsTestDriver.conf.

.... 
load: 
   - js/bootstrap-IE8.js

and in the bootstrap file:

(function(){
    var meta = document.createElement('meta');
    meta.setAttribute('http-equiv','X-UA-Compatible');
    meta.setAttribute('content','IE=8');

    var meta2 = document.createElement('meta');
    meta2.setAttribute('Content-Type','X-UA-Compatible');
    meta2.setAttribute('content','text/html; charset=utf-8');

    var tophead = top.document.getElementsByTagName('head')[0];
    var toptitle = tophead.firstChild;
    console.log("Lägger in på: " +  toptitle);
    head.insertBefore(meta, toptitle);
    head.insertBefore(meta2, toptitle);
})();

Tried to insert in js-test-driver frames as well but with no luck...

Original issue reported on code.google.com by urban.an...@gmail.com on 5 Dec 2013 at 12:42