[英]How to select even elements by class name with JavaScript?
[英]How to write xpath for Select name class for the below scenario in Javascript?
尝试使用这个:
WebElement dropDownList = driver.findElement(By.cssSelector(".co-dropdown__select.co-payment-card__select"));
Select card= new Select(dropDownList);
card.selectByIndex(2);
试试下面的 css 选择器
Select select= new Select(driver.findElement(By.cssSelector("select.co-dropdown_select.co-payment-card__select")));
select.selectByIndex(index);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.