我正在使用 IE 特定应用程序在 Selennium Webdriver2 中工作。我知道我们可以截取执行的截图。同样,是否有任何选项可以将 selenium 执行记录为视频?
我有两台机器,一台装有我需要的所有东西(Eclipse + TestNG + 脚本),另一台只安装了浏览器。我使用 Selenium Grid 2.35.0。
除了我经常收到此错误的问题外,一切似乎都很好:
Error communicating with the remote browser. It may have died.
脚本一点也不复杂,我一一运行,所以它只是随机发生的。我不认为这是因为浏览器。任何想法/修复?如果您需要更多信息,我在这里。
我是网络驱动程序的新手,我为web应用程序编写了一个包含backbone.js和select2的selenium脚本.
我以前经常使用NosuchElementException而Element不是可点击的例外.所以我决定编写如下脚本, - 在点击任何元素之前,它将使用显式等待等待元素的存在.即在单击任何元素之前,它将等待元素加载.
在点击之前等待每个元素是最佳做法吗?
我有一组并行测试,当我在本地运行它们时从来没有这个问题。这仅发生在我那小小的两节点网格上。当我尝试调用WebDriver.getCurrentUrl(). 错误信息是这样的:
org.openqa.selenium.WebDriverException: Session [035e8f79-fdd7-4492-a565-f803df792d3c] was terminated due to TIMEOUT
Command duration or timeout: 90 milliseconds
Build info: version: '2.53.0', revision: '35ae25b1534ae328c771e0856c93e187490ca824', time: '2016-03-15 10:43:46'
System info: host: 'bos-mpky6', ip: '172.30.31.59', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.11.6', java.version: '1.8.0_102'
Driver info: org.openqa.selenium.remote.RemoteWebDriver
Capabilities [{applicationCacheEnabled=true, rotatable=false, handlesAlerts=true, databaseEnabled=true, version=46.0.1, platform=LINUX, nativeEvents=false, acceptSslCerts=true, webdriver.remote.sessionid=035e8f79-fdd7-4492-a565-f803df792d3c, webStorageEnabled=true, locationContextEnabled=true, browserName=firefox, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true}]
Session ID: 035e8f79-fdd7-4492-a565-f803df792d3c
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:678) …Run Code Online (Sandbox Code Playgroud) 目前,我的框架代码是用 Java/Maven 编写的,我想使用 Selenium 网格和 Jenkins 运行此代码。我已将 Jenkins 配置为从 SVN 中提取最新代码,并已将 Jenkins 设置为集线器。
我想知道的是如何让 Jenkins 管理虚拟机?例如,如何让 Jenkins 使用 Windows 7 或 10 启动虚拟机,使用我需要测试的任何浏览器,以及如何让虚拟机将自己声明为节点?
我是手动配置虚拟机/节点并让它们保持活动状态,还是有办法使用 Jenkins 自动执行此过程?
continuous-integration selenium-grid jenkins jenkins-plugins
我无法使用 geckodriver 从 Selenium 驱动 Firefox。这很奇怪,因为 chrome 是用相同的框架驱动的,没有错误!
这些是我的版本号:
Firefox 54.0 (64-bit)
Chrome Version 62.0.3202.94 (Official Build) (64-bit)
selenium-server-standalone-3.7.1.jar
client-combined-3.5.3-nodeps.jar
geckodriver-v0.19.1-linux64
chromedriver_linux64
Ubuntu 16.10
Run Code Online (Sandbox Code Playgroud)
我从带有 java 的 Selenium webdriver 得到的错误如下:
--------------------------------Error:
leder@leder-VirtualBox:~/Source/SeleniumCheese/bin$ ./execute_grid.sh
Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Unable to create new service: GeckoDriverService
Build info: version: '3.7.1', revision: '8a0099a', time: '2017-11-06T21:07:36.161Z'
System info: host: 'leder-VirtualBox', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '4.8.0-59-generic', java.version: '1.8.0_131'
Driver info: driver.version: unknown
Command duration or timeout: 1.39 seconds
---------------------------------Schnapp
Run Code Online (Sandbox Code Playgroud)
这是我的设置,firefox 坏了,chrome 没问题: …
我创建了一个运行 2 个 java 进程的 docker 容器 - 其中一个进程正在侦听端口 4444,并且应该可以通过浏览器访问以下 URL:
http://{主机}:4444/grid/console
如何从主机上的浏览器访问此 URL - 连接到端口 4444 上的容器?
这是 docker 检查的响应:
[
{
"Id": "3bef855324d8c78fcd3a7ac4e52d1641437f221ebe64af5651641d776cfa1bde",
"Created": "2018-02-22T14:54:37.025854258Z",
"Path": "/bin/bash",
"Args": [],
"State": {
"Status": "running",
"Running": true,
"Paused": false,
"Restarting": false,
"OOMKilled": false,
"Dead": false,
"Pid": 12320,
"ExitCode": 0,
"Error": "",
"StartedAt": "2018-02-22T14:54:37.487535484Z",
"FinishedAt": "0001-01-01T00:00:00Z"
},
"Image": "sha256:422dc563ca3260ad9ef5c47a1c246f5065d7f177ce51f4dd208efd82967ff182",
"ResolvConfPath": "/var/lib/docker/containers/3bef855324d8c78fcd3a7ac4e52d1641437f221ebe64af5651641d776cfa1bde/resolv.conf",
"HostnamePath": "/var/lib/docker/containers/3bef855324d8c78fcd3a7ac4e52d1641437f221ebe64af5651641d776cfa1bde/hostname",
"HostsPath": "/var/lib/docker/containers/3bef855324d8c78fcd3a7ac4e52d1641437f221ebe64af5651641d776cfa1bde/hosts",
"LogPath": "/var/lib/docker/containers/3bef855324d8c78fcd3a7ac4e52d1641437f221ebe64af5651641d776cfa1bde/3bef855324d8c78fcd3a7ac4e52d1641437f221ebe64af5651641d776cfa1bde-json.log",
"Name": "/hint-env",
"RestartCount": 0,
"Driver": "overlay2",
"Platform": "linux",
"MountLabel": "",
"ProcessLabel": "",
"AppArmorProfile": "", …Run Code Online (Sandbox Code Playgroud) 我是 Selenium 的新手并开始学习它。但 Selenium Grid 不适合我。使用的服务器版本是selenium-server-standalone-3.14.0.jar。使用命令,集线器和节点正在运行。将节点添加到 hub 的代码是使用 Eclipse 中的 TestNG 编写的。代码如下:
ChromeOptions options = new ChromeOptions();
options.setCapability(CapabilityType.PLATFORM_NAME, Platform.WIN10);
options.setCapability(CapabilityType.BROWSER_NAME, "chrome");
driver = new RemoteWebDriver(new URL("http://192.xxx.x.xx:48807/wd/hub"), options); driver.get("https://www.amazon.in/");
Run Code Online (Sandbox Code Playgroud)
运行测试时,出现以下错误并且未创建会话:
org.openqa.selenium.WebDriverException: Unable to parse remote response:
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:111)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:73)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:136)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:548)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:212)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:130)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:143)
at grid.Node2.f(Node2.java:44)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:124)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:580)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:716)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:988)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
at org.testng.TestRunner.privateRun(TestRunner.java:648)
at org.testng.TestRunner.run(TestRunner.java:505)
at …Run Code Online (Sandbox Code Playgroud) 是否可以将 selenium hub 与 Internet Explorer 节点一起使用?
我可以将 Selenium hub 与 Firefox 和 Chrome 节点结合使用,使用 docker 和 kubernetes 以及https://hub.docker.com/u/selenium上的图像。但在 Selenium 的 docker hub 中没有 Internet Explorer 图像。还有另一种方法可以做到这一点(使用 docker 和 kubernetes)吗?
testing selenium automated-tests selenium-grid selenium-webdriver
使用:
我目前正在尝试在 docker 容器中运行 selenium Grid,但遇到了一些问题。我在我的 PC 和虚拟机上都启用了 Hyper-V 和容器。
问题是,与我以前的同事不同,我使用的是 Windows 虚拟机而不是 Linux 虚拟机。当我尝试在虚拟机中运行 docker 时,它说我需要启用嵌套虚拟化。
这是正确的还是我不应该在虚拟机上运行 Docker,而是在物理机上运行?
selenium-grid ×10
selenium ×4
docker ×2
webdriver ×2
automation ×1
docker-swarm ×1
firefox ×1
java ×1
jenkins ×1
linux ×1
mobaxterm ×1
testing ×1