开发者

WatiN pressTab doesn't press tab

开发者 https://www.devze.com 2022-12-08 05:40 出处:网络
Has anyone found a means to press tab with watiN in Intern开发者_如何学JAVAet explorer?Do you mean you want to press the tab key itself, or just click on an HTML element that looks like a tab? For the

Has anyone found a means to press tab with watiN in Intern开发者_如何学JAVAet explorer?


Do you mean you want to press the tab key itself, or just click on an HTML element that looks like a tab? For the latter use the Click method against the appropriate element (Div, Span etc). Otherwise you could try SendKeys instead of PressTab. e.g.:

IE ie = new IE("http://www.google.com");
ie.AutoClose = false;
ie.TextField(Find.ByName("q")).Click();
SendKeys.SendWait("{TAB}");

The above example will set the focus the text field then tab off, putting focus on the search button.


we had the same problem, we resolve it focusin on the browser and using SendMessage (Win) to the specific hwnd.

0

精彩评论

暂无评论...
验证码 换一张
取 消