我们需要检查出现在页面上并由用户选择的Text和返回给应用程序的Value。示例: <select title="Do you have the right to work in Australia?> 这些值被发送到其他系统,因此它们必须是准确的。我遇到麻烦的是在SelectElement对象上返回给应用程序的“值”。option.Text是可用的,但是在调试器和其他地方我找不到.Value。谢谢你的帮助。
我得到了错误org.openqa.selenium.support.ui.UnexpectedTagNameException Element should have been "select" but我试过这样的代码:
WebElement element = driver.findElement(By.xpath("//span[@id='month']//span[@class='next-select-inner']&quo