Tag: 火狐

在docker chrome和firefox浏览器容器中启用Flash播放器

我想在Docker容器中使用selenium / hub,selenium / node-chrome-debug和selenium / node-firefox-debug执行seleniumtesting。 我的应用程序包含Flash内容,因为Flash插件不可用/过时在铬和firefox泊坞窗容器,我无法进一步进行。 任何想法如何在docker chrome和firefox容器中安装flash插件?

在旧版本的Firefox(v41.0)上运行Selenium(v3.4.0)

在浏览互联网之后,我失去了一些时间,我无法find解决scheme。 我目前正在尝试在旧版本的Firefox(这里是v41.0)上testing我的应用程序。 我正在通过Selenium的Docker 镜像 (v3.4.0)以及Firefox节点(v41.0)的docker镜像。 我知道对于老版本的Firefox,Geckodriver不兼容,但似乎有解决scheme使用 { "marionette": true } Firefox节点完美地连接到网格。 我可以使用docker exec -it <container-id> bash连接到它,但运行testing时出现问题。 我仍然试图find它,但我被封锁了。 这里是Dockerfile的代码:hub.docker.com/r/selenium/node-firefox/~/dockerfile/用于Firefox节点,这里是testing代码(使用MochaJS)。 test.it("should redirect to Google with FIREFOX 41.0", () => { var firefoxCap = Capabilities.firefox(); firefoxCap.set('marionette', true); driver = new webdriver.Builder() .usingServer(CONSTANTS.SELENIUM_HUB) .withCapabilities(firefoxCap) .build(); driver.get(CONSTANTS.GOOGLE_URL); driver.wait(until.titleIs(CONSTANTS.GOOGLE_TITLE)); driver.wait(until.elementLocated(By.name(CONSTANTS.GOOGLE_SEARCH_KEY))).sendKeys(CONSTANTS.GOOGLE_SEARCH_VALUE); driver.findElement(By.name(CONSTANTS.GOOGLE_SEARCH_BUTTON_NAME)).click(); driver.wait(until.titleIs(CONSTANTS.GOOGLE_SEARCH_TITLE)); driver.wait(until.elementLocated(By.tagName(CONSTANTS.GOOGLE_RES_LINK))).click(); driver.wait(until.titleIs(CONSTANTS.GOOGLE_TITLE)); driver.quit(); }); 这里的日志 ~/dev/selenium-grids/src$ mocha –timeout 30000 […]

在Docker中打开Karma服务器URL后,Firefox挂起

上下文我一直在PhantomJS,Google Chrome和Firefox本地运行我的Karmatesting,没有任何问题。 目前,我正在运行Docker中的Karmatesting,并且在Docker容器中的Firefox中运行Karmatesting时遇到了问题,尽pipeDocker容器可以在Google Chrome中运行Karmatesting而没有任何问题。 问题当我创build了包含Google Chrome,Firefox,JS库(node,npm,grunt等)和VNC实用程序(Xvfb,x11vnc)的Docker容器时。 我启动了VNC服务器并运行testing。 Firefox已经启动,套接字是用一个唯一的ID创build的。 当我进入一个VNC会话时,我可以看到firefox已经启动,URL被加载到URL栏,Karma页面被加载。 但是,大约2秒后,网页将会冻结,并且Firefox被挂起。 所以我看不到LOG: 'INFO[2015-10-16 20:19:15]: Router Started'消息。 有趣的发现,手动重现这个我已经厌倦了评论启动Firefox的行 ,所以只有在运行Karmatesting时才启动karma服务器。 然后我尝试用以下两种方法运行testing – 通过docker exec -it <container_tag>启动Bash会话,执行firefox ,并input带有相应的testing运行ID的服务器url。 在这种情况下,Firefox没有挂起,然后开始testing运行。 通过docker exec -it <container_tag>启动Bash会话,执行firefox <server_url_with_coresponding_id> 。 在这种情况下,Firefox没有挂起,然后开始testing运行。 我的DockerFile FROM ubuntu:14.04 #======================== # Environment Variables for Configuration #======================== ENV GEOMETRY 1920x1080x24 ENV DISPLAY :0 #======================== # Install Required Packages #======================== RUN […]

