Element.Select(TakeFocus) not working
Posted: Fri May 11, 2007 5:45 pm
I have a login dialog with edit boxes for a username and password. The element information from RanorexSpy is
Role:Client, Name:"User name:"
Role:Client, Name:"Password:"
My code is as follows:
But when the ranorex app runs, it enters both "bob" and "secret" into the username edit box. Nothing is entered into the password edit box.
I've printed the element location and size for user and pass and the values are correct.
How do I force an element to take the focus?
Thanks
Role:Client, Name:"User name:"
Role:Client, Name:"Password:"
My code is as follows:
Code: Select all
Element win = ... the login dialog ...
Element user = win.FindChild(Role.Client, "User name:");
Element pass = win.FindChild(Role.Client, "Password":);
user.Select(Selection.TakeFocus);
Application.SendKeys("bob");
Application.Sleep(100);
pass.Select(Selection.TakeFocus);
Application.SendKeys("secret");
I've printed the element location and size for user and pass and the values are correct.
How do I force an element to take the focus?
Thanks