Tag: selenium

你如何使用Docker在Windows上设置selenium网格?

我已经采取的步骤 1.下载并安装Docker Toolbox for windows 2.打开Docker快速入门terminal 3.input以下命令从dockerhub中拖出泊坞窗图像并运行它们 docker pull selenium/hub docker pull selenium/node-chrome docker pull selenium/node-firefox docker run -d -P \–name hub selenium/hub docker run -d –link hub:hub -P \–name chrome selenium/node-chrome docker run -d –link hub:hub -P \–name firefox selenium/node-firefox 当我inputdocker logs hub时它似乎正在运行,但是我无法使用我的conf.js文件中的seleniumAddress将我的testing路由到virtualbox VM上的集线器地址,或者使用http:// ipAddress:4444 / grid / console 。 理想情况下,我想使用这个设置来扩大我可以运行的并行testing实例的数量。

Docker,Django和Selenium – Selenium无法连接

我有Dockerconfiguration使用docker-compose.yml运行Postgres和Django,它工作正常。 我遇到的麻烦是Selenium无法连接到Django liveserver。 现在对我来说(至less对我来说)django必须访问selenium来控制浏览器,而selenium必须访问django来访问服务器。 我已经尝试使用docker-compose.yml的docker-compose.yml从这里使用docker'ambassador'模式: https : //github.com/docker/compose/issues/666 postgis: dockerfile: ./docker/postgis/Dockerfile build: . container_name: postgis django-ambassador: container_name: django-ambassador image: cpuguy83/docker-grand-ambassador volumes: – "/var/run/docker.sock:/var/run/docker.sock" command: "-name django -name selenium" django: dockerfile: ./docker/Dockerfile-dev build: . command: python /app/project/manage.py test my-app container_name: django volumes: – .:/app ports: – "8000:8000" – "8081:8081" links: – postgis – "django-ambassador:selenium" environment: – […]

Webdriverexception:“chrome not reachable”

