Tag: selenium webdriver

带有UI的Docker中的Seleniumtesting执行

我试图在TypeError: module.exports.browser.isElementPresent is not a function机器上运行seleniumtesting(Node Js),但它说“ TypeError: module.exports.browser.isElementPresent is not a function ”。 注意: 我可以成功地在我的本地机器上运行这个相同的seleniumtesting 我试图在docker上运行相同的testing,然后我遇到了上述错误 root@6cd7ab2eb6f7:/usr/src# npm run kongaezv2 npm info it worked if it ends with ok npm info using npm@4.1.2 npm info using node@v7.6.0 npm info lifecycle cerebro@0.0.1~prekongaezv2: cerebro@0.0.1 npm info lifecycle cerebro@0.0.1~kongaezv2: cerebro@0.0.1 > cerebro@0.0.1 kongaezv2 /usr/src > mocha –recursive […]

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 […]

由集线器创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 […]

虚拟机vs容器vs云

我想运行UI automated tests ,对于我应该运行testing的平台(比如Cloud vs VMs vs Containers ,我有点困惑。 有人可以帮助我哪个平台更有利目标应用程序是基于Web和移动的应用程序,我将用于自动化的工具是Selenium and Appium

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 。 […]

如何在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 / […]

如何传递本地文件的文件path对于通过Jenkins Job在Selenium Grid Docker上运行的Selenium Web Automation

我有一个Jenkins Job,它使用Selenium Grid Docker运行我的Selenium Web自动化项目。 Docker正在testing服务器上运行。 我能够成功地运行这项工作,直到我必须通过一个文件(一个图像文件),我必须在网页上上传。 现在,当我在本地运行代码时,它可以正常工作,因为映像文件位于本地计算机文件夹中,并且可以通过我已经通过的path进行访问。 但在jenkins的情况下,本地文件的位置不可访问,我得到文件未findexception。 所以我的问题是如何传递本地文件path,以便它可以从jenkins访问。 在后台,Jenkins服务器连接到GIT / Stash,从中select自动化代码。

在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 […]

创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镜像: […]