selenium - webdriver C# - dropdown selectByVisibleText -


trying select word inside dropdown menu.

in webdriver ide appear click dropdown (which id "p" , click word "barcelona" inside dropdown.:

enter image description here

i can open dropdown menu using:

            driver.findelement(by.id("p")).click(); 

now i'm trying select word inside dropdown menu, using "selectelement" , "select visibletext" not work in c# webdriver me.

            selectelement selector = new selectelement.selectbyvisibletext("barcelona"); 

any helps please?

using c# webdriver , not java.

i think problem in selectelement initialization. can try following code:

selectelement selectelement = new selectelement(driver.findelement(by.id("p"))); selectelement.selectbytext("germany"); 

if new in c# webdriver api, can find following article useful: http://automatetheplanet.com/getting-started-webdriver-c-10-minutes/


Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -