Selenium IDE for Firefox Ctrl-Tab [英] Selenium IDE for Firefox Ctrl-Tab

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

问题描述

我试图从一个列表中自动化多个表单中的一些设置,然后打开它们自己的选项卡。
在运行脚本之前,我可以准备好页面的最简单方法是将它们全部打开。
我打算让硒通过表单的变化,然后我要它到 Ctrl + Tab 到下一个。我将使用一个循环,同时设置计数。
我现在有记录在HTML中,如果我需要调整到Java或我很乐意这样做。



我试图记录它,但没有去。

解决方案

到目前为止,Selenium并没有支持标签。 Selenium开发人员最近的回答很清楚地解释了这个问题


Selenium目前无法切换标签页。由于这
我们强制浏览器打开新窗口中的链接,但由于我们是
能够切换窗口,我们强迫浏览器采取的方法。这
可能会在以后的版本中被修复。


另外,如果您离开IDE(或者将您的测试用例导出到WebDriver)并获得一个更强大的工具(任何Selenium的全功能编程语言绑定),您可以使用某种解决方法:

https://stackoverflow.com/a/12730918/1273080 (点击 Ctrl + < kbd> 2 到第二个选项卡等)。但是,这种解决方法通常限于某个浏览器/操作系统/浏览器设置(可以禁用标签)。
$也就是说,如果你不坚持使用标签,而是使用多个浏览器窗口,IDE和Selenium RC以及WebDriver相当简单:


Selenium IDE: selectWindow (你可以产生一个新的胜利通过 openWindow



Selenium RC: selectWindow()

Selenium WebDriver: switchTo()。window()


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.

解决方案

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 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.

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 (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).


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 (you can spawn a new window by openWindow)

Selenium RC: selectWindow()

Selenium WebDriver: switchTo().window()

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

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