handle autocomplete with watin
Im working with a textfield where when i write in it, then appear an autocomplete list 开发者_高级运维where i can choose an element.
The problem is that i cant select any one from these autocomplete list with watin, and because this, i can continue with the test.
How can i handle that? Im trying with this:
browser.TextField(Find.ByName("ctl00$cpContent$txtCustomerPA")).TypeText("ca");
string cliente = "115001-CAJA ESPAÑA SSCC EL PORTILLO";
Element list = browser.Element(Find.ByText(cliente));
list.MouseDown();
With that i can select the element of the list, but i cant choose it for the textfield... Help pls! How can i do it?
try to set value of the element not type it.
try something similar to this "check the syntax":
browser.TextField(Find.ByName("BLAHBLAHBLAHB")).SetAttributeValue("value","ca");
Instead of Value because its a list check the html and see what the call the option it could be called "Country" or state???
browser.TextField(Find.ByName("BLAHBLAHBLAHB")).SetAttributeValue("state","ca");
;)
Hope this helps mate, Good Luck
-Scott
Try using list.Click();
instead of mousedown.
精彩评论