Tag: selenium

如何创build一个可变端口的selenium/独立铬图像(4444)

我想知道当我运行selenium容器而不是默认端口(4444)时,我怎么能通过一个不同的端口号作为参数? 通常我使用: docker run –shm-size=2G -d –net=host -e TZ=UTC -e SCREEN_WIDTH=1920 -e SCREEN_HEIGHT=1080 selenium/standalone-chrome:3.7.0 现在的selenium图像可以这样做,还是需要build立一个我自己的selenium图像,如果是这样,如何创build这种图像?

官方Selenium Hub docker镜像的自定义返回“权限被拒绝”

我从这里复制官方selenium网格枢纽的dockerfile。 我想定制它的configuration文件,所以不是复制[复制]他们,我添加他们[添加]的url。 所以这: COPY generate_config /opt/selenium/generate_config COPY entry_point.sh /opt/bin/entry_point.sh 变成这样: ADD https://gist.githubusercontent.com/myaccount/d5203b3e/raw/d8dfcd9fd/generate_config /opt/selenium/generate_config ADD https://gist.githubusercontent.com/myaccount/gfsfe2fc/raw/fdefe4e06/entry_point.sh /opt/bin/entry_point.sh 我在Win10上使用Docker-Toolbox,在Kitematic里面我看到: 难道我做错了什么? 我错过了什么吗? 这与操作系统的差异有关吗? dockerfile的目的不是为了构build跨平台的图像吗? -EDIT-另外…与selenium网格node-firefox dockerfile相关的事情发生。 从Kitematic我得到这个:

Dockernetworking不适用于bash入口点

首先,我们有一个像这样的Dockernetworking: docker network create cdt-net 然后我有这个bash脚本将启动一个selenium服务器: cd $(dirname "$0") ./node_modules/.bin/webdriver-manager update ./node_modules/.bin/webdriver-manager start 上面的bash脚本被这个Dockerfile调用: FROM openjdk:latest RUN apt-get update && \ apt-get -y install sudo RUN mkdir -p /root/cdt-webdriver WORKDIR /root/cdt-webdriver COPY start-selenium-server.sh . ENTRYPOINT ["/bin/bash", "/root/cdt-webdriver/start-selenium-server.sh"] 我会这样构build它: docker build -t cdt-selenium . 然后像这样运行它: docker run –network=cdt-net –name cdt-selenium -d cdt-selenium 我遇到的问题是,即使一切都干净而没有错误,同一个Dockernetworking中的其他进程也无法与Selenium服务器通信。 另一方面,如果我使用预先存在的映像创build一个selenium服务器,如下所示: docker run […]

Selenium无法find在单独的容器中运行的文件

我有4个容器在同一个Dockernetworking中运行 MongoDB的 我们的api服务器 selenium服务器 我们的testing自己 我从我们的testing容器中得到这个错误: WebDriverError: File not found: /root/cdt-tests/csv-data/IT-DE-Jasper.csv 但是,从我的testing日志,这个文件完全存在…在testing容器。 我想这个问题是因为selenium服务器运行在不同的容器中,所以selenium服务器并没有像我们的testing容器那样查看相同的文件系统。 解决这个问题的最好方法是什么? 一个。 我应该尝试在同一个容器中运行它们吗? 湾 我可以以某种方式让他们共享相同的文件系统? C。 ?

量angular器testing在Jenkins的Docker中随机超时,在本地Docker中正常工作

当使用由Protractor&Jasmine (默认/支持的量angular器运行程序)定义的API时,testing在个别开发人员笔记本电脑上始终可以正常工作。 由于某些原因,在Jenkins CI服务器上运行testing时,它们将会失败(尽pipe在两台主机上都有相同的docker容器,而且非常令人沮丧)。 发生此错误: Jasmine规范超时。 重置WebDriver控制stream程。 出现此错误: 错误:超时 – 在由jasmine.DEFAULT_TIMEOUT_INTERVAL指定的超时时间内未调用asynchronouscallback。 将getPageTimeout & allScriptsTimeout设置为30秒对此没有影响。 我尝试将jasmine.DEFAULT_TIMEOUT_INTERVAL更改为60秒,以便在此套件中的所有testing中,一旦出现第一个错误,那么每个testing都将等待完整的60秒并超时。 我已经阅读并重读了量angular器的页面,但是没有一个与这种情况有关。 甚至更奇怪的是,这似乎是某种缓冲区问题 – 起初testing将总是在特定的规格上失败,没有任何关于该规范的看法是错误的。 在debugging过程中,我将seleniumdocker容器从2.53.1-beryllium升级到了3.4.0-einsteinium ,并且testing仍然失败,但是它们没能成功解决一些问题 – 这意味着在更新中可能会有一些优化,所以能够得到在发出之前做了更多的事情。 我确认,通过重新排列规格的顺序 – 以前一直失败的规格现在已经过去,并且之前通过的testing开始失败(但与重新sorting之前的其他失败大致相同)。 环境: 量angular器 – 5.1.2 selenium/独立铬debugging – 3.4.0-einsteinium docker工 – 1.12.5

