Press 'End' key during WebDriver execution

Class library usage, coding and language questions.
User avatar
BrotherCarson
Posts: 5
Joined: Mon May 15, 2017 8:21 pm
Location: Dallas, TX

Press 'End' key during WebDriver execution

Post by BrotherCarson » Fri Mar 22, 2019 8:13 pm

Zips up flame suit. There is a chance this has already been answered but I was unable to find it.

I have been attempting to press the 'End' key while running my scripts against a WD endpoint and have thus far been unsuccessful.

I have a bunch of text boxes that need to scroll to the bottom before the buttons will activate and when executing locally I am able to satisfy this need via the 'End' key.

I have tried all of the following with no luck:

repo.documentsPage.doc1_box.PressKeys("{RControlKey down}{End down}{RControlKey up}{End up}");

Error: The escape group {RControlKey down} is not supported by the web driver.

repo.documentsPage.doc1_box.PressKeys("{End}");

Error: The escape group {End} is not supported by the web driver.

Keyboard.PrepareFocus(repo.documentsPage.doc1_box);
Keyboard.Press(System.Windows.Forms.Keys.End, Keyboard.DefaultScanCode, Keyboard.DefaultKeyPressTime, 1, true);


Error: Cannot perform a local keyboard action on a mobile element.

I hope I am just over looking something simple, and I am using the wrong key words in my Google search but I have come up with nothing else to try here (regarding an 'End' key press).

So I ask the forum and it's infinite wisdom if they could assist me with this.

Thanks!

User avatar
BrotherCarson
Posts: 5
Joined: Mon May 15, 2017 8:21 pm
Location: Dallas, TX

Re: Press 'End' key during WebDriver execution

Post by BrotherCarson » Fri Mar 22, 2019 9:11 pm

Ranorex version: 9.0.0
Local and remote OS: Win 7

Whoops forgot to post this.

User avatar
Support Team
Site Admin
Site Admin
Posts: 11999
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Press 'End' key during WebDriver execution

Post by Support Team » Mon Mar 25, 2019 1:36 pm

Hi BrotherCarson,

Thank you for your post.

Unfortunaltey, the excape groups for pressing the "End" key are not supported on a webdriver endpoint.
However, you can implement a workaround using Selenium code:
PressEndKey.png
PressEndKey.png (41.01 KiB) Viewed 376 times
Please let us know if this helps, or if you need assistance implementing this code.

Kind Regards,
Stephan
.
Image

User avatar
BrotherCarson
Posts: 5
Joined: Mon May 15, 2017 8:21 pm
Location: Dallas, TX

Re: Press 'End' key during WebDriver execution

Post by BrotherCarson » Tue Mar 26, 2019 8:21 pm

Support Team wrote:
Mon Mar 25, 2019 1:36 pm

Please let us know if this helps, or if you need assistance implementing this code.
Yep, worked like a charm! Thanks for the assist.

User avatar
Support Team
Site Admin
Site Admin
Posts: 11999
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Press 'End' key during WebDriver execution

Post by Support Team » Wed Mar 27, 2019 10:59 am

Hi,

That's great!
I'm glad I could help.

Regards,
Stephan
.
Image