Tag: selenium

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驱动程序停止时退出。 有没有办法找回旧的行为?