Tag: selenium

Docker中的Selenium独立服务器 – TimeoutException

我尝试在Selenium Docker容器中使用ChromeDriver 2.31执行基于WebDriver 3.5的testing。 我用这个命令来启动必要的容器: docker run -d -p 4444:4444 -v /dev/shm:/dev/shm selenium/standalone-chrome:3.5.3-astatine 我使用RemoteWebDriver在远程主机上执行testing套件。 它以下面的日志失败: org.openqa.selenium.TimeoutException:timeout(会话信息:chrome = 61.0.3163.79)(驱动程序信息:chromedriver = 2.31.488763,platform = Linux 4.10.0-33-generic x86_64)(警告:服务器没有提供任何stacktrace信息)构build信息:版本:'3.5.2',修订:'10229a9',时间:'2017-08-21T17:29:55.15Z'驱动程序信息:org.openqa.selenium.remote.RemoteWebDriverfunction[{applicationCacheEnabled = false,rotate = false,mobileEmulationEnabled = false,networkConnectionEnabled = false,chrome = {chromedriverVersion = 2.31.488763,userDataDir = /tmp/.org.chromium.Chromium.IAkqFG},takeHeapSnapshot = true,pageLoadStrategy = normal,unhandledPromptBehavior =我们可以使用下面的方法来创build一个新的数据types,其中的数据types可以是数据types:数据types,数据types,数据types,数据types,数据types,数据types,数据types, javascriptEnabled = true,cssSelectorsEnabled = true,setWindowRect = true,un expectedAlertBehaviour =}] 我检查了http://:4444 / wd […]

Selenium集线器失去与并行执行失败的节点之一的连接

我有一个问题在执行我的testing并行使用docker容器与selenium网格,虽然testing运行良好的串行。 但是当我在firefox和chrome上并行运行testing时,testing会停在中间,下面的例外。 我已经debugging,发现刚刚一个屏幕导航selenium毂容器丢失连接到Firefox的节点,但他们的行动正在执行的铬节点,它也是如此。 任何想法为什么连接丢失FF? 请帮忙。 org.openqa.selenium.StaleElementReferenceException:陈旧元素引用:元素未附加到页面文档org.openqa.selenium.WebDriverException:未知错误:元素在点(84,913)处不可点击。 我不明白为什么这个问题在并行执行中发生。 我粘贴我的testng.xml和下面的错误 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd"> <suite name="Suite" verbose="1" thread-count="2" parallel="tests"> <listeners> <listener class-name="com.atwApply.utilities.TestNGExecutionListener"></listener> </listeners> <test name="TestChrome"> <parameter name="browser" value="chrome"></parameter> <classes> <class name="com.app.executor.RunCukesByFeatureForChrome"/> </classes> </test> <test name="TestFirefox"> <parameter name="browser" value="firefox"></parameter> <classes> <class name="com.app.executor.RunCukesByFeatureForFirefox"/> </classes> </test> <!– Test –> </suite> 和错误是 org.openqa.selenium.StaleElementReferenceException: stale element reference: element is […]

Selenium Hub请求function与浏览器节点function不匹配

