Tag: selenium

如何通过docker撰写selenium服务器

如何通过docker将selenium服务器连接到另一个容器? 我的dicker-compose.yml是: version: '2' services: selenium: image: selenium/standalone-chrome ports: – "4444:4444" lamp: build: ./lamp ports: – "3306:3306" – "80:80" volumes: – /projects:/var/www/projects links: – selenium 然后 sudo docker exec -it composelamp_lamp_1 /bin/bash root@68a87ec3325f:/# curl http://127.0.0.1:4444/wd/hub curl: (7) Failed to connect to 127.0.0.1 port 4444: Connection refused 我做错了什么?

守夜人不断给502坏门户

我有一个Docker设置为nightwatch.js运行selenium网格testing快速服务器应用程序的seleniumtesting。 当我只是使用docker-compose up,然后在服务器启动后手动运行我的夜间testing时,所有东西看起来都正常启动。 如果我运行它们作为容器命令的一部分(即在我的应用程序服务器容器命令或基于它的一个新的容器运行nightwatch),那么我得到一个503错误的网关错误。 我认为在我的docker设置中有一个竞争条件造成这种情况。 有没有办法保证我的应用程序服务器正常启动之前运行我的夜游testing?

使用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: […]

Behat貂皮file upload找不到提交文件

我试图在Symfony应用程序中使用Sehat来testing使用Selenium / Mink的Behat。 该应用程序正在Docker容器中运行。 我将文件直接附加到input的NodeElement ,而不是使用$driver->attachFileToField('#id-of-input', $filePath)因为我们正在处理上下文中的大量input,该方法中的input被调用: $input->attachFile($this->filesPath . '1.jpg'); 由此产生的path是: /var/www/html/src/Resources/TestImages/1.jpg 该文件当然存在于Docker容器中的path中,但是当提交表单时,会抛出以下错误: 没有有用的日志。 我已经尝试在files_path中设置files_path参数,但是在testing运行期间出现错误: unknown error: path is not absolute: 3.jpg 我错过了什么吗? 该容器的文件path是否不正确? 我试过在我的机器上使用的abspath无济于事(虽然这种方法有严重的缺点,所以我很高兴这不是解决scheme): /Users/its.me/Sites/kbs/src/Resources/TestImages/1.jpg 本地Users目录也被安装到我的docker机器,以便abspath在主机上工作。 我认为这可能是权限相关,所以我把他们都读/写/执行,但没有雪茄! 相对path不起作用。 我的图像在哪里?

拒绝连接:Docker中的PHPUnitselenium

我将这两个容器连接起来(docker-compose.yml): test: container_name: test image: test ports: – "7761:80" links: – webdriver webdriver: container_name: webdriver image: webdriver “testing”包含一个正在运行的symfony网站。 'Webdriver'是一个定制的Ubuntu镜像,Selenium服务器在端口4444上使用ChromeDriver运行。 我在testing容器内的这个文件上运行PHPunit: class SeleniumTest extends PHPUnit_Extensions_Selenium2TestCase { public function setUp() { $this->setHost('webdriver'); $this->setPort(4444); $this->setBrowserUrl('http://localhost:7761'); $this->setBrowser('chrome'); } protected function login() { $this->url('/'); $content = $this->byTag('body')->text(); print $content; #…do tests… } } composer php: "phpunit/phpunit": "~4", "phpunit/phpunit-selenium": "~1" 无论BrowserUrl的价值是什么,我都无法获得连接。 […]

selenium在docker集装箱,我们可以采取屏幕截图

我试图在Docker容器(Linux Centos OS)中执行seleniumtesting。 我已经创build了三个docker集装箱,一个作为集线器,另外两个作为节点。 我正在尝试捕捉屏幕截图。 没有得到任何例外。 但我无法find容器上的屏幕截图(jpg文件)。 我想知道在Docker容器中运行testing时是否有可能进行屏幕截图,因为testing是在无头模式下运行的?

Docker容器中的Selenium WebDriverException:消息:连接被拒绝

我正在用Selenium + python + firefox做POC,很快我必须用chrometesting一下。 请参考我的github: https : //github.com/jauyzed/selenium-firefox-python 仅供参考:我没有提交所有必需的文件 当我运行容器时,我看到以下错误: Traceback (most recent call last): File "/root/selenium_wd_tests/google_test_ff.py", line 10, in setUp self.driver = webdriver.Firefox() File "/usr/local/lib/python2.7/distpackages/selenium/webdriver/firefox/webdriver.py", line 145, in __init__ keep_alive=True) File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 92, in __init__ self.start_session(desired_capabilities, browser_profile) File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 179, in start_session response = self.execute(Command.NEW_SESSION, capabilities) File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 236, in […]

如何绑定Jenkins生成输出与testing结果?

我正在设置自动protractortesting,在jenkins的帮助下,在jenkins容器中jenkins 。 但是没有能够使jenkins成果反映出testing结果(如果一些testing失败,构build也应该失败)。 重要的是要说所有的testing都应该运行,即使第一个testing失败。 testing是由docker-compose up –abort-on-container-exit ,我的docker-compose up –abort-on-container-exit -compose文件如下所示: version: '2' services: selenium: image: selenium/standalone-chrome ports: – 4444:4444 volumes: – /dev/shm:/dev/shm protractor: volumes: – ./reporting:/assets/reporting image: protractor-test command: "dockerize -wait http://selenium:4444 -timeout 60m protractor /assets/conf.js"

Docker-Selenium铬容器的最大数量

我正在使用Azure和Docker设置testing基础架构– Selenium HUB和Chrome图像 在AZURE上运行最新版本的Ubuntu 系统configuration Ubuntu:16 * Docker:最新版本RAM:6GB SSD:120GB 如果容器数量<= 10 ,则可以在Chrome容器中运行自动化脚本,而不会出现任何问题。 当我放大数字,整个系统冻结,没有响应和testing没有运行。 PS:在创build容器时,我还挂载了/dev/shm:/dev/shm 。 运行最less75个容器的最佳系统configuration是什么?

使用Docker,使用Selenium和Pytest来运行并行testing

我试图用这些所有的东西在一个无头的铬中运行并行testing: Docker,Selenium,Pytest 但是,我想知道在哪里运行系统的并行部分是有意义的? Docker可以做到这一点(使用selenium网格)。 这两个可以用来运行并行(和分布式)seleniumtesting。 例如 https://github.com/elgalu/docker-selenium https://github.com/zalando/zalenium 另外Pytest有自己的方式来运行并行testing(使用pytest-xdist) http://pytest.org/dev/xdist.html 运行10个并行pytest-xdist比运行10个docker容器更容易吗? 我将不胜感激找出每个的优点/缺点。 另外,任何想法如何一起使用这些东西? 有关这方面的信息似乎很稀疏。