Tag: selenium

将代理设置为docker selenium节点/ chrome

我尝试使用selenium集线器/节点作为像这里的[Docker容器] [selenium / node-chrome] [1]。 我也有代理经理在127.0.0.1:24000。 问题是:如何启动chrome节点,来自该节点的stream量将通过我的代理? 我试图在创buildweb驱动程序时将–proxy-server=http://127.0.0.1:24000作为chrome选项parameter passing,但是我想chrome会尝试在–proxy-server=http://127.0.0.1:24000中使用该主机/端口,而不是我的系统。 我不是一个有经验的docker用户,所以请尽可能简单地解释。

如何在Selenium Grid中并行执行webdriver

我在Docker中使用Selenium Grid,webdriver是facebook php-webdriver 。 在这个例子中,我如何运行webdriver并行: $options = new ChromeOptions(); $options->setExperimentalOption('prefs', [ 'download.default_directory' => Yii::getAlias('@runtime/selenium-download') ]); $capabilities = DesiredCapabilities::chrome(); $capabilities->setCapability(ChromeOptions::CAPABILITY, $options); $driver = RemoteWebDriver::create($host, $capabilities, 5000); $driver->get('http://google.com'); $driver->takeScreenshot('/tmp/google.png') 这是我的节点configuration browserTimeout:0 debugging:错误 帮助:错误 jettyMaxThreads:-1 端口:5555 angular色:节点 超时:30 cleanUpCycle:5000 主持人:172.24.0.3 maxSession:3 function:function[{seleniumProtocol = WebDriver,browserName = chrome,maxInstances = 3,版本= 62.0.3202.62,applicationName =,platform = LINUX]] downPollingLimit:2 hub:http:// hub:4444 / grid / […]

selenium/节点 – Firefox的老版本的Firefox

我正在尝试使用Firefox 47.0.1创buildDocker容器。 我已经从SeleniumHQ github中复制dockerfile,将ARG FIREFOX_VERSION更改为47.0.1。 但是正在编译的容器显示:“XPCOMGlueLoad文件错误/opt/firefox-47.0.1/lubxul.so:libasound.so.2:无法打开共享目标文件:目录中没有这样的文件无法加载XPCOM。 我试图安装“apt-get install libasound2”,但它没有帮助。 有人可以帮助解决问题,使selenium/ node-firefox运行? Dockerfile: 在这里input图片描述

在Docker中运行的量angular器testing中使用Chrome驱动程序

我在使用量angular器的Docker中工作时遇到了一些麻烦,下面是我的protractor.conf.js文件: 'use strict'; const seleniumHost = process.env.CDT_SELENIUM_HOST || 'localhost'; const cdtServerHost = process.env.OPENSHIFT_NODEJS_IP || 'localhost'; const cdtServerPort = process.env.OPENSHIFT_NODEJS_PORT || 3040; const jasmineReporters = require('jasmine-reporters'); const util = require('util'); /////////////////////////////////////////////////////////////////////////////// exports.config = { params: { env: process.env.CDT_PROTRACTOR_ENV || 'local' }, noColors: process.env.PROTRACTOR_NO_COLORS === 'yes', chromeDriver: '/usr/bin/google-chrome', onPrepare: function () { global.projectRoot = String(__dirname); let env […]

docker工人黄昏浏览器不能另一个web服务器容器

像以下关于服务器地址一样设置.env。 APP_URL=http://localhost:8000 APP_DOMAIN=localhost 我使用apache2(docker容器)作为Web服务器。 在这种情况下,在黄昏testing,启动selenium/独立铬作为另一个容器。 docker run -p 4444:4444 –name selenium –link apache2:apache2 -d selenium/standalone-chrome 为了确认docker容器之间的连接,使用了下面的命令 docker exec -it selenium bash, cat /etc/hosts/ 结果是172.17.0.6 apache2 a1c15575e4c8 也从selenium容器确认ping apache2。 但是从这里开始,不能使用下面的命令做黄昏testing。 当我检查浏览器响应时,没有内容。 docker exec apache2 php artisan dusk 我认为设置是错误的。 但不能注意到它。 你能帮忙吗? 以下是php的源代码。 DuskTestCase.php abstract class DuskTestCase extends BaseTestCase { use CreatesApplication; /** * Prepare for Dusk test […]

