通过BrowserStack将跨浏览器调试集成到Visual Studio中

本文介绍了如何将BrowserStack集成到Visual Studio 2012中,以便于进行跨浏览器测试。作者提到,通过BrowserStack的在线服务和Visual Studio的扩展,开发者可以方便地在各种浏览器和操作系统上进行调试,包括免费试用三个月的虚拟机服务。此外,还提到了BrowserStack的URL可定制性,允许直接从Visual Studio启动远程调试。
摘要由CSDN通过智能技术生成

image
TL; DR-太久没读版本 (TL;DR - Too Long Didn't Read Version)

  • BrowserStack Integrated into Visual Studio

    BrowserStack集成到Visual Studio中

    • From a debug session inside Visual Studio 2012 today with ASP.NET 2012.2 RC installed. Click the dropdown next to your Debug Button, the click on "More Emulators" to go to http://asp.net/browsers and get the BrowserStack Visual Studio extension and three months free service. There's other browsers to download as well, like the Electric Plum iPhone/iPad simulator.

      今天安装了ASP.NET 2012.2 RC的Visual Studio 2012内的调试会话中进行。 单击“调试”按钮旁边的下拉菜单,单击“更多仿真器”以转到http://asp.net/browsers并获得BrowserStack Visual Studio扩展和三个月的免费服务。 也可以下载其他浏览器,例如Electric Plum iPhone / iPad模拟器

      • SIDE NOTE: When the VS2012.2 Update is finalized, you'll need to install just it and you'll get the ASP.NET Web Tools as well.

        旁注 VS2012.2更新完成后,您只需安装它,您还将获得ASP.NET Web工具。

  • New Online Tools for Modern Sites

    现代网站的新在线工具

    • Head over to http://modern.ie for a bunch of tools for making cross browser sites easier, including on online site analyzer and downloadable Virtual Machines for any Virtual Platform.

      请访问http://modern.ie,以获得一整套使跨浏览器站点更容易的工具,包括在线站点分析器和适用于任何虚拟平台的可下载虚拟机​​。

    New Online Tools for Modern Sites

    现代网站的新在线工具

I do a lot of cross-browser testing and I've been on a personal mission to make "Browse With..." and multiple browser debugging suck less in Visual Studio. This has been going on for years.

我进行了很多跨浏览器测试,并且我个人一直致力于使“ Browse With ...”和多种浏览器调试在Visual Studio中的吸引力降低。 这已经持续了多年。

But still, it's too hard. There's been some Virtual Machines up on the Microsoft Download Center but it's tedious to dig around and get the one you need.

但是,这太难了。 Microsoft下载中心上已有一些虚拟机,但是挖掘并获得所需的虚拟机很麻烦。

浏览器堆栈 (BrowserStack )

Today the IE team announced new site at http://modern.ie to make cross-browser testing easier. Even cooler, they launched a partnership with BrowserStack.com to give us all a three month free trial to their hosted browser virtualization service.

今天,IE团队在http://modern.ie上宣布了一个新站点,以简化跨浏览器的测试。 更酷的是,他们与BrowserStack.com建立了合作伙伴关系,为我们所有人提供了三个月的免费试用,以托管其浏览器虚拟化服务。

BrowserStack has a cloud of virtual machines with every browser imaginable. You can pick your OS, browser version and screen resolution, then effectively VNC (Remote) into them with their Flash plugin. It's totally seamless and really cool to see.

BrowserStack拥有虚拟机云,每个浏览器都可以想象得到。 您可以选择操作系统,浏览器版本和屏幕分辨率,然后通过其Flash插件将VNC(远程)有效地插入其中。 它是完全无缝的,而且真的很酷。

Here you can see how hideous my site is in IE6 on Windows XP running within BrowserStack. Keep reading, it gets better. Well, IE6 doesn't get better, but this story does.

在这里,您可以看到我的网站在BrowserStack中运行的Windows XP的IE6中的表现如何。 继续阅读,会变得更好。 嗯,IE6并没有变的更好,但是这个故事可以了。

将BrowserStack与Visual Studio 2012集成 (Integrating BrowserStack with Visual Studio 2012)

Even better, I noticed that BrowserStack has nice hackable URLs like this:

更好的是,我注意到BrowserStack具有不错的可入侵网址,如下所示:

http://www.browserstack.com/start#os=Windows&os_version=XP&browser=IE&browser_version=6.0&zoom_to_fit=true&url=hanselman.com&resolution=1024x768&speed=1

http://www.browserstack.com/start#os=Windows&os_version=XP&browser=IE&browser_version=6.0&zoom_to_fit=true&url=hanselman.com&resolution=1024x768&speed=1

When I saw how clear it was, I immediately started writing a Visual Studio plugin - like within 5 minutes - then stopped after a half hour.

当我看到它有多清晰时,我立即开始编写Visual Studio插件(例如5分钟之内),然后在半小时后停止。

I said, this is too obvious. Someone has already done written this, right? I google. Yes, they beat me to it, 5 days ago.

我说,这太明显了。 已经有人写过了吧? 我谷歌。 是的,他们在5天前击败了我。

BrowserStack already has a lovely Visual Studio Extension up and ready to go.  It adds BrowserStack as a new browser choice within your Visual Studio 2012 debug dropdown.

BrowserStack已经有了一个漂亮的Visual Studio Extension ,可以使用了。 它将BrowserStack添加为Visual Studio 2012调试下拉列表中的新浏览器选择。

Start Debugging, pick my OS and Browser, in this case, Safari on a Mac running Mountain Lion.

开始调试,选择我的操作系统和浏览器,在本例中为运行Mountain Lion的Mac上的Safari。

After you sign into BrowserStack with an account, you can setup a tunnel (using Java, but you can do it from the command line if you don't want to use an applet) between your local web server and BrowserStack and even debug in the cloud. Fabulous.

使用帐户登录BrowserStack后,可以在本地Web服务器和BrowserStack之间设置隧道(使用Java,但如果不想使用applet,则可以从命令行进行操作),甚至可以在云。 极好。

image

After I've setup this tunnel, here I am debugging a website running local via a remote Mountain Lion Mac running Safari 6. Or whatever. You get the idea.

设置完此隧道后,在这里我将通过运行Safari 6或其他操作系统的远程Mountain Lion Mac调试在本地运行的网站。 你明白了。

Here am I at a breakpoint. Ya, it's freaking me out also.

这是我的一个断点。 是的,这也吓到我了。

Again, if you've got VS2012, can you get this now any number of ways. You can go to http://asp.net/browsers, you can go to http://modern.ie or you can just click "More Emulators" within Visual Studio itself.

同样,如果您拥有VS2012,现在可以通过多种方式获得此功能。 您可以转到http://asp.net/browsers ,也可以转到http://modern.ie ,也可以在Visual Studio本身中单击“更多仿真器”。

Have fun!

玩得开心!

翻译自: https://www.hanselman.com/blog/cross-browser-debugging-integrated-into-visual-studio-with-browserstack

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值