你如何采取angularjs应用的截图? [英] How do you take a screenshot of an angularjs app?

查看:269
本文介绍了你如何采取angularjs应用的截图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试过:


  • 节点webshot

  • phantomjs

我能做到这一点本地,但我不能拿的是基于angularjs其他网站的截图。

I could do it locally but I couldn't take screenshots of other websites that are based on angularjs.

能够采取任何angularjs的应用程序,其中包括jQuery和棱角分明的页面截图。每一个网站在这里: http://builtwith.angularjs.org/ 应该看看,如果我在浏览器中加载它。

Be able to take a screenshot of any angularjs app which includes jquery and angular on the page. Every single site here: http://builtwith.angularjs.org/ should look as if I loaded it in my browser.

必须能够通过终端来获取截图,以便它可以像一个工人或一些后台进程运行。

Must be able to get the screenshot via the terminal so it could be run in a background process like a worker or something.

这是随机的服务器(或任何应该能够去异地的网站,并采取它的屏幕截图。)

One random server (or whatever should be able to go to an offsite website and take a screenshot of it.)

它只是需要采取一种URL这将不可避免地举办angularjs应用和输出你期望在浏览器中看到的。

It just needs to take an url that will inevitably host an angularjs app and output what you'd expect to see in your browser.

不需要是phantomjs或节点webshot

Does not need to be phantomjs or node-webshot.

截至昨晚这就是我正在做的。

As of last night this is how I'm doing it.


  • 节点的webkit(里面铬的NodeJS)编译到Linux-32

  • 将一个随机的笔记本电脑打开

  • 当它检测到的截图需要采取(通过火力暂时)它打开与URL的IFRAME

  • 等待10秒(合理的时间来加载一个网站/应用)

  • 使用节点WebKit的API来截图本身

我有一些工作要做这样的解决方案。

I have some work to do on this solution.

这似乎是一个潜在的解决方案,但我发现,大多数解决方案都需要打开浏览器,并采取截图与像phantomjs模拟浏览器。

This appears to be a potential solution but I've found that most of these solutions require opening a browser and taking the screenshot versus a headless browser like phantomjs.

我继续在这个在github生产就绪解决方案的开发。
<一href=\"https://github.com/clouddueling/angular-snapshot\">https://github.com/clouddueling/angular-snapshot

I'm continuing development on a production ready solution for this on github. https://github.com/clouddueling/angular-snapshot

如果你把这个code和你将能够运行的截图服务器node-webkit.app建立它。

If you take this code and build it with node-webkit.app you will be able to run a screenshot server.

推荐答案

使用 browserstack 来测试您的应用程序所有的浏览器,无需安装的每个人,包括移动浏览器,不同的手机,平板电脑等。

Use browserstack to test your application in all browsers without having to install each one, including mobile browsers, different phones, tablets, etc.

有对硒的自动化测试和支持截图本地测试的支持,不需要公共网址。

There is support for Selenium automated testing and screenshots. Local testing is supported, no public URL is needed.

借助截图API 是可用来配置你需要的截图,的 Screenshooter 是在命令行中产生BrowserStack截图AA工具

The screenshots API is available for configuring the screenshots you need, Screenshooter is a a tool for generating BrowserStack screenshots from the command line.

有是这个试用期,因为它是一个商业产品,但它是很有见地的,值得每一分钱。您可以订阅只有一个月。我曾亲自使用,我强烈推荐它。

There is a trial period for this as it's a commercial product, but it's very well made and worth every penny. You can subscribe for only one month. I have used personally and I highly recommend it.

这篇关于你如何采取angularjs应用的截图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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