我试图在我已经build立的selenium中心点一些testing,我遇到了浏览器的configuration/function的一些可能的问题。 当我查看我在minikube中设置的Hub Pod的日志时,我看到以下消息(多次,testing脚本重试几次然后放弃并显示失败状态) 16:26:14.221 INFO – Got a request to create a new session: Capabilities [{loggingPrefs=org.openqa.selenium.logging.LoggingPreferences@5a4fa56e, timeZone=Greenwich, unhandledPromptBehavior=ignore, version=47, platform=ANY, public=share, acceptSslCerts=true, name=dockerdev : Web UI Smoke test, browserName=firefox, idle-timeout=90, platformName=ANY, maxDuration=1800, firefox_profile=UEsDBBQACAgIAEeDM0sAAAAAAAAAA…, unexpectedAlertBehaviour=ignore}] 16:26:14.222 INFO – Error forwarding the new session cannot find : Capabilities [{loggingPrefs=org.openqa.selenium.logging.LoggingPreferences@4790a536, timeZone=Greenwich, unhandledPromptBehavior=ignore, version=47, platform=ANY, public=share, acceptSslCerts=true, name=dockerdev : […]

无法截图使用Firefox节点

我的Seleniumtesting旨在对失败进行截图并将其添加到报告中。 屏幕截图显示铬浏览器完美,但Firefox的截图只是白色矩形。changelog说一些关于“通过”模式https://github.com/SeleniumHQ/selenium/blob/master/java/CHANGELOG ,我试图禁用,但似乎没有任何工作。 这是我的docker撰写文件: seleniumhub: image: selenium/hub ports: – 4444:4444 firefoxnode: image: selenium/node-firefox-debug ports: – 4577 links: – seleniumhub:hub environment: – enablePassThrough=false – NODE_MAX_INSTANCES=5 – NODE_MAX_SESSION=5 chromenode: image: selenium/node-chrome-debug ports: – 4578 links: – seleniumhub:hub environment: – NODE_MAX_INSTANCES=5 – NODE_MAX_SESSION=5

Docker&Selenium无法连接到渲染器

我正在尝试安装浏览器testing与selenium和docker与behat。 我所遇到的主要问题是运行testing时的可靠性。 有时候我可以联系起来,能够正常运行testing,但是很多时候我不能。 这似乎很不一致,我启动容器和运行testing,第一次失败,再次运行,第二次运行,并正常工作。 一旦我重新启动selenium毂,再次运行testing,很好(主要)。 谢谢您的帮助。 我得到一个常见的错误是: Could not open connection: session not created exception from disconnected: unable to connect to renderer (Session info: chrome=61.0.3163.91) (Driver info: chromedriver=2.32.498513 (2c63aa53b2c658de596ed550eb5267ec5967b351),platform=Linux 4.4.0-96-generic x86_64) (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 411 milliseconds Build info: version: '3.5.3', revision: 'a88d25fe6b', time: '2017-08-29T12:54:15.039Z' System […]

由集线器创build的testing会话,但不由selenium节点执行

我正在使用最新的selenium和Firefox版本(webdriver 55.0.3)。 在Selenium Grid控制台上,我的firefox节点的function是: [{seleniumProtocol=WebDriver, acceptSslCerts=true, screen-resolution=1900×1880, tz=Greenwich, browserName=firefox, maxInstances=1, screenResolution=1900×1880, resolution=1900×1880, version=55.0.3, platform=LINUX}] 目前,当我的testing脚本正在运行时,会发生什么情况是脚本停止尝试启动远程webdriver,然后超时将Web UItesting标记为“已完成”。 该脚本然后移动到其他非UItesting。 在testing执行结束时,它会显示所有非UItesting已经通过,但并没有说UI的失败或已被跳过。 他们的地位是未知的。 最后的信息会是这样的 Tests Passed: 80 Skipped: 0 Failed: 0 实际上应该有100个testing,包括UItesting。 testing执行完成后,下面是来自集线器的日志的一部分: 20:04:28.043 INFO – my-browser-pod1 [bash, -c, cleanup-container.sh] 20:04:28.173 INFO – my-browser-pod1 20:04:28.174 DEBUG – Test count: 14 20:04:28.174 DEBUG – Test count with video: 1 20:05:27.854 […]

用docker和selenium读取本地URL

我正在制造一个用selenium自动化的docker集装箱。 目前,我所做的只是读标题。 这对实际的活动URL很好,但我想使用我的本地DNS。 我有我的本地机器/ etc / hosts中的以下内容 172.31.249.112 site.dev 172.31.249.112 www.site.dev 172.31.249.112 xhprof.site.dev 当我运行: browser.get('http://site.dev/') 我得到的错误: selenium.common.exceptions.WebDriverException: Message: Reached error page: about:neterror?e=dnsNotFound&u=http%3A//site.dev/&c=UTF-8&f=regular&d=Firefox%20can%E2%80%99t%20find%20the%20server%20at%site.dev. 如何使容器以某种方式解决我的本地(主机)DNS?

Docker + Selenium Grid:是否有可能进行真正的跨平台testing?

我是Docker的新手,我正在探索Docker作为构build更稳定和可维护的Selenium GRID的一种方式。 我已经完成了Udemy的Docker + Selenium Grid课程,但是我仍然不知道几件事情。 我的公司有一个门户网站,我需要validation各种浏览器和操作系统的function: 最近版本的Mac,Linux和Windows上的最近版本的Chrome 最近版本的Mac,Linus&Windows上最新版本的Firefox Mac上最新版本的Safari 最近版本的Windows上最新版本的IE和Edge 据我所知,一个Docker容器是'类似linux'的。 这是否意味着它仅用于在Linux上validationChrome和Firefox。 有没有办法使用Docker来validation这些其他浏览器+操作系统组合?

如何使用Selenium Docker映像连接到本地主机站点?

我有一个节点应用程序,我可以从node server.js开始并访问localhost:9000。 我有一系列selenium运行良好的e2etesting,但我现在正在寻找使用docker selenium镜像。 我使用docker run -d -p 4444:4444 selenium/standalone-chrome启动Docker镜像 我将e2etesting代码改为: var driver = new webdriver.Builder(). usingServer('http://127.0.0.1:4444/wd/hub'). withCapabilities(webdriver.Capabilities.chrome()). build(); // driver.manage().window().setSize(1600, 1000); return driver.get('http://127.0.0.1:9000') .then(function() { // driver.executeScript('localStorage.clear();') return driver }); 但是selenium根本无法连接到应用程序! (如果我取消setSize行的注释,程序就会在那里失败) 我有服务器运行,它确实可以在localhost:9000访问。 我怎样才能让我的testing正确使用dockerizedselenium,并正确地指向本地主机上的服务器?

Dockerizedselenium与轨道testing

我想在docker中运行selenium chrome的rspectesting,但是发现了几十个错误。 最后我连接水豚到远程水豚,但现在我得到了这些错误: 有0个失败和2个其他错误: 1.1) Failure/Error: visit new_user_session_path Selenium::WebDriver::Error::WebDriverError: unexpected response, code=404, content-type="text/html" <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <title>Action Controller: Exception caught</title> ……………….. Failure/Error: raise Error::WebDriverError, msg Selenium::WebDriver::Error::WebDriverError: unexpected response, code=404, content-type="text/html" <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <title>Action Controller: Exception caught</title> <style> body { background-color: #FAFAFA; …………… 所以这里是我的rails_helper.rb 。 […]