问题标签 [remotewebdriver]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
1674 浏览

java - 使用 selenium-webdriver 运行测试时访问远程机器剪贴板上的数据

我有如下设置:

为了执行测试,我使用 RemoteWebDriver 并在集线器上配置了 Jenkins CI。

问题:我正在测试的 URL 有一个按钮,单击该按钮可将数据复制到剪贴板。除非粘贴,否则数据对最终用户不可见。我担心的是在本地运行时,我可以使用以下方法获取系统剪贴板数据:

但是当从远程机器上的詹金斯触发代码时,我无法获取内容并收到以下错误:

很明显它正在尝试在 jenkins 服务器上获取数据,但存在一定的显示问题。但我的要求是在单击按钮后获取存储在远程机器上的数据。

有什么解决办法吗?

谢谢。

0 投票
1 回答
675 浏览

selenium - remotewebdriver - 如何从节点获取日志

我正在使用 selenium 网格和远程 Web 驱动程序(使用 testNG)运行测试。节点在 VMWare 上运行。

如何在运行期间获取节点上出现的日志?我为每个班级创建了新的驱动程序,因此我希望为每个班级保存日志。

怎么做?

我还想在视频中记录在 vmware 中的运行。不开屏时是否可以录制vmware?

谢谢

0 投票
2 回答
4611 浏览

selenium-webdriver - Selenium Grid running tests in parallel

Currently, I have a Selenium grid setup, with 1 local hub and 2 local nodes. The hub is capable of distributing the tests to run in parallel and distribute it over to the nodes. I am running the tests in parallel.

The following is the base test

The following is the class to get the RemoteWebDriver:

My test suite is like :

Tests are like :

While running these tests, I get the following errors

Build info: version: '2.44.0', revision: '76d78cf323ce037c5f92db6c1bba601c2ac43ad8', time: '2014-10-23 13:11:40' Driver info: driver.version: RemoteWebDriver org.openqa.selenium.remote.SessionNotFoundException: Session ID is null. Using WebDriver after calling quit()? Build info: version: '2.44.0', revision: '76d78cf323ce037c5f92db6c1bba601c2ac43ad8', time: '2014-10-23 13:11:40' Driver info: driver.version: RemoteWebDriver at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:158) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:572) at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:352) at org.openqa.selenium.remote.RemoteWebDriver.findElementById(RemoteWebDriver.java:393) at org.openqa.selenium.By$ById.findElement(By.java:214) at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:344) at org.openqa.selenium.support.pagefactory.DefaultElementLocator.findElement(DefaultElementLocator.java:59) at com.sun.proxy.$Proxy25.sendKeys(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80) at org.testng.internal.Invoker.invokeMethod(Invoker.java:673) at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:842) at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1166) at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125) at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) TEST FAILED: test2 FAILED REASON: Session ID is null. Using WebDriver after calling quit()?

Is it something anyone aware of?

Thanks in advance!

0 投票
1 回答
1016 浏览

selenium - 为并行 Selenium 测试设置单独的配置文件

我正在研究如何使用 RemoteWebDriver 设置个人配置文件。我一直在以下线程上阅读它。

我试图解决它如下:

}

我收到以下错误:

更新:我在下面的 BaseTest 类中注入方法名称

0 投票
2 回答
242 浏览

selenium-webdriver - 远程机器上的 FirefoxWebdriver

是否需要在充当节点或集线器的远程计算机上安装 Firefox Web 驱动程序?我在本地测试了集线器和节点?我认为,有必要在集线器和节点上安装 Web 驱动程序。有什么意见或建议吗?

更新:

Selenium jar 正在运行(即安装了 Java,并且根据文档,Web 驱动程序也存在于 selenium jar 中)。为什么我会收到此错误

还,

提前致谢!

0 投票
1 回答
473 浏览

java - 创建 RemoteWebDriver 时如何声明两个节点?

在这里,我创建了一个集线器和一个节点,我想创建另一个节点。

如何RemoteWebdriver用多个节点初始化我的。

0 投票
1 回答
7320 浏览

selenium - Error forwarding the new session: Selenium Grid 2

I have taken latest Selenium Server which is 2.45.0 from here. Followed the documentation and started the hub with the following command

#xA;

And, the JSon file content is:

#xA;

And, the only Node with

#xA;

Up to this everything looks great. See the screenshots of the console after registering here

And, the problem start when I am trying to kick-off the test with:

#xA;

And, it throws:

An exception of type 'System.InvalidOperationException' occurred in WebDriver.dll but was not handled in user code

Additional information: Error forwarding the new session cannot find : Capabilities [{browserName=internet explorer, version=8.0, platform=XP}]

See the screenshots screenshot 1 screenshot 2 screenshot 3

I must say the documentation on Selenium Grid is very frustrating. I have spent whole day trying to figure out what's going wrong.

Am I missing something?

0 投票
1 回答
342 浏览

selenium - 尝试 driver.findElement(By

我的代码看起来像这样(在 java 中),在 chrome 上运行:

我宣布了 RED_ALERTS_BTN:

我也尝试过简单地使用 id :

似乎尝试了一切(即使使用xpath),我仍然得到'没有这样的元素';

实际的 HTML:

任何人都可以帮助或给我一个想法?似乎所有其他测试用例都使用类似的技术运行得很好;
非常感谢您的任何建议!金银花

0 投票
2 回答
1086 浏览

java - why cannot my client call selenium server on non-default port (running on mac)?

I saw this post about how to run selenium web drive server on 2 different ports.

I have tried to do this:

and run code that calls the server on port 4445

but I get this exception:

btw, can the server handle requests from several clients at the same hour to one port? or do i need a different port for each client?

0 投票
1 回答
2937 浏览

selenium - 通过 selenium 远程 webdriver 运行两个 ie/firefox 浏览器实例

我的场景是,我将启动一个浏览器实例并执行一些操作,然后在不关闭当前浏览器的情况下打开相同类型的新浏览器并需要进行验证。

问题仅出在 firefox 和 IE 上,因为在第一个实例超时之前不会启动第二个浏览器实例,但同样适用于 chrome 浏览器。在启动节点和集线器时,对于 firefox 和 IE,它会显示“警告 - 未指定最大实例。使用默认值 = 1”,即使在相应节点中指定了最大实例之后也是如此。用于启动集线器和节点的命令如下所示

浏览器版本

:40.0.2214.115;火狐:34.0;即: 10.0.9200.17228