Tag: selenium

使用Django 1.11从Docker Selenium运行LiveServerTestCase

由于Django 1.11 ,选项–liveserver已从manage.py test命令中删除。 我正在使用这个选项来允许liveserver通过以下命令从机器的IP地址而不是localhost : ./manage.py test –liveserver=0.0.0.0:8000 不幸的是,这个选项已经不存在了,我正在寻找一个新的解决scheme来允许我的Docker Selenium映像在testing期间访问我的LiveServerTestCase。

在docker集装箱之间进行通信

我有一个服务器运行两个docker集装箱。 一个docker集装箱是一个networking服务器,另一个是一个selenium铬金属。 从容器与Web服务器,我想能够连接到铬驱动程序。 而Web服务器是这样启动的: docker run -i -p 80:80 -d '<name>:<version>' /sbin/my_init selenium驱动程序是这样启动的: docker run -d -p 4444:4444 -v /dev/shm:/dev/shm selenium/standalone-chrome:3.4.0 从主机上,我可以从curl的selenium容器中获得信息: curl http://localhost:4444/wd/hub/status # => {"state":"success","sessionId":………. 但是,从Web服务器容器我只得到: curl: (7) Failed to connect to localhost port 4444: Connection refused 我能做些什么来让包含Web服务器的容器能够连接到另一个容器?

在Jenkins上运行Dockerized Selenium Grid

我试图让我的testing运行在jenkins。 我已经Docker化了我的testing运行器代码,并使用Dockerized Selenium集线器/网格。 我可以在我的机器上本地运行一切正常,并希望在Jenkins服务器上执行相同的操作。 所有容器都是使用docker shell命令启动的,它们都放在同一个Dockernetworking中,以便它们可以通信。 再次,一切工作正常本地,但是当我在Jenkins机器上尝试这个,我得到一个错误消息说: Error forwarding the new session cannot find : Capabilities [{rotatable=false, … 由于完全相同的命令在本地工作,我可以想到为什么这种失败的唯一原因是因为容器必须无法在Jenkins机器上进行通信。 也许他们是从另一个节点或奴隶开始的,我不确定。 有没有人有经验在Jenkins机器上运行多个容器? 还是有没有人有任何其他的想法,为什么这是失败?

在django中运行testing时设置liveserver端口

我使用Django的Web应用程序,我使用docker来部署它。 我需要在selenium容器中testing它。 我正在使用selenium网格进行testing。 为了连接docker上的liveserver,我需要端口转发一个特定的端口,但就我在django文档中阅读,LiveServerTestCase使用端口0,这意味着随机端口,每次我运行testing。 由于–liveserver选项已被弃用,有没有其他的方式来设置testing服务器的端口或更聪明的方式来testing它与selenium? 提前致谢 !

Windows和Linux上的Chrome和Firefox(selenium)

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

Docker-selenium-chrome查看浏览器

我是新来的docker工,一直在搞Docker和selenium电网一个星期。 这是我做的事情, 为Selenium网格和Google Chrome创build了一个容器。 修改我的量angular器脚本并将其指向步骤1中创build的集线器 我可以看到使用docker logs <container-name>的chrome驱动程序日志 我的问题是,脚本运行时,我能看到浏览器吗?

更改docker中运行的selenium节点的日志级别

我们的团队正在使用docker部署一个selenium网格。 默认日志级别似乎设置为INFO。 我想把它设置得更高一些,把它们完全closures。 我做了三次尝试,但到目前为止,没有任何效果。 方法一: 从selenium客户端,我试图在DesiredCapabilities内的RemoteWebDriver上设置LoggingPreferences: DesiredCapabilities desiredCapabilities = DesiredCapabilities.firefox(); LoggingPreferences logs = new LoggingPreferences(); logs.enable(LogType.BROWSER, Level.SEVERE); logs.enable(LogType.CLIENT, Level.SEVERE); ogs.enable(LogType.DRIVER, Level.SEVERE); logs.enable(LogType.SERVER, Level.SEVERE); desiredCapabilities.setCapability(CapabilityType.LOGGING_PREFS, logs); desiredCapabilities.setCapability(FirefoxDriver.PROFILE, profile); WebDriver driver = new RemoteWebDriver(new URL(host:4444/wd/hub"), desiredCapabilities); 方法2:我试图更改configuration文件首选项: FirefoxProfile profile = new FirefoxProfile(); profile.setPreference("webdriver.log.driver", "OFF"); profile.setPreference("webdriver.log.file","/dev/null"); 方法3:我试图修改位于/opt/selenium/config.json中的容器中的config.json: { "capabilities": [ { "browserName": "*firefox", "maxInstances": 1, "seleniumProtocol": "Selenium" }, […]

使用Docker为UItesting创build“可恢复”的MySQL数据库

我们有一些seleniumtesting,运行在我们的Web应用程序的生产式设置上。 问题是一些testing在影响数据库的应用程序中做了些什么。 是否有可能拥有数据量或类似数据,以便在每次testing之前“克隆”并附加到容器上? 我们真的只需要一个MySQL数据库,可以在每次testing之前快速重新创build。 偶尔我们会运行模式迁移到该数据库。 还是有另外一种方法可以更适合这个吗?

使用Pytest,Selenium Grid和Docker创buildtesting基础架构

基于这篇文章 ,我成功地创build了可扩展的selenium网格。 然后,我想运行我的testing套件(用Python编写),使用Pytest进入该网格。 我是Docker的新手,并试图find将我的testing过程迁移到微服务体系结构的最佳方法。 本质上,我想让开发人员能够在PC上本地设置完整的testing基础架构。 所以,我有4个Dockerfiles和1 个docker-compose.yml 。 BASE dockerfile: FROM ubuntu ENV SEL_VERSION 2.44.0 # Update repos for Java RUN apt-get update -qqy \ && apt-get -qqy –no-install-recommends install \ software-properties-common \ && rm -rf /var/lib/apt/lists/* RUN add-apt-repository -y ppa:webupd8team/java RUN echo debconf shared/accepted-oracle-license-v1-1 select true | debconf-set-selections RUN echo debconf shared/accepted-oracle-license-v1-1 seen true […]

你如何使用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实例的数量。