我在ubuntu服务器上运行seleniumtesting用例,这个服务器基本上在firefox和chrome中运行testing用例。 Firefox启动并且testing用例运行成功,但是chrome抛出exception: *****下面是stacktrace的片段:***** 在端口21549上启动ChromeDriver(v2.8.240825) PAC支持被禁用,因为没有系统实现 testingIntegrationTest.AdminUserelementscheck失败: org.openqa.selenium.WebDriverException:chrome not reachable(驱动程序信息:chromedriver = 2.8.240825,platform = Linux 2.6.32-431.el6.x86_64 x86_64)(警告:服务器没有提供任何堆栈跟踪信息)[error]命令持续时间或超时时间:20.83秒 嗨下面是我的代码的小片段: public class IntegrationTest { private static final String configFile="test.properties"; private final String FIREFOX="firefox"; private final String CHROME="chrome"; private final String PHANTOMJS="phantomjs"; private final String BROWSERNAME="browser"; private static Properties props = new Properties(); public WebDriver webDriver; private static Configuration additionalConfigurations; […]

docker上的RSelenium:文件在哪里下载?

我正在使用Docker镜像使用Selenium: require(RSelenium) if (length(system("docker ps -l", intern = TRUE))<2) try({system("docker run -d -p 4445:4444 selenium/standalone-firefox:2.53.0")}) 它的工作原理,我可以连接到任何url和导航。 但是,当我点击一个button来下载文件时,它有时会将其保存(部分保存为xxxxxxx.csv.part )到/tmp/mozilla_mozillaUser0 ,有时会保存到任何地方,或者可能找不到其他位置。 这是有原因吗? 另外我试图打开驱动程序使用 makeFirefoxProfile(list(browser.download.dir = "D:/temp")) 但它返回一个奇怪的错误 Error in file(tmpfile, "rb") : cannot open the connection In addition: Warning messages: 1: running command '"zip" -r9Xjq "C:\Users\rocks\AppData\Local\Temp\RtmpoPhjUb\file31076202d4f.zip" "C:\Users\rocks\AppData\Local\Temp\RtmpoPhjUb/firefoxprofile/prefs.js" ' had status 127 2: In file(tmpfile, "rb") : cannot […]

如何停止所有容器,当一个容器与docker合成?

直到最近,当一个人在做docker-compose up ,为一堆集装箱docker-compose up ,一个开始的集装箱停了下来,所有的集装箱都停了下来。 从https://github.com/docker/compose/issues/741开始 ,情况就不是这样了,这对我们来说真的很烦人:我们使用docker-compose来运行seleniumtesting,这意味着启动应用程序服务器,启动selenium集线器+节点,启动testing驱动程序,然后在testing驱动程序停止时退出。 有没有办法找回旧的行为?

Docker selenium / node-chrome – 量angular器找不到Chrome二进制文件

我是Docker的新手,但不是E2E量angular器。 我正在尝试从Docker容器中构buildE2E集成。 遵循使用Docker的Angular的量angular器菜谱 他们有第2步 – 启动selenium节点 docker run -d –link selenium-hub:hub selenium/node-chrome:latest 我了解Selnium Grid的function – 它允许通过与网格进行通信来testing不同types的浏览器。 当我有这个docker容器运行Protactor不使用它作为铬二进制文件,我得到WebDriverError: unknown error: cannot find Chrome binary 。 我如何使量angular器使用此node-chrome容器,而不是本地铬二进制文件? 我的量angular器configuration: exports.config = { framework: 'mocha', directConnect: true, seleniumAddress: 'http://localhost:4444/wd/hub', // I have this set to the grid docker container from Angular cookbook specs: ['./stories/*.js'], onPrepare: function() { expect = […]

Docker + Rspec +水豚 – 参数是未定义的

我试图得到我的规格在docker工作无头 – 他们在我的Mac本地运行良好,但是当我在docker集装箱内运行他们,我得到这个错误(重复多次) Selenium::WebDriver::Error::JavascriptError: arguments[0] is undefined # [remote server] https://foobar.com/ line 68 > Function:1:1:in `anonymous' # [remote server] https://foobar.com/:68:20:in `handleEvaluateEvent' # ./spec/features/foo_spec.rb:15:in `block (2 levels) in <top (required)> Xvfb正在运行: Xvfb :99.0 -screen 0 1366x768x16 我也尝试做一个xvfb-run rspec并得到相同的错误。 spec_helper.rb: Capybara.default_driver = :selenium Capybara.javascript_driver = :selenium 这是怎么回事,这不能运行在docker?

Firefox中的一个docker容器可以从另一个selenium访问

我有一个Docker容器,运行一个rails应用程序(我们称之为容器A),它需要使用firefox作为后端,使用watir webdriver进行一些修改。 我已经安装在另一个容器(容器B)的火狐,我想能够通过容器一样的东西: Selenium::WebDriver::Firefox::Binary.path= $DOCKER_RUN_CONTAINER_A 所以,每次watir启动firefox,一个新的CONTAINER_A实例都会启动一个新的firefox。 我知道容器使用端口进行通信很容易,但可执行文件怎么样? 顺便说一句,它看起来像一个好的devise理念隔离火狐在一个单独的容器?

如何通过docker-compose而不是使用docker启动selenium hub和一个链接节点?

我可以通过以下方式启动一个selenium中心图像: docker run –rm=true -P -p 4444:4444 –name selenium-hub selenium/hub 并通过以下方式添加一个Firefox工作 docker run –rm=true –link selenium-hub:hub selenium/node-firefox 继续http:// localhost:4444 / grid / console然后将显示网格就好了。 我不想每次都使用docker,但通过docker-compose进行相同的设置。 因此,我想我可以在我docker-compose.yml执行此docker-compose.yml : selenium_hub: image: selenium/hub ports: ["4444:4444"] links: – selenium_firefox_worker selenium_firefox_worker: image: selenium/node-firefox 然而,在运行docker-compose up我得到以下消息: selenium_firefox_node_1 | Not linked with a running Hub container selenium_firefox_node_1 exited with code 1 因此网格不显示任何节点。 我以为我可能会以错误的顺序进行链接,甚至: […]

Dockerizedselenium浏览器不能访问Capybaratestingurl

我正在尝试在dockerized selenium独立的firefox浏览器上运行Ruby on Railsfunctiontesting。 这似乎是我有networking问题,因为selenium实例无法连接到由水豚开始的url。 这里是我的示例docker-compose.yml文件: ff: image: selenium/standalone-firefox:2.48.2 container_name: firefox-browser web: build: . container_name: my-app volumes: – ".:/home/ubuntu/my-app" command: /bin/bash -l scripts/docker-start-tests.sh ports: – "3000:3000" 我开始docker-compose与networking启用: docker-compose –x-networking up testing脚本像这样运行一个rspec命令 rspec ./spec/features/login_spec.rb:43 dockertesting我启用了远程驱动程序水豚: Capybara.register_driver :docker_firefox do |app| Capybara::Selenium::Driver.new(app, { browser: :remote, url: "#{ENV['FF_URL']}/wd/hub", desired_capabilities: Selenium::WebDriver::Remote::Capabilities.firefox }) end 最后,我打电话给这样的testing: unless ENV['FF_URL'].nil? Capybara.current_driver = :docker_firefox Capybara.javascript_driver […]