How to clean user name field on login form?

Best practices, code snippets for common functionality, examples, and guidelines.
ngrishakin
Posts: 42
Joined: Fri Oct 04, 2013 9:47 pm

How to clean user name field on login form?

Post by ngrishakin » Fri Jun 09, 2017 5:14 pm

I'm trying to use Ranorex IDE for the first time. My user name field when I'm trying to login has last login name.
I want to clean this field and type in new user name. Using API I would do just PressKeys("{END}{SHIFT DOWN}{HOME}{SHIFT UP}{DELETE}") and type a new one. Any idea how do I insert the action that would do the same thing? I inserted a screen shot. If I try to type this keys in the field it does not work :(
Thanks a lot,
Nik
You do not have the required permissions to view the files attached to this post.

ngrishakin
Posts: 42
Joined: Fri Oct 04, 2013 9:47 pm

Re: How to clean user name field on login form?

Post by ngrishakin » Fri Jun 09, 2017 5:29 pm

Also instead Step 3 I called a user code:

public void CleanUserName()
{
repo.LoginSalesforce.Username.Element.Actions.Clear();
}

It did not work either

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: How to clean user name field on login form?

Post by odklizec » Fri Jun 09, 2017 7:06 pm

Hi,

I would suggest to use Ctrl+A shortcut to select everything in username input and then simply replace (or delete) selected text with new one (using key sequence action). Hope this helps?
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

ngrishakin
Posts: 42
Joined: Fri Oct 04, 2013 9:47 pm

Re: How to clean user name field on login form?

Post by ngrishakin » Fri Jun 09, 2017 8:33 pm

Thank you! Got that resolved

User avatar
Stub
Posts: 515
Joined: Fri Jul 15, 2016 1:35 pm

Re: How to clean user name field on login form?

Post by Stub » Mon Jun 12, 2017 8:16 am

I ended up right-clicking and choosing Select All from the context menu. Hadn't thought about using a keyboard short-cut!