Cannot locate dropdown by ID

40 views
Skip to first unread message

MD. Masud Parvez

unread,
May 27, 2015, 5:40:47 AM5/27/15
to co...@googlegroups.com
Hi,

I'm new to Coypu. I'm trying to select "Book" option from the selection item with id="searchDropdownBox" in http://www.amazon.com/ website. The selection box is located at the top left corner of the page. I tried the following:

browserSession.Select("Books").From("searchDropdownBox");

but it could not locate the element and I received an error.

Later I tried the following

var selenium = ((OpenQA.Selenium.Remote.RemoteWebDriver)browserSession.Native);
SelectElement sel=new SelectElement(selenium.FindElement(By.Id("searchDropdownBox")));
sel.SelectByText("Books");

And it worked. My question is, why browserSession.Select("Books").From("searchDropdownBox") didn't work.

Thanks
Masud
Reply all
Reply to author
Forward
0 new messages