Hi there,
Im working a web browser automation project. There is an ajax controlled dropdown list in a web site.
It was like this;
<option value="test1">test1</option><option value="test2">test2</option><option value="test3">test3</option><option value="test4">test4</option><option value="test5">test5</option>
When i was selected test2 ajax is working and its giving another div. (I need this div)
I use this codes;
<p>webbrowser1.Document.GetElementsByTagName("select")[0].Document.GetElementsByTagName("option")[1].SetAttribute("selected", "selected");</p> <p></p> <p>How can i select option 1?</p> <p>Thanks.</p>
I just tried this, and your code above is
GetElementsByTagName("option")[1]
which is the second option, it is a 0 based collection change to [0] and you will select the 1st option.
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)