我如何在jenkins中安装selenium chrome驱动程序?

我已经拉我的本地主机端口8080 jenkins容器,揭露jenkins。 我可以看到jenkins运行良好。 我已经安装了PIP我已经安装了PIPselenium,当我运行testing时,我得到一个错误: + python /var/jenkins_home/workspace/My_Job/slenium_login.py 12:02:06 Traceback (most recent call last): 12:02:06 File "/var/jenkins_home/workspace/My_Job/slenium_login.py", line 6, in <module> 12:02:06 driver = webdriver.Chrome(cd) 12:02:06 File "/var/jenkins_home/shiningpanda/jobs/5db0e2cb/virtualenvs/d41d8cd9/local/lib/python2.7/site-packages/selenium/webdriver/chrome/webdriver.py", line 62, in __init__ 12:02:06 self.service.start() 12:02:06 File "/var/jenkins_home/shiningpanda/jobs/5db0e2cb/virtualenvs/d41d8cd9/local/lib/python2.7/site-packages/selenium/webdriver/common/service.py", line 81, in start 12:02:06 os.path.basename(self.path), self.start_error_message) 12:02:06 selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see […]

如何上传一个文件到docker中运行的seleniumtesting

我正在我的Windows系统中安装的Docker的Chrome容器中运行我的selenium javatesting。 testing上传将通过如果我在Windows中运行testing – 铬,但错误path is not absolute: D:\xyz.csv失败path is not absolute: D:\xyz.csv如果我在docker运行相同的testing。 我在docker中的chrome节点上推测我的testing。 正常的seleniumtesting在docker工作,但上传不。 请build议如何复制此容器内的文件,以提供上传testing的path.. 谢谢

Selenium Grid 100实例

我想用一个8CPU机器和16GB内存上的selenium网格,使用量angular器对50个谷歌浏览器实例进行自动testing开发。 但机器变得非常慢,负载平均超过40。 有人可以帮助我增加这台机器上的铬的实例

在docker和水豚的主机运行selenium

我在docker集装箱里用水豚进行了testing。 我用这个来设置selenium: Capybara.register_driver :selenium do |app| require 'selenium/webdriver' Selenium::WebDriver::Firefox::Binary.path = ENV['FIREFOX_BINARY_PATH'] || Selenium::WebDriver::Firefox::Binary.path Capybara::Selenium::Driver.new(app, :browser => :firefox) end 它运行时,我们运行与xvfbtesting,但我希望看到真正的浏览器,当testing正在运行,所以我正在寻找一种方法来使用浏览器的主机。 我认为可以在主机上启动geckodriver并共享端口4444,但是我还没有成功。 水豚每次都会在集装箱上发射一个新的虎钳。 我能做什么? 编辑1:添加更多信息 我所有的configuration我有水豚: #<Capybara::SessionConfig:0x0055ce67731a00 @always_include_port=false, @app_host="http://domain-test.engagement.lvh.me:1300", @automatic_label_click=false, @automatic_reload=true, @default_host="http://www.example.com", @default_max_wait_time=5, @default_selector=:css, @enable_aria_label=false, @exact=false, @exact_text=false, @ignore_hidden_elements=true, @match=:smart, @raise_server_errors=true, @run_server=true, @save_path=#<Pathname:/app/tmp/capybara>, @server_errors=[StandardError], @server_host=nil, @server_port=1300, @visible_text_only=false, @wait_on_first_by_default=false> 这是我的docker-compose文件: version: '3' services: web: build: . command: rails s […]

带有Docker的Selenium Grid设置Firefox的语言

我希望你能帮助我。 Selenium与Docker一起正在运行。 我能够从我的网格访问Web服务器,打开谷歌和做seleniumtesting步骤是没有问题的。 现在我想用特定的语言环境来testing我的应用程序。 @Before public void setUp() throws Exception { selenium = new DefaultSelenium("localhost",4444,"*firefox","http://wildfly:8080"); selenium.start(); } @Test public void testSeleniumSupplier() throws Exception { selenium.open("/"); selenium.click("link=Lieferant"); 不幸的是,我还没有开发这个应用程序,我只testing它。 我已经打开了一个错误,我无法使用语言环境en访问该网站。 我需要使用locale de访问此页面。 如何在Selenium或Docker中使用德语区域设置来访问该站点? 随着Webdriver我会知道如何改变,但不是在selenium网格,我是selenium新网格。 非常感谢您的帮助:)