选择弹出窗口的textarea

时间:2018-03-06 17:48:43

标签: r selenium xpath rselenium

我正在尝试选择弹出窗口的文本框:

Popup text box

webElem <- remDr$findElement("id", "reporterRemarks")
webElem <- remDr$findElement("name", "reporterRemarks")
webElem <- remDr$findElement("xpath", "//*[@id='reporterRemarks']")

我试过了:

Error:   Summary: NoSuchElement
     Detail: An element could not be located on the page using the given search parameters.
     class: org.openqa.selenium.NoSuchElementException
     Further Details: run errorDetails method

一切都没有成功。

{{1}}

1 个答案:

答案 0 :(得分:0)

弹出窗口在iframe中,因此我需要切换帧以查找弹出窗口中的元素。

webElems <- remDr$findElements("css", "iframe")
remDr$switchToFrame(webElems[[1]]
webElem <- remDr$findElement("name",'reporterRemarks')