Browser4 icon indicating copy to clipboard operation
Browser4 copied to clipboard

WebDriver.outerHTML() is incorrect

Open platonai opened this issue 7 months ago • 0 comments

The following implementation is incorrect:

override suspend fun outerHTML(): String? {
  return invokeOnPage("outerHTML") { domAPI?.outerHTML }
}

Reproduce:

driver.setContent("<html><body vi='$vi'>Hello, World!</body></html>")
driver.delay(1000)
var html = driver.outerHTML() // null, bug

html = driver.outerHTML(":root") // ok
html = driver.pageSource() // ok

val remoteObject: RemoteObject = dom.resolveNode(documentNodeId, null, null, null)
val objectId: String = remoteObject.objectId
dom.getOuterHTML(dom.document.nodeId, null, objectId) // ok

platonai avatar May 22 '25 13:05 platonai