开发者

Drop down box selenium

开发者 https://www.devze.com 2023-01-29 21:08 出处:网络
I have a drop down box with the id = PoolsSelect. I am trying to select the value within that drop down box but I\'m getting an error, here is my code:

I have a drop down box with the 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.


You say the id of the select is PoolsSelect but yet you're using a By.name selector. Have you tried selecting by id?

0

精彩评论

暂无评论...
验证码 换一张
取 消