我在编码时收到此错误
The method selectByVisibleText(String) is undefined for the type WebElement
并且我也试图导入这个 - >
import org.openqa.selenium.support.ui.Select;
但它失败了。代码如下,
new Select(driver.findElement(By.id("Service")).selectByVisibleText("Broadband"));
driver.findElement(By.cssSelector("input.AddBtnServiceAssignment")).click();
HTML代码:
<!--Wizard 1--> <tr> <td>select</td> <td>id=Service</td> <td>label=Broadband</td> </tr> <tr> <td>click</td> <td>css=input.AddBtnServiceAssignment</td> <td></td> </tr> <tr>