Joe*_*Joe 12 selenium selenium-ide selenium-chromedriver selenium-webdriver
到现在为止我只是喜欢:
val radioButton4: WebElement = driver.findElement(By.id("FieldsubCode2"))
radioButton4.click
Run Code Online (Sandbox Code Playgroud)
但现在我想按值找到元素,这个值:
所以我想去:
val radioButton4: WebElement = driver.findElement(By.value("3.2"))
radioButton4.click
Run Code Online (Sandbox Code Playgroud)
我怎样才能做到这一点?
Bha*_*Vre 12
如果您只想按价值找到然后使用,
driver.findElement(By.xpath("//input[@value='3.2']"));
Run Code Online (Sandbox Code Playgroud)
driver.findElement(By.xpath("//input[@name='buttonName' and @value='3.2']"));
Run Code Online (Sandbox Code Playgroud)
小智 5
driver.FindElement(By.cssSelector(input[type='radio'][value='3.2']));
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
25104 次 |
| 最近记录: |