使用shdocvw.InternetExplorer时,以编程方式更改IE的兼容模式 [英] Changing the compatibility mode of IE programmatically when working with shdocvw.InternetExplorer

查看:541
本文介绍了使用shdocvw.InternetExplorer时,以编程方式更改IE的兼容模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经阅读了很多关于此的论坛。我不是在这个服务器端工作,也不是在客户端工作。我正在和我公司的质量保证部门合作。我们在.Net Framework中内置了一个内部测试软件,用于测试我们公司的各种网站。我们更喜欢在版本9中完成对Internet Explorer的测试。

I have read many forums about this. I am not working on this server side nor on the client side. I am working with the Quality Assurance department of my company. We have an in house testing software built in the .Net Framework for testing our companies various websites. We prefer our testing for Internet Explorer be done in Version 9.

我面临的问题是我们测试的特定网站使用meta标签将IE设置为使用兼容模式7(IE 7)。设置完成后,将其重置为9的唯一方法是手动进入IE开发工具并将其切换回IE9。我已阅读有关使用注册表项值来切换它,并尝试没有成功。我也在尝试尝试一些如何操作HTMLDocument来更改或插入head标签,meta标签并将其设置为IE9。

The problem I am facing is that a specific site that we test, uses the meta tag to set IE to use compatibility mode 7 (IE 7). When this gets set, the only way to reset it to 9 is to manually go into IE development tools and switch it back to IE9. I have read about using the registry key value to switch it, and have tried without success. I was also exploring the idea of trying to some how manipulate the HTMLDocument to change that or insert in the the head tag, the meta tag and set it to IE9.

我很感激任何人的建议或有用文章或论坛的链接。我们使用ShDocVW.InternetExplorer与mshtml库一起运行我们的测试。

I would appreciate anyone's suggestions or links to helpful articles or forums. We are using the ShDocVW.InternetExplorer to run our tests along with the mshtml library.

推荐答案

我需要在自动化方面找到一种方法,因为我们的开发人员并不总是愿意这样做对于质量保证部门而言。我提出了一个简单的修复,对于在IE的旧兼容模式下运行的测试,在这些测试完成后,我只是让他们创建一个新的浏览器实例并导航到WWW.Google.Com,因为它使用了像你一样的元标记建议IE =边缘。由于我们的机器设置为运行IE9并且没有更高的值,这将迫使它恢复到兼容模式IE9。

I needed to find a way to do this on the automation side as our devs aren't always willing to do things like that for the QA department. I came up with an easy fix, for tests that run in older compatibility mode of IE, after those tests finish, I just have them create a new browser instance and navigate to WWW.Google.Com as that uses the meta tag like you were suggesting to IE=edge. Since our machines are set up to run IE9 and nothing higher, this will force it back to compatibility mode IE9.

这篇关于使用shdocvw.InternetExplorer时,以编程方式更改IE的兼容模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