如何控制 selenium 远程服务器调用的浏览器将在我的哪个桌面上弹出?

发布于 2024-09-10 00:15:39 字数 279 浏览 2 评论 0原文

我正在使用 selenium 从 phpunit 运行测试。由于测试需要几分钟的时间,我想切换到另一个桌面并在测试在后台运行时执行一些任务。

但是,由于每个测试都通过 selenium 远程服务器调用新的浏览器,并且启动了新的测试管理窗口和应用程序窗口,因此这些新窗口不会出现在我启动 php 测试的桌面中,而是出现在我当前的桌面中焦点远离我正在工作的窗口。

如何控制浏览器始终在后台桌面(我启动 phpunit 的地方)中打开?我正在使用 Kubuntu,即 KDE 桌面。

感谢您的任何建议!

I am running tests from phpunit using selenium. Since the tests take a couple of minutes proceed, I would like to switch to another desktop and do some tasks while the tests are running in the background.

However, since every test calls a new browser via selenium remote server, and a new test management window and a application window are started, these new windows do not appear in the desktop which I started the php tests from, but in my current desktop taking the focus away from the window I am working in.

How can I control that the browsers are always opens in the desktop that is in the background (where I start phpunit)? I am using Kubuntu i.e. the KDE Desktop.

Thanks for any suggestions!

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

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

发布评论

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

评论(1

不…忘初心 2024-09-17 00:15:39

这可能有点晚了,但对于阅读本文的任何人来说:当您启动 selenium RC 服务器时,您可以尝试使用以下命令导出到特定显示器:

export DISPLAY="somedisplay" && java -jar /path/to/selenium-server.jar

使用此命令,您还可以将其导出到例如 X 虚拟帧缓冲区( Xvfb),有效地在后台运行它。

This is probably a bit late, but for anyone reading this: When you launch your selenium RC server, you could try exporting to a specific display using the command:

export DISPLAY="somedisplay" && java -jar /path/to/selenium-server.jar

Using this, you could also export it to for instance an X virtual frame buffer (Xvfb), effectively running it in the background.

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