switchToFrame

abstract fun switchToFrame(scope: CoroutineScope, xpath: String): Deferred<Unit>

异步切换到指定的iframe中。要切换到嵌套的iframe,请多次调用此方法。

Return

一个 Deferred<Unit>。如果iframe未找到,Deferred将失败并抛出异常。

Parameters

scope

用于执行此操作的协程作用域。

xpath

iframe元素的XPath,相对于当前上下文。