dimanche 29 juillet 2018

How do I find and select a dropdown value with selenium using C# in visual studio 2017

I am trying to locate an element within a dropdown list with selenium. How can I do this. Attached are images which describes the situation. I want to do this using the IWebElement function.

Ive tried using the following-

IWebElement Depart = driver.FindElement(By.XPath("///input[@name='fromPort' and @value='Sydney']"));

but it does not work!! How can I select Sydney from the drop-down list?

enter image description here

Aucun commentaire:

Enregistrer un commentaire