Find CURRENTLY selected

后端 未结 4 1122
醉话见心
醉话见心 2021-01-04 06:42

What\'s the correct XPath syntax to check if an option element is currently selected, or just to get the selected option

4条回答
  •  一整个雨季
    2021-01-04 07:20

    I would try //option[@selected='true']

    i.e. driver.findElements(By.xpath("//option[@selected='true']")).getText();

提交回复
热议问题