Aar*_*lla 5 junit selenium-webdriver
我可以使用文本键入文本,WebElement.sendKeys()但编辑不起作用:我既不能移动光标也不能删除我输入的最后一个字符e.sendKeys( Keys.BACK_SPACE )
如何在Selenium 2(WebDriver)中修改文本字段的值?
你可以通过两种方法中的任何一种来做到这一点.我试过了,它的确有效.
e.click() # Positions the cursor at the end of the string
e.sendKeys(Keys.BACK_SPACE )
Run Code Online (Sandbox Code Playgroud)
或者您可以简单地清除文本,然后重新开始:
e.clear()
e.sendKeys("What you want to send")
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
11485 次 |
| 最近记录: |