无头watir webdrivertesting无法findFirefox

我正在使用docker在gitlab ci ubuntu镜像上设置watir-webdrivertesting。 我正在从Mozilla网站安装Firefox,然后尝试运行testing。 但是,我不断收到selenium无法findFirefox的错误 No such file or directory – /usr/bin/firefox (ChildProcess::LaunchError) 我遵循的步骤来安装Firefox $wget https://ftp.mozilla.org/pub/firefox/releases/35.0/linux-i686/en-US/firefox-35.0.tar.bz2 $tar xjf firefox-35.0.tar.bz2 $cp -r firefox /opt/firefox35 $ln -s /opt/firefox35/firefox /usr/bin/firefox 我尝试将sym链接path更改为/usr/bin/firefox和/usr/local/firefox 我也尝试在env.rb显式设置firefox的path Selenium::WebDriver::Firefox::Binary.path = '/usr/local/firefox' Selenium::WebDriver::Firefox::Binary.path = '../firefox/firefox' Selenium::WebDriver::Firefox::Binary.path = '/usr/local/firefox' Selenium::WebDriver::Firefox::Binary.path = '../firefox/firefox' 即使使用较新版本的Firefox,我也面临同样的问题。 我也尝试使用apt-get包pipe理器安装firefox,结果相同。 有没有人面对这个问题,并能解决呢?

在Docker容器中无头无虑地运行Xvfb和Firefox的摩卡testing时出错

我目前正在运行一个Ubuntu的图像的docker容器。 这些是我用来安装Xvfb,firefox和Nodejs的一系列命令: apt-get update apt-get install -y xorg xvfb firefox dbus-x11 xfonts-100dpi xfonts-75dpi xfonts-cyrillic apt-get install -y python gcc make g++ wget wget https://nodejs.org/download/rc/v4.0.0-rc.1/node-v4.0.0-rc.1.tar.gz tar -zxvf node-v4.0.0-rc.1.tar.gz cd node-v4.0.0-rc.1 ./configure make install 在安装并确保Node,npm和Xvfb正在工作之后,我试着在firefox上运行一些我的testing。 这里是我用来运行Xvfb和我的testing脚本(我写了一个npm脚本,调用摩卡和适当的testing)的命令: xvfb-run npm run l-2361:spec 这是我的输出: > ui-tests@1.0.0 l-2361:spec /go/src/bitbucket.org/companyName/platform/qe > npm run env-local mocha test/admin/dashboard/adminUser/pdvi-2361.js — –reporter spec –slow 0 > […]

在Docker容器中运行seleniumtesting

我想从我的JavaScript项目的来源build立一个docker图像。 我用摩卡框架写了一些testing。 testing应该在构builddocker构build过程中运行,因为我想用Jenkins自动化构build。 testing应该使用Firefox webdriver。 我在Docker镜像中安装了Xvfb,为Firefox进程提供虚拟显示。 但是每次运行构build时,所有的testing都失败了,我得到如下的错误信息: Uncaught WebDriverError: Unable to parse new session response: {"error":"unknown error","message":"connection refused"} at WebDriverError (node_modules/selenium-webdriver/lib/error.js:27:5) at client_.send.then.response (node_modules/selenium-webdriver/http/index.js:477:17) at ManagedPromise.invokeCallback_ (node_modules/selenium-webdriver/lib/promise.js:1379:14) at TaskQueue.execute_ (node_modules/selenium-webdriver/lib/promise.js:2913:14) at TaskQueue.executeNext_ (node_modules/selenium-webdriver/lib/promise.js:2896:21) at asyncRun (node_modules/selenium-webdriver/lib/promise.js:2820:25) at node_modules/selenium-webdriver/lib/promise.js:639:7 at process._tickDomainCallback (internal/process/next_tick.js:129:7) From: Task: WebDriver.createSession() at Function.createSession (node_modules/selenium-webdriver/lib/webdriver.js:329:24) at Driver (node_modules/selenium-webdriver/firefox/index.js:386:38) at Builder.build (node_modules/selenium-webdriver/builder.js:467:16) at Object.<anonymous> […]

