更新时间:2023-10-26 18:37:34
Selenium-webdriver没有附加到现有浏览器的功能。已请求此功能,但已关闭为不可行(请参阅第18期)。
Selenium-webdriver does not have functionality for attaching to existing browsers. This feature was requested, but closed as not feasible (see Issue 18).
如果您只使用IE,您可以考虑使用Watir-Classic,它具有附加到现有浏览器的功能:
If you are only using IE, you could consider using Watir-Classic, which has functionality for attaching to existing browsers:
browser = Watir::Browser.attach(:title, "Browser Title")
browser.text_field( :id => 'Field Id').set 'abc'
这个API的主要部分与Watir-和Watir-Classic。有一些小的差异取决于你在做什么。注意,如果你的代码是 require'watir'
,你可能已经使用Watir-Classic。
The main part of the API is the same between Watir-Webdriver and Watir-Classic. There are some small differences depending on what you are doing. Note that if your code is doing require 'watir'
, you might already be using Watir-Classic.