How to do tab 5 times, to get to a text box then use a keyboard command to type the text

Ask general questions here.
testingtesting123
Posts: 6
Joined: Tue Dec 14, 2021 1:13 pm

How to do tab 5 times, to get to a text box then use a keyboard command to type the text

Post by testingtesting123 » Thu Mar 09, 2023 6:03 pm

Hello guys,

How to do tab 5 times, to get to a text box then use a keyboard command to type the text in a text box field, then another tab again to go to a save button then press enter the save button using only the keyboard commands?

dhale
Posts: 84
Joined: Thu Feb 27, 2014 7:33 pm

Re: How to do tab 5 times, to get to a text box then use a keyboard command to type the text

Post by dhale » Thu Mar 09, 2023 8:16 pm

To limit to just the Keyboard, you can do something like: (untested)

Code: Select all

Keyboard.Press("{Tab}, 300, 5");
Keyboard.Press("<your string value here>", 300);
Keyboard.Press("{Return});
See https://www.ranorex.com/Documentation/R ... ess_12.htm

Alt #1: You could do a recording of these specific actions and turn it into user code.
Alt #2: Search the boards: search.php?keywords=PressKeys
Alt #3: Look at the technical docs https://www.ranorex.com/Documentation/R ... ess_10.htm

testingtesting123
Posts: 6
Joined: Tue Dec 14, 2021 1:13 pm

Re: How to do tab 5 times, to get to a text box then use a keyboard command to type the text

Post by testingtesting123 » Fri Mar 10, 2023 2:44 pm

Still no joy, I can manually tab is 5 times and then enter the text box but that code didn't work I'm afraid

I've also tried Keyboard.Press(Keys.Tab), Keyboard.Press("{TAB}") and Keyboard.Press("{Tab down}")

testingtesting123
Posts: 6
Joined: Tue Dec 14, 2021 1:13 pm

Re: How to do tab 5 times, to get to a text box then use a keyboard command to type the text

Post by testingtesting123 » Fri Mar 10, 2023 5:59 pm

I did notice the dilogue box isn't in focus, but how do you go about making a dialogue that has no properties in focus

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

Re: How to do tab 5 times, to get to a text box then use a keyboard command to type the text

Post by Stub » Mon Mar 13, 2023 9:19 am

Click on the caption bar, or use the Ranorex API to adjust focus to the dialog.

testingtesting123
Posts: 6
Joined: Tue Dec 14, 2021 1:13 pm

Re: How to do tab 5 times, to get to a text box then use a keyboard command to type the text

Post by testingtesting123 » Mon Mar 13, 2023 10:16 am

Can you provide the code for this please?

testingtesting123
Posts: 6
Joined: Tue Dec 14, 2021 1:13 pm

Re: How to do tab 5 times, to get to a text box then use a keyboard command to type the text

Post by testingtesting123 » Mon Mar 13, 2023 2:35 pm

testingtesting123 wrote:
Mon Mar 13, 2023 10:16 am
Can you provide the code for this please bearing in mind there are no elements in the DOM?