用于 Firefox 的 Selenium IDE Ctrl-Tab [英] Selenium IDE for Firefox Ctrl-Tab

查看:21
本文介绍了用于 Firefox 的 Selenium IDE Ctrl-Tab的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从我打开到他们自己的选项卡中的列表中以多种形式自动化一些设置.在运行脚本之前准备页面的最简单方法是让它们全部打开.我打算让 selenium 运行对表单的更改,然后我希望它 Ctrl+Tab 到下一个.我将使用循环来设置计数.我目前有它以 HTML 格式录制,如果我需要将其调整为 java,或者我很乐意这样做.

I'm attempting to automate some settings in multiple forms from a list that I open into their own tabs. The easiest way that I can prep the pages prior to running the script is to have them all open . I intend to have selenium run through the changes to the form, then I want it to Ctrl+Tab to the next one. I will use a loop while to set the count. I currently have it recording in HTML, if I need to adjust it over to java or I will gladly do so.

我已经尝试过录制,但没有成功.

I've attempted to record it, but no go.

推荐答案

目前 Selenium 中不支持选项卡.一位 Selenium 开发人员最近的回答解释得很清楚:

There's no support for tabs in Selenium as of now. A fairly recent answer by one of the Selenium developers explains it pretty clearly:

Selenium 目前无法切换标签.因为这我们强制浏览器在新窗口中打开链接,但因为我们是能够切换窗口我们强制浏览器采取的办法.这可能会在以后的版本中修复.

Selenium has no ability to switch tabs at the moment. Because of this we force the browser to open links in new windows but since we are able to switch windows we force the browser to take the approach. This may be fixed in a later version.

此外,如果您摆脱 IDE(或将测试用例导出到 WebDriver)并使用更强大的工具(任何针对 Selenium 的全强度编程语言绑定),您可能会使用某种解决方法:

Also, if you get away from IDE (or export your testcase to WebDriver) and get to a more powerful tool (any full-strength programming language binding for Selenium), you might use some kind of workaround:

https://stackoverflow.com/a/12730918/1273080(点击Ctrl+2 进入第二个选项卡等)但是,这种解决方法通常仅限于特定的浏览器/操作系统/浏览器设置(可以禁用选项卡).

https://stackoverflow.com/a/12730918/1273080 (Taps Ctrl+2 to get to the second tab etc.) However, this kind of workarounds is usually limited to a certain browser/OS/browser setting (tabs can be disabled).

也就是说,如果您不坚持使用选项卡而是使用多个浏览器窗口,那么这在 IDE 以及 Selenium RC 和 WebDriver 中相当容易:

That said, if you don't insist on using tabs and would use several browser windows instead, that's fairly easy in IDE as well as Selenium RC and WebDriver:

Selenium IDE:selectWindow(您可以通过 openWindow 生成一个新窗口)

Selenium IDE: selectWindow (you can spawn a new window by openWindow)

Selenium RC:selectWindow()

Selenium RC: selectWindow()

Selenium WebDriver:switchTo().window()

Selenium WebDriver: switchTo().window()

这篇关于用于 Firefox 的 Selenium IDE Ctrl-Tab的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