macos 如何在 Mac 上的 Microsoft Internet Explorer 中测试我的网页?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/55577/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How can I test my web pages in Microsoft Internet Explorer on a Mac?
提问by georgebrock
I want to test the web pages I create in all the modern versions of Internet Explorer (6, 7 and 8 beta) but I work mainly on a Mac and often don't have direct access to a PC.
我想测试我在所有现代版本的 Internet Explorer(6、7 和 8 测试版)中创建的网页,但我主要在 Mac 上工作,通常无法直接访问 PC。
回答by georgebrock
Update:Microsoft now provide virtual machine images for various versions of IE that are ready to use on all of the major OS X virtualisation platforms (VirtualBox, VMWare Fusion, and Parallels).
更新:Microsoft 现在为各种版本的 IE 提供虚拟机映像,这些映像可以在所有主要的 OS X 虚拟化平台(VirtualBox、VMWare Fusion和Parallels)上使用。
Download the appropriate image from: https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/
从以下位置下载适当的图像:https: //developer.microsoft.com/en-us/microsoft-edge/tools/vms/
On an Intel based Mac you can run Windows within a virtual machine. You will need one virtual machine for each version of IE you want to test against.
在基于 Intel 的 Mac 上,您可以在虚拟机中运行 Windows。对于要测试的每个 IE 版本,您都需要一个虚拟机。
The instructions below include free and legal virtualisation software and Windows disk images.
下面的说明包括免费和合法的虚拟化软件和 Windows 磁盘映像。
- Download some virtual machine software. The developer disk images we're going to use are will work with either VMWare Fusionor Sun Virtual Box. VMWare has more features but costs $80, Virtual Box on the other hand is more basic but is free for most users (see Virtual Box licensing FAQfor details).
- Download the IE developer disk images, which are free from Microsoft: http://www.microsoft.com/downloads/...
- Extract the disk images using cabextractwhich is available from MacPortsor as source code (Thanks to Clinton).
- Download Q.app from http://www.kju-app.org/and put it in your /Applications folder (you will need it to convert the disk images into a format VMWare/Virtual Box can use)
- 下载一些虚拟机软件。我们将要使用的开发人员磁盘映像将与VMWare Fusion或Sun Virtual Box 一起使用。VMWare 具有更多功能,但售价 80 美元,而 Virtual Box 则更为基本,但对大多数用户免费(有关详细信息,请参阅Virtual Box 许可常见问题)。
- 下载 Microsoft 提供的 IE 开发者磁盘映像:http://www.microsoft.com/downloads/...
- 使用可从MacPorts或作为源代码获得的cabextract提取磁盘映像(感谢Clinton)。
- 从http://www.kju-app.org/下载 Q.app并将其放在您的 /Applications 文件夹中(您将需要它来将磁盘映像转换为 VMWare/Virtual Box 可以使用的格式)
At this point, the process depends on which VM software you're using.
此时,该过程取决于您使用的 VM 软件。
Virtual Box users
虚拟盒子用户
Open a Terminal.app on your Mac (you can find it in /Applications/Utilities) and run the following sequence of commands, replacing input.vhdwith the name of the VHD file you're starting from and output.vdiwith the name you want your final disk image to have:
/Applications/Q.app/Contents/MacOS/qemu-img convert -O raw -f vpc "input.vhd" temp.bin VBoxManage convertdd temp.bin "output.vdi" rm temp.bin mv "output.vdi" ~/Library/VirtualBox/VDI/ VBoxManage modifyvdi "output.vdi" compact
- Start Virtual Box and create a new virtual machine
- Select the new VDI file you've just created as the boot hard disk
在 Mac 上打开 Terminal.app(您可以在 /Applications/Utilities 中找到它)并运行以下命令序列,将input.vhd替换为您从中启动的 VHD 文件的名称,并将output.vdi替换为该名称您希望最终的磁盘映像具有:
/Applications/Q.app/Contents/MacOS/qemu-img convert -O raw -f vpc "input.vhd" temp.bin VBoxManage convertdd temp.bin "output.vdi" rm temp.bin mv "output.vdi" ~/Library/VirtualBox/VDI/ VBoxManage modifyvdi "output.vdi" compact
- 启动 Virtual Box 并创建一个新的虚拟机
- 选择刚刚创建的新VDI文件作为启动硬盘
VMWare fusion users
VMWare 融合用户
Open a Terminal.app on your Mac (you can find it in /Applications/Utilities) and run the following commands, replacing input.vhdand output.vmdkwith the name of the VHD file you're working on and the name you want your resulting disk image to have:
/Applications/Q.app/Contents/MacOS/qemu-img convert -O vmdk -f vpc "input.vhd" "output.vmdk" mv "output.vmdk" ~/Documents/Virtual\ Machines.localized/
This will probably take a while (It takes around 30 minutes per disk image on my 2.4GHz Core 2 Duo MacBook w/ 2Gb RAM).
- Start VMWare Fusion and create a new virtual machine
- In the advanced disk options select "use and existing disk" and find the VMDK file you just created
在 Mac 上打开 Terminal.app(您可以在 /Applications/Utilities 中找到它)并运行以下命令,将input.vhd和output.vmdk替换为您正在处理的 VHD 文件的名称和您想要的名称您生成的磁盘映像具有:
/Applications/Q.app/Contents/MacOS/qemu-img convert -O vmdk -f vpc "input.vhd" "output.vmdk" mv "output.vmdk" ~/Documents/Virtual\ Machines.localized/
这可能需要一段时间(在我的 2.4GHz Core 2 Duo MacBook w/2Gb RAM 上,每个磁盘映像大约需要 30 分钟)。
- 启动 VMWare Fusion 并创建一个新的虚拟机
- 在高级磁盘选项中选择“使用和现有磁盘”并找到您刚刚创建的 VMDK 文件
回答by Timo Tijhof
There's three different methods that I recommend:
我推荐三种不同的方法:
Cloud-based interactive virtual machines
基于云的交互式虚拟机
Use something like SauceLabsor BrowserStack. You'll be able to pick a browser of choice, enter a url and use a real OS with the real browser and test and interact as much as you need. Both of these also support setting up a tunnel to/from your own machine so any local hostnames will work fine.
使用类似SauceLabs或BrowserStack 的东西。您将能够选择一个选择的浏览器,输入一个 url 并使用带有真实浏览器的真实操作系统,并根据需要进行测试和交互。这两者还支持设置往返您自己机器的隧道,因此任何本地主机名都可以正常工作。
There is also CrossBrowserTesting, browserling/testling, which seem to have similar services although I haven't used these myself.
还有CrossBrowserTesting,browserling/ testling,虽然我自己没有使用过,但它们似乎也有类似的服务。
Local virtualization
本地虚拟化
You can use VirtualBox(free and open-source, similar to VMWare or Parallels) to create one or more virtual machines on your computer. You may or may not know this, but you do not need to get an official copy of Microsoft Windows for these virtual machines. Microsoft offers free VM images of simplified Windows installations for the purposes of testing Internet Explorer and Microsoft Edge (download). Check one of these articles to get that up and running:
您可以使用VirtualBox(免费和开源,类似于 VMWare 或 Parallels)在您的计算机上创建一个或多个虚拟机。您可能知道也可能不知道,但是您不需要为这些虚拟机获取 Microsoft Windows 的正式副本。Microsoft 提供了简化的 Windows 安装的免费 VM 映像,用于测试 Internet Explorer 和 Microsoft Edge(下载)。查看以下文章之一以启动并运行它:
- Testing IE6, 7, 8 and 9 on Mac OS X, 2011-06, xairon.net
- Internet Explorer for Mac the Easy Way, 2011-09, osxdaily.com
- 在 Mac OS X 上测试IE6、7、8 和 9,2011-06,xairon.net
- 适用于 Mac 的 Internet Explorer 简易方法,2011-09,osxdaily.com
In the past, there were also native Mac applications (such as ies4osx), or as a Windows application which requires a VM if you don't have Windows (such as IETesteror MultipleIEs). The downside is that these emulations are often less stable than the real client, and are even harder to debug with because they don't run in the natural environment of the browser. Sometimes causing errors that don't occur in the real browser, and maybe not having bugs that the real browser would have.
过去,也有原生 Mac 应用程序(例如ies4osx),或者作为 Windows 应用程序,如果您没有 Windows,则需要 VM(例如IETester或MultipleIEs)。缺点是这些模拟通常不如真实客户端稳定,而且更难调试,因为它们不在浏览器的自然环境中运行。有时会导致在真实浏览器中不会发生的错误,并且可能没有真实浏览器会有的错误。
Cloud-based screenshots factory
基于云的屏幕截图工厂
If you don't need interactivity and or need a cheaper solution (note that this method may not always be cheaper, do a little research before making assumptions) there are also services online that, like the previous one, have access to real browser/OS environments. But contrary to the previous, don't grant interactive access to the actual machines but only to get screenshots. This has both an upside and a downside. The downside is that you can't interact with it. The upside however is that most of these allow easy summarizing of screenshots so you don't have to start session after another and get screenshots.
如果您不需要交互性和/或需要更便宜的解决方案(请注意,此方法可能并不总是更便宜,请在做出假设之前进行一些研究)还有在线服务,就像前一个一样,可以访问真实的浏览器/操作系统环境。但与之前相反,不要授予对实际机器的交互访问权限,而只是为了获取屏幕截图。这有好处也有坏处。缺点是你不能与它互动。然而,好处是其中大多数都可以轻松总结屏幕截图,因此您不必一个接一个地开始会话并获取屏幕截图。
Some I've used:
我用过的一些:
- BrowserShots(free and used to be my favorite, although the slowness made alternatives more attractive)
- Adobe BrowserLab(also free, requires an Adobe ID. Not as much options and coverage as BrowserShots, but: no delay, instant screenshots, compare views and ability to let the screenshot be taken after a given number of seconds instead of right away (to test asynchronous stuff).
- CrossBrowserTesting(not free, but also has an interactive environment (see previous method) and a screenshot factory that is like your own private "BrowserShots" site)
- BrowserShots(免费,曾经是我最喜欢的,虽然缓慢使替代品更具吸引力)
- Adobe BrowserLab(也是免费的,需要一个 Adobe ID。没有 BrowserShots 那么多的选项和覆盖范围,但是:没有延迟,即时截图,比较视图和让屏幕截图在给定秒数后而不是立即(以测试异步的东西)。
- CrossBrowserTesting(不是免费的,但也有一个交互环境(见前面的方法)和一个截图工厂,就像你自己的私人“BrowserShots”站点)
回答by Jason Navarrete
Once you've virtualized Windows on your Mac, you can also try the Mutiple IEinstaller to get a variety of flavors of Internet Explorer without having to create separate VM instances.
在 Mac 上虚拟化 Windows 后,您还可以尝试使用Mutiple IE安装程序来获取各种版本的 Internet Explorer,而无需创建单独的 VM 实例。
If you're just wanting to see a simple screenshot of how the page will render in various browsers, you can try the free service browsershotsor there are a number of services that will automatically test your pages in multiple browsers.
如果您只想查看页面如何在各种浏览器中呈现的简单屏幕截图,您可以尝试免费服务browsershots,或者有许多服务会在多个浏览器中自动测试您的页面。
回答by Gulzar Nazim
Browsershotsis another option if you just want to get screenshots..
如果您只想获取屏幕截图,Browsershots是另一种选择。
回答by user113044
There is an issue with the latest release (January 2009) of the VHDs. The VHD sees there are hardware changes and prompts for a license key, evenutally locking users out. As yet there is no known workaround.
VHD 的最新版本(2009 年 1 月)存在问题。VHD 看到有硬件更改并提示输入许可证密钥,最终将用户锁定。目前还没有已知的解决方法。
回答by ma11hew28
You could use Spoon Browsers(web-based) once it becomes available for Mac.
一旦适用于 Mac,您就可以使用Spoon 浏览器(基于 Web)。
回答by chadoh
OSX Daily explains how to install Windows VMs with a single terminal command(assuming you already have VirtualBox installed). To summarize:
OSX Daily 解释了如何使用单个终端命令安装 Windows VM(假设您已经安装了 VirtualBox)。总结一下:
IE 7:
IE 7:
curl -s https://raw.github.com/xdissent/ievms/master/ievms.sh | IEVMS_VERSIONS="7" bash
IE 8:
IE 8:
curl -s https://raw.github.com/xdissent/ievms/master/ievms.sh | IEVMS_VERSIONS="8" bash
IE 9:
IE 9:
curl -s https://raw.github.com/xdissent/ievms/master/ievms.sh | IEVMS_VERSIONS="9" bash
ALL THE IEs!:
所有的 IE!:
curl -s https://raw.github.com/xdissent/ievms/master/ievms.sh | bash
回答by Eugene
If you don't have a copy of Windows that you could run in a virtual machine (VMware also isn't free), you can try IEs4Linux. It will require you configure some open source stuff on your Mac, but it is all free. You'll at least need fink, wine, and cabextract. See the link above for some specific command line directions. It's not that hard!
如果您没有可以在虚拟机中运行的 Windows 副本(VMware 也不是免费的),您可以尝试IEs4Linux。它需要你在 Mac 上配置一些开源的东西,但它都是免费的。你至少需要芬克、葡萄酒和 cabextract。有关一些特定的命令行说明,请参阅上面的链接。没那么难!
回答by pauldunlop
I've used Codeweavers Crossover product for doing this from time to time.
我不时使用 Codeweavers Crossover 产品来做这件事。
http://www.codeweavers.com/products/cxmac/
http://www.codeweavers.com/products/cxmac/
It's a different option to virtualisation, and gives you a little more control than some of the hosted solutions. That said, it's based on WINE, and so you can potentially get all the problems and issues that come with doing it that way. That said, for basic testing without plugins, etc, it works great.
它是虚拟化的不同选择,与某些托管解决方案相比,它为您提供了更多的控制权。也就是说,它基于 WINE,因此您可能会遇到以这种方式执行的所有问题和问题。也就是说,对于没有插件等的基本测试,它效果很好。
I'm not 100% sure about support for IE8, you'd need to check that out, but it definitely gives you native support for 6 and 7.
我不是 100% 确定是否支持 IE8,您需要检查一下,但它肯定会为您提供对 6 和 7 的本机支持。