Selenium 无法在 Linux 上打开虚拟浏览器窗口

发布于 2024-09-08 20:47:04 字数 1122 浏览 1 评论 0原文

我正在 Maven 项目中使用 Selenium 通过 JUnit 进行用户界面测试。该项目位于运行 IEs4Linux 和 Wine 的 Linux 机器上,允许我们在 IE 中运行测试。

现在我正在使用Xming和Putty来查看虚拟浏览器窗口,我可以使用命令“ie6”打开IE窗口,并且我可以看到它在Xming中正常运行。

当使用 *iexplore 浏览器模式设置 Selenium RC 时,我在 RC 服务器窗口中看到以下内容:

INFO - Command request: getNewBrowserSession[*iexplore, http://asdfasdfasdf.com:7011/, ] on session null
INFO - creating new remote session
INFO - Allocated session asdfasdfasdfasdfasdfasdfadsf for http://asdfasdfasdf.com:7011/, launching...
INFO - Launching Embedded Internet Explorer...
INFO - Launching Internet Explorer HTA...

这是正常的,除了浏览器永远不会打开并且测试永远不会运行。使用 *iexploreproxy 或 *piiexplore,我从 RC 收到以下错误:

13:46:06.957 INFO - Got result: Failed to start new browser session: org.openqa.selenium.server.browserlaunchers.WindowsUtils$WindowsRegistryException: Problem while managing the registry, OS Version '2.6.18-164.11.1.el5', regVersion1 = null on session null

是否有任何原因 Selenium 无法使用 *iexplore 启动 IE 窗口?我会使用 *firefox 或 *chrome,但我正在测试的应用程序仅与 IE 兼容。另请注意,这些测试用例在我的本地 Windows 计算机上运行得非常好。

如果您需要更多详细信息,请告诉我。

I am using Selenium to conduct user interface tests with JUnit, in a Maven project. The project is located on a Linux box running IEs4Linux and Wine to allow us to run the tests in IE.

Right now I'm using Xming along with Putty to view the virtual browser windows, and I am able to open an IE window with the command "ie6", and I can see it functioning correctly in Xming.

When setting up the Selenium RC using the *iexplore browser mode, I get the following in the RC server window:

INFO - Command request: getNewBrowserSession[*iexplore, http://asdfasdfasdf.com:7011/, ] on session null
INFO - creating new remote session
INFO - Allocated session asdfasdfasdfasdfasdfasdfadsf for http://asdfasdfasdf.com:7011/, launching...
INFO - Launching Embedded Internet Explorer...
INFO - Launching Internet Explorer HTA...

Which is normal, except the browser never opens and the tests never run. Using *iexploreproxy or *piiexplore, I get the following error from the RC:

13:46:06.957 INFO - Got result: Failed to start new browser session: org.openqa.selenium.server.browserlaunchers.WindowsUtils$WindowsRegistryException: Problem while managing the registry, OS Version '2.6.18-164.11.1.el5', regVersion1 = null on session null

Is there any reason Selenium would fail to launch the IE window using *iexplore? I would use *firefox or *chrome but the application I am testing is only compatible with IE. Also note that these test cases run perfectly fine on my local Windows machine.

Please let me know if you need more details.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

没企图 2024-09-15 20:47:04

让它工作...以防其他人尝试使用与我的类似的配置...无论出于何种原因,当使用 IEs4Linux 打开 IE6 时,您似乎无法使用 Http.proxyName 和 Http.proxyPort 设置启动服务器。 .它只会忽略它们。您必须手动打开 IE6 浏览器并自行输入代理设置(很可能是 localhost 和 4444)。

我想我会开始研究适用于 Linux 的 IE7...显然 IE6 不喜欢 Selenium 对 XPath 的使用。

Got it working...in case anybody else attempts to use a similar configuration to mine...for whatever reason it seems you cannot start up the server with the Http.proxyName and Http.proxyPort settings when using IEs4Linux to open IE6...it will just ignore them. You have to manually open the IE6 browser and enter the proxy settings yourself (most likely localhost and 4444).

I think I'll start looking into IE7 for Linux...apparently IE6 doesn't like Selenium's use of XPaths.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文