Tag: selenium

带有铬的selenium网格不能绕过代理

我正在尝试在几个docker组件之间创build一个selenium集成testing。 Selenium Grid集线器在另一个节点上运行,然后在chrome节点上运行。 集线器正在成功启动并且chrome节点已注册: Registered a node http://172.20.0.8:5555 在此之后,我开始junittesting,以获得在不同的docker节点上运行的login页面 DesiredCapabilities chromeCapabilities = DesiredCapabilities.chrome(); WebDriver chrome = new RemoteWebDriver(new URL("http://hub:4444/wd/hub"), chromeCapabilities); chrome.get("http://host_address/login"); GET调用被5555端口上运行的本地代理捕获,最后我得到一个代理错误:“ERR_CONNECTION_REFUSED”。 完整的环境运行在virutalbox WIN7遗留模式(因为win7只支持这个)。 我的问题是: 为什么来自中心的电话会通过本地代理呢? 为什么不直接调用铬节点? 不知何故,铬的节点可以在不同的端口上启动,集线器将在该主机和端口上调用它? 请不要显示cli命令我正在使用Junit作为完全虚拟docker环境中的testing驱动程序,我只能从docker-compose.yml或java代码进行pipe理。

如何将selenium html-runner与docker结合使用?

我试图设置一个使用selenium-html-runner的docker镜像来运行从Selenium IDE生成的html文件来自动testing它们。 不过,我在Docker容器中运行Firefox浏览器的GUI非常困难。 我发现了下面的文章( https://medium.com/@yiquanzhou/run-selenium-ui-tests-in-docker-container-78be98e1b52d ),但是在运行命令时不工作: Xvfb :99 -ac & 我打算设置所有必要的configuration,以便我可以运行以下命令: java -Dwebdriver.gecko.driver="/path/to/geckodriver" -jar "path/to/selenium-html-runner.jar" -htmlSuite "*firefox" "https://www.target-website.com" "test_suites/" "results/" 有没有人有以前的经验,在容器内运行selenium-html-runner? 先谢谢你!

从另一个Docker实例运行Zaleniumtesting

对于我们的自动化testing目的,我正在尝试使用Zalenium Docker系统来运行UItesting。 testing在Jenkins从服务器上执行,并从pipe道脚本执行: docker run –rm –name zalenium –detach -p 4444:4444 -v /var/run/docker.sock:/var/run/docker.sock -v /tmp/videos:/home/seluser/videos –privileged dosel/zalenium start" 然后,我使用另一个Docker容器来执行testing: docker run –privileged –rm –volume=${workingDirectory}:/volume/git –workdir='/volume/git' some-container-name:0.1 mvn -f /project/pom.xml clean test -Dselenium.hub='http://localhost:4444' 当我执行testing时,我看到以下错误: Tests run: 3, Failures: 2, Errors: 0, Skipped: 1, Time elapsed: 1.824 sec <<< FAILURE! – in TestSuite setupBrowser(com.skybet.myaccount.login.usingCorrectDetails) Time elapsed: 1.108 […]

Selenium节点泊坞窗图像NODE_MAX_SESSION和NODE_MAX_INSTANCES envvariables

我正在使用来自Selenium wiki的 docker撰写文件。 对于chrome和firefox节点,有NODE_MAX_SESSION和NODE_MAX_INSTANCESvariables。 我的理解是正确的 – configurationNODE_MAX_SESSION或NODE_MAX_INSTANCES铬或火狐图像没有区别,例如铬节点只能启动铬浏览器和Firefox浏览器只有firefox节点。 那么为什么有两个呢?

使用squid代理连接时ERR_PROXY_CONNECTION_FAILED

我的Mac本地Docker上有一个squid代理容器(datadog / squid image)。 本质上,我使用这个代理,以便我的本地泊坞窗上的应用程序容器和另一台主机上的浏览器窗格(Selenium)使用相同的networking进行testing(以便远程浏览器可以访问应用程序主机)。 但是用我目前的设置,当我运行我的testing时,浏览器在远程主机上启动,然后在testing失败之后。 在closures之前浏览器上的消息是ERR_PROXY_CONNECTION_FAILED 。 所以我认为我的鱿鱼代理configuration有一个问题。 我使用默认configuration,并在docker集线器网站上说 Please note that the stock configuration available with the container is set for local access, you may need to tweak it if your network scenario is different. 我不太确定我的networking情况如何。 我应该寻找更多的信息? 谢谢!

创builddocker文件来运行基于selenium Javascript的testing

我正在尝试创build一个docker文件来运行基于java脚本的项目的seleniumtesting。 下面是我的docker文件到目前为止: #base image FROM selenium/standalone-chrome #access to the project within docker container – Bundle app source COPY ./seleniumTest/project /app # Install Node.js RUN sudo apt-get update RUN sudo apt-get install –yes curl RUN curl –silent –location https://deb.nodesource.com/setup_8.x | sudo bash – #binding EXPOSE 8080 #Define runtime ENTRYPOINT /app/login.test.js 同时构build并运行$ docker run -p 4000:8080 dockertest2镜像: […]

Watir Chrome无头docker

我试图通过在Docker上运行我的testing套件来简化我的Seleniumtesting。 我正在运行一个Debian Jessie的图像,安装了从PPA和chromedriver 2.33安装的google-chrome-stable。 我还附加了/ dev / shm来最大化我的内存容器。 我已经validation了chromedriver在容器内运行良好。 但是,当我运行一个简单的testing时,我得到一个超时: browser = Watir::Browser.new :chrome, headless: true browser.goto 'google.com' browser.text_field(title: 'Search').set 'Hello World!' browser.button(type: 'submit').click puts browser.title browser.quit /usr/local/lib/ruby/2.4.0/net/protocol.rb:176:in `rbuf_fill': Net::ReadTimeout (Net::ReadTimeout) from /usr/local/lib/ruby/2.4.0/net/protocol.rb:154:in `readuntil' from /usr/local/lib/ruby/2.4.0/net/protocol.rb:164:in `readline' from /usr/local/lib/ruby/2.4.0/net/http/response.rb:40:in …… 有一点要提到的是,chromedriver安装在/ chromedriver / chromedriver,然后添加到$ PATH。 Watir / Selenium是否需要知道镀铬汽油的完整path? 是否需要在后台运行chromedriver或铬?

运行docker映像失败

我期望成功运行docker镜像,但无法访问和获取权限拒绝错误,如下所示。 #base image FROM selenium/standalone-chrome # Install Node.js RUN sudo apt-get update RUN sudo apt-get install –yes curl RUN curl –silent –location https://deb.nodesource.com/setup_8.x | sudo bash #Define runtime ENTRYPOINT /app/login.test.js 为什么被拒绝的权限呢? PS:我改变了包含Dockerfile和自动化testingJS文件的cd dir ( cd dir )。

docker文件在JS文件中运行自动化testing

我正在尝试创build一个docker文件来运行基于java脚本的项目的seleniumtesting。 下面是我的docker文件到目前为止: #base image FROM selenium/standalone-chrome #access to the project within docker container – Bundle app source COPY ./seleniumTest/project /app # Install Node.js RUN sudo apt-get update RUN sudo apt-get install –yes curl RUN curl –silent –location https://deb.nodesource.com/setup_8.x | sudo bash – #binding EXPOSE 8080 #Define runtime ENTRYPOINT /app/login.test.js 同时运行$ docker run -p 4000:80 lamgadekamal/dockertest […]

启动已启动并停止的容器

我开始使用一个容器 docker run -d –link hub:hub –name chromeNode selenium/node-chrome 现在,如果我运行相同的命令,我知道它会给我一个错误,如下所示 docker: Error response from daemon: Conflict. The name "/chromeNode" is already in use by container f05717d38a676946be74300768dd3d2cb9dd6733d88e1c1e46d85cef3de18c06. You have to remove (or rename) that container to be able to reuse that name.. See 'docker run –help'. 所以如果我必须启动相同的容器chromeNode docker start chromeNode会自动链接到hub因为我不使用 – –link参数? 或者我应该摧毁一个容器,每次都run一个新容器?