带有任何无头浏览器的量角器? [英] protractor with any headless browser?

查看:43
本文介绍了带有任何无头浏览器的量角器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用量角器,当我将 chrome 指定为浏览器类型时它可以工作.我正在寻找无头浏览器示例代码,我已经寻找了 phantomJs,但我无法运行它们中的任何一个.是否有其他无头浏览器的可用示例?

I am using protractor and it works when I specify chrome as the browsertype. I am looking for a headless browser sample code, I have looked for phantomJs but I could not run any of them. Is there a working sample available of another headless browser?

推荐答案

除了 PhantomJS 之外,没有其他无头浏览器,而后者对于 Protractor 来说是个死胡同.

No other headless browser out there besides PhantomJS while the latter is a dead-end with Protractor.

您可以尝试 docker-selenium 或者,如果您不喜欢 Docker 你可以自己使用 ubuntu-headless 示例.两种解决方案都提供 Chrome &Firefox 使用 Xvfb 即使没有真正的 DISPLAY.

You can try docker-selenium or, if you don't like Docker you can do it yourself with ubuntu-headless sample. Both solutions provide Chrome & Firefox by using Xvfb even though there is no real DISPLAY.

UPDATE 2 似乎可以在 OSX 中运行 Xvfb:http://xquartz.macosforge.org/landing/

UPDATE 2 Seems to be possible to run Xvfb in OSX: http://xquartz.macosforge.org/landing/

UPDATE 1 Mac OSX selenium 无头解决方案:

UPDATE 1 Mac OSX selenium headless solution:

因此可以在 mac 上无头测试 selenium.不是真的无头,而是作为另一个用户,所以它不会干扰您当前的用户显示.为此,您需要启动:http://support.apple.com/en-us/HT201710开始使用 kickstart 实用程序

So can test selenium headless on mac. Not headless really but as another user so it doesn't interfere with your current user display. To do this you need kickstart: http://support.apple.com/en-us/HT201710 Begin using the kickstart utility

sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -restart -agent

激活远程桌面共享,为所有用户启用访问权限并重新启动 ARD 代理:

Activate Remote Desktop Sharing, enable access privileges for all users and restart ARD Agent:

sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -access -on -restart -agent -privs -all 

仅限 Apple Remote Desktop 3.2 或更高版本

允许所有用户访问并授予所有用户完全访问权限

Apple Remote Desktop 3.2 or later only

Allow access for all users and give all users full access

sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -configure -allowAccessFor -allUsers -privs -all

Kickstart 帮助命令

Kickstart help command

sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -help

这篇关于带有任何无头浏览器的量角器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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