如何使用 selenium ide 专注于新窗口?
我正在尝试使用 selenium ide 来复制操作。该操作是单击打开新窗口的链接。如何使 selenium ide 聚焦在新窗口而不是另一个窗口上?它对我不起作用。
I am trying to use selenium ide to duplicate an action. The action is clicking on a link that open a new window. How do you make selenium ide focus on the new window instead of the other one? It has not been working for me.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
选择窗口
为此,您需要使用
selectWindow | windowName
命令。要从其他窗口返回主窗口,请执行
selectWindow |空
selectWindow(windowID)
selectPopup
如果它是弹出窗口,则执行
selectPopUp | windowId
然后返回主窗口执行selectWindow | null
selectPopUp(windowID)
参数:简化选择弹出窗口的过程(并且不提供功能)超出 selectWindow() 已经提供的功能)。
Select Window
For this you will need to use the
selectWindow | windowName
command.To go back to the main window from the other window then do
selectWindow | null
selectWindow(windowID)
selectPopup
If it is a popup then do
selectPopUp | windowId
and then to go back to the main window doselectWindow | null
selectPopUp(windowID)
Arguments:Simplifies the process of selecting a popup window (and does not offer functionality beyond what selectWindow() already provides).
使用 Selenium Web Driver 2 尝试一下:
Try this using Selenium Web Driver 2:
您可以使用“storeAttribute”命令存储随机窗口 ID(由 Selenium IDE 生成)。您只需将 ID 存储在变量中,然后就可以使用“selectWindow”命令选择窗口。
尝试使用这个:
You can store the random window ID (generated by Selenium IDE) using ‘storeAttribute’ command. You just need to store the ID in a variable and then you can select the window using ‘selectWindow’ command.
Try using this:
考虑一下:您是否愿意仅删除
target="_blank"
属性?对我来说,这是一个解决方案:在 Selenium IDE 中保持在同一窗口内有一些优势,因为它不支持目标空白。
Consider this: would you prefer to just remove the
target="_blank"
attribute? For me this has been a solution:Staying within the same window has some advantages in Selenium IDE, seeing it doesn't support target blank.