java如何获取所选drowdown的文本值
我想从下拉列表中选择文本并打印它
Select m = new Select(ActivityPage.Frommonth);
m.selectByIndex(2);// it will select month februaray
Thread.sleep(2000);
String frommonth = m.getFirstSelectedOption().getText();// i want to print the februaray
- 预期产出:2月份
- 实际产量:月
# 1 楼答案
您可以使用以下代码: