[英]Drop down box selenium
I have a drop down box with the id = PoolsSelect. 我有一个ID为PoolsSelect的下拉框。 I am trying to select the value within that drop down box but I'm getting an error, here is my code:
我试图在该下拉框中选择值,但出现错误,这是我的代码:
RenderedWebElement element = (RenderedWebElement) driver.findElement(By.id("PoolsSelect"));
RenderedWebElement target = (RenderedWebElement) driver.findElement(By.name("Austria"));
element.dragAndDropOn(target);
and the error I get is 我得到的错误是
Error: Unable to find element by name using "PoolsSelect" (7)
I am using selenium 2.07a with JUnit 4.8.2. 我在JUnit 4.8.2中使用硒2.07a。
You say the id of the select is PoolsSelect
but yet you're using a By.name selector. 您说选择的ID是
PoolsSelect
但是您使用的是By.name选择器。 Have you tried selecting by id? 您是否尝试过按ID选择?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.