- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
Selenium 2 getWindowHandle说:
Schedules a command to retrieve they current window handle.
但是当我尝试使用由此返回的句柄执行某些操作时,它会向我抛出“NoSuchWindowError”。这怎么可能?如果是当前窗口,则不应关闭它。如果关闭则当前窗口是另一个窗口。正确的?
使用:
更新2:
看起来像 bug 。关闭的窗口是 Facebook 登录窗口。
以下是重现方法:
按要求:
我想获取窗口标题或类似内容,这并不重要,我只需要句柄 ID。
这是完整的错误堆栈,但没什么用:
[8.572][SEVERE]: Unable to receive message from renderer
FF
(::) failed steps (::)
NoSuchWindowError: no such window: target window already closed
at Object.Future.wait (c:\app\node_modules\fibers\future.js:398:15)
at [object Object]._.extend.update (c:\app\tests\shared\Browser.js:183:62)
at [object Object].<anonymous> (c:\app\tests\shared\Browser.js:138:18)
at c:\app\node_modules\fibers\future.js:416:21
- - - - -
from unknown error: web view not found
(Session info: chrome=40.0.2214.111)
(Driver info: chromedriver=2.9.248315,platform=Windows NT 6.1 SP1 x86)
at new bot.Error (c:\app\node_modules\selenium-webdriver\lib\atoms\error.js:113:18)
at Object.bot.response.checkResponse (c:\app\node_modules\selenium-webdriver\lib\atoms\response.js:106:9)
at c:\app\node_modules\selenium-webdriver\lib\webdriver\webdriver.js:362:20
at c:\app\node_modules\selenium-webdriver\lib\goog\base.js:1582:15
at [object Object].webdriver.promise.ControlFlow.runInNewFrame_ (c:\app\node_modules\selenium-webdriver\lib\webdriver\promise.js:1654:20)
at notify (c:\app\node_modules\selenium-webdriver\lib\webdriver\promise.js:465:12)
at notifyAll (c:\app\node_modules\selenium-webdriver\lib\webdriver\promise.js:442:7)
at resolve (c:\app\node_modules\selenium-webdriver\lib\webdriver\promise.js:420:7)
at [object Object].fulfill (c:\app\node_modules\selenium-webdriver\lib\webdriver\promise.js:535:5)
at c:\app\node_modules\selenium-webdriver\lib\webdriver\promise.js:1520:10
at c:\app\node_modules\selenium-webdriver\lib\goog\base.js:1582:15
at [object Object].webdriver.promise.ControlFlow.runInNewFrame_ (c:\app\node_modules\selenium-webdriver\lib\webdriver\promise.js:1654:20)
at notify (c:\app\node_modules\selenium-webdriver\lib\webdriver\promise.js:465:12)
at notifyAll (c:\app\node_modules\selenium-webdriver\lib\webdriver\promise.js:442:7)
at resolve (c:\app\node_modules\selenium-webdriver\lib\webdriver\promise.js:420:7)
at fulfill (c:\app\node_modules\selenium-webdriver\lib\webdriver\promise.js:535:5)
at c:\app\node_modules\selenium-webdriver\lib\goog\base.js:1582:15
at [object Object].webdriver.promise.ControlFlow.runInNewFrame_ (c:\app\node_modules\selenium-webdriver\lib\webdriver\promise.js:1654:20)
at notify (c:\app\node_modules\selenium-webdriver\lib\webdriver\promise.js:465:12)
at notifyAll (c:\app\node_modules\selenium-webdriver\lib\webdriver\promise.js:442:7)
at resolve (c:\app\node_modules\selenium-webdriver\lib\webdriver\promise.js:420:7)
at [object Object].fulfill (c:\app\node_modules\selenium-webdriver\lib\webdriver\promise.js:535:5)
at c:\app\node_modules\selenium-webdriver\lib\webdriver\promise.js:721:49
at c:\app\node_modules\selenium-webdriver\lib\webdriver\http\http.js:96:5
at IncomingMessage.<anonymous> (c:\app\node_modules\selenium-webdriver\http\index.js:131:7)
at IncomingMessage.emit (events.js:117:20)
at _stream_readable.js:943:16
at process._tickDomainCallback (node.js:463:13)
==== async task ====
WebDriver.getWindowHandle()
at [object Object].webdriver.WebDriver.schedule (c:\app\node_modules\selenium-webdriver\lib\webdriver\webdriver.js:345:15)
at [object Object].webdriver.WebDriver.getWindowHandle (c:\app\node_modules\selenium-webdriver\lib\webdriver\webdriver.js:672:15)
at [object Object].<anonymous> (c:\app\tests\shared\Browser.js:23:12)
at [object Object].fn [as f_getWindowHandle] (c:\app\node_modules\fibers\future.js:89:26)
at [object Object]._.extend.update (c:\app\tests\shared\Browser.js:183:42)
at [object Object].<anonymous> (c:\app\tests\shared\Browser.js:138:18)
at c:\app\node_modules\fibers\future.js:416:21
最佳答案
尝试
var webdriver = require('selenium-webdriver');
var driver = new webdriver.Builder().forBrowser('chrome').build();
然后你会看到 chrome 已打开,不要关闭它。然后尝试
driver.get('http://www.google.com')
关于node.js - 当它应该返回当前窗口句柄时,为什么我会收到 "NoSuchWindowError"错误和 "getWindowHandle"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28633040/
我设置了 Helm 柄和 Helm 柄。我有tiller-deploy。昨天,我可以定期运行了。但今天我收到此错误消息 Error: could not find a ready tiller pod
我以前已将分er安装到特定的 namespace 中。 我设置了一个环境变量来设置'tiller'命名空间-但我不记得该环境变量的名称-而且似乎无法通过网络搜索找到它。 这是什么 key ? 最佳答案
当我在 View 模型中使用如下界面时 class MainViewModel @ViewModelInject constructor( private val trafficImagesR
我正在尝试找到如何在某个 fragment 相关场景中定义 Hilt 的解决方案。我有以下设置: Activity 父 fragment 1 子 fragment 1 子 fragment 2 ...
Hilt 指出如果没有@Provides 注解就不能提供这个接口(interface): interface PlannedListRepository { fun getAllLists()
我的问题非常简单明了:两个注释/示例之间有什么区别: 例子一 @Singleton class MySingletonClass() {} @Module @InstallIn(FragmentCom
我是一名优秀的程序员,十分优秀!