使用audio时,Docker中的Firefox中的getUserMedia不起作用

在Docker中使用Firefox 52 +时,我遇到了WebRTC的getUserMedia函数的奇怪行为。 重现它的步骤是: 1)在Docker中运行一个Selenium Hub: docker run –rm –name selenium-hub -p 4444:4444 selenium/hub:3.4.0 2)在集线器中注册Firefox浏览器: docker run –rm –link selenium-hub:hub -p 5555:5555 -p 5900:5900 selenium/node-firefox-debug:3.4.0 注1 :此命令使用的是node-firefox图像的debugging版本,因为我们想要使用VNC连接到浏览器(在容器中) 注2 :此版本(3.4.0)使用的是Firefox 53.自Firefox 52(即52,53,54)以来也出现此问题,但在Firefox 51中没有发生此问题(node-firefox-debug:3.1.0 ) 3)使用VNC客户端连接到浏览器(Linux中的URL:vnc://127.0.0.1:5900,密码:秘密) 4)强制在docker化浏览器中使用假媒体。 这可以在Firefox的高级configuration(tab about:config )中设置为true来configuration关键字media.navigator.streams.fake : 5)在Docker的Firefox中打开getUserMedia示例页面 。 例如, 基本的getUserMedia演示工作正常: 我检查这个演示正在工作,因为在mediaConstraints audio标志设置为false : var constraints = window.constraints = { audio: false, video: […]

在Docker容器中执行Firefox浏览器进行Seleniumtesting

我有一个Java应用程序,它通过Selenium WebDriver Libraray控制FF浏览器中的自动GUItesting。 Java应用程序从数据库读取testing用例,并根据代码逻辑执行testing用例。 例如,如果应用程序读入一个字段,它将使用Selenium框架中的“findElement”方法进行search。 我不使用任何testing脚本Selenium。 目前这发生在员工的本地工作站上。 现在我想将整个环境转移到Docker容器中。 甚至有可能在容器中实例化Firefox浏览器? 顺便说一句:我不需要看到我的浏览器的实际GUI。 其次: dockerhub上有几个容器可以使用selenium,但这些不适合我的环境,我是对的吗? 据我所知SeleniumGrid期待testscripts,不能通过运行时执行。 我用Vagrant打开了一个Linux VM(Debian:Jessie发行版),然后运行Docker。 我还是Docker的初学者。 我在这里找不到任何有关我的目的的问题。 提前致谢!

Windows和Linux上的Chrome和Firefox(selenium)

我只用Windows机器运行Selenium网格,资源使用率很高。 我一直在考虑将Chrome和Firefox放在Docker容器中以提高效率。 我的问题是,在不同的平台上浏览器本身有什么关键的区别,也就是说,Windows上的Chrome与Linux上的Chrome不同,还是运行相同的代码,并且行为相同?

Xvfb&Docker – 无法打开显示

我需要运行XVFB和docker与Firefox,但不能让他们一起工作 这是我的Dockerfile: FROM abevoelker/ruby:latest # based on ubuntu ENV TERM linux RUN apt-get update && apt-get install -y ….. ENV DISPLAY :99 # Install Xvfb init script ADD xvfb_init /etc/init.d/xvfb # default xvfb init.d RUN chmod a+x /etc/init.d/xvfb CMD ["firefox"] 我从Firefox获得的错误消息是 Error: cannot open display: :99