如何解决docker文件中的“sh:0:无法打开start.sh”?

我创build了一个包含以下CMD的Docker镜像: CMD ["sh", "start.sh"] 当我运行Docker镜像时,我在Makefile使用下面的命令 docker run –rm -v ${PWD}:/selenium $(DOCKER_IMAGE) 它将当前(主机)目录中的文件复制到docker的/selenium文件夹中。 这些文件包括seleniumtesting文件,以及文件start.sh 。 但在容器启动后,我立即得到了错误 "sh: 0: Can't open start.sh" 也许在命令运行后主机卷被挂载在docker中? 还有什么可以解释这个错误,以及如何解决它? 也许有一种方法可以在Docker中运行多个命令来查看发生了什么? 喜欢 CMD ["ls", ";", "pwd", ";", "sh", "start.sh"] 更新 当我使用下面的命令我Dockerfile CMD ["ls"] 我得到错误 ls: cannot open directory '.': Permission denied 额外的信息 Docker版本1.12.6 入口点: WORKDIR /work

Dockerselenium网格或Saas解决scheme(Sauce Labs)

为什么使用Saas解决scheme(比如Sauce Labs),devopsbuild立自己的selenium网格? 我试图build立自己的CI / CDpipe道,我不确定要走哪条路线。 优点/缺点也许?

Dockerselenium轮毂端口错误,同时共享图像

我成功地使用了docker selenium / hub和chrome和Firefox的节点,在Docker镜像中运行我的脚本。 现在我想分享docker集线器上的代码,以便我可以在任何使用该图像的设备上执行相同的testing。 为此,我已经将我的项目转换为可执行的jar,然后使用Dockerfile在我的映像中添加了该jar。 现在我的系统上,该jar是工作文件。 但是,如果我通过从dockerhub中将其拖到另一个系统上来使用该映像,则会出现http:// mylocalhost:端口的错误。 我如何解决这个问题? 错误: – 错误屏幕截图 我的猜测是每个系统的selenium中枢变化的端口。 Dockerfile: – FROM java:8 EXPOSE 8080 ADD /Docker.jar Docker.jar ENTRYPOINT ["java","-jar","Docker.jar"] DockerFile selenium脚本

如何使用GitLab CI设置Selenium E2Etesting?

我正在开发一个网站前端的Vue.js应用程序。 对于这个应用程序,我想使用单元和E2Etesting。 我用vue-cli构build了我的项目。 根据我的理解,vue-cli使用Karma进行unit testing,使用Nightwatch + Selenium进行E2Etesting。 我的.gitlab-ci.yml如下所示: stages: – test test:express: image: node:boron stage: test script: – cd backend/ – npm install –progress=false – ./node_modules/.bin/jasmine test:vue: image: node:boron stage: test script: – cd frontend/ – npm install –progress=false – npm test npm test运行e2e和unit testing,并在本地计算机上运行。 unit testing运行顺利,Selenium调出Chrome窗口并使用E2Etesting。 问题是不知道如何在GitLab CI上运行E2E Seleniumtesting。 它不断给我一个错误说: Could not connect to […]

Docker selenium 2.53不能用envvariables覆盖maxInstances和maxSession

所以我有以下docker组合configuration: selenium-hub: image: selenium/hub:2.53.1 environment: – GRID_BROWSER_TIMEOUT=30000 chrome: image: selenium/node-chrome-debug:2.53.1 volumes: – /dev/shm:/dev/shm # Mitigates the Chromium issue described at https://code.google.com/p/chromium/issues/detail?id=519952 environment: – NODE_MAX_INSTANCES=4 – NODE_MAX_SESSION=4 firefox: image: selenium/node-firefox-debug:2.53.1 environment: – FIREFOX_VERSION=45.8.0 – NODE_MAX_INSTANCES=4 – NODE_MAX_SESSION=4 即使我重写NODE_MAX_INSTANCES和NODE_MAX_SESSION,我仍然可以在maxSession=1看到maxSession=1和maxInstances=1 ,所以问题是,这里可能是什么问题,因为大多数情况下它是在官方selenium泊坞窗维基?