This is a migrated thread and some comments may be shown as answers.

Simulating ENTER on locked screen

10 Answers 139 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Martin
Top achievements
Rank 1
Martin asked on 18 Jan 2012, 01:52 PM
Hi

How do i simulate what happens when a user press ENTER?

Scenario:
User fills in login information and while password field has focus hits enter to login.

I need to automate that scenario, but i can't use Desktop.KeyBoard because it has to work on a locked screen.

How can i do that using Telerik?


I know selenium can do something like .Sendkeys("\n"); for a ENTER key. (which works on locked screens)

10 Answers, 1 is accepted

Sort by
0
Stoich
Telerik team
answered on 18 Jan 2012, 03:48 PM
Hi Martin,
I don't believe a true, desktop keyboard click can be simulated on a locked desktop with any UI automation tool.

What should work is a DOM click (which is different from a desktop click that simulates a physical user).
 
You can implement a DOM click by finding the "Submit" button in code:
HtmlInputButton button = Find.ByContent<HtmlInputButton>("Submit");
button.Click(false);

Greetings,
Stoich
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Martin
Top achievements
Rank 1
answered on 19 Jan 2012, 02:07 PM
Hi Stoich

I know i can click the submit button, but what i was looking for is a way to automatically test that if a user does the following:

Type: Login
Type: Pass
Hits: ENTER

That the user is then logged in, am i to understand that Telerik cannot test this?



If it's the case that Telerik have no way of simulating anything similar to a ENTER hit without running on a open screen then i have another problem.

How do i handle a search field with no click button? A text field that conducts search when ENTER is pressed but with no UI button to click??


Again remember it's a requirement that this can be done on locked screens.
0
Martin
Top achievements
Rank 1
answered on 19 Jan 2012, 03:12 PM
Hi

Did some more digging.

_driver.FindElement(By.XPath("//input[contains(@id, 'TopLoginControl_loginEmail')]")).SendKeys("LOGIN");
_driver.FindElement(By.XPath("//input[contains(@id, 'TopLoginControl_loginPassword')]")).SendKeys("PASS");
_driver.FindElement(By.XPath("//input[contains(@id, 'TopLoginControl_loginPassword')]")).SendKeys("\n");


This code will do the trick in selenium, it may not be the perfect simulation but it's good enough to find a bug which is about some login forms doesn't submit on ENTER and others do.

And that code will run with or without locked screen just the same


I hope you can help find a way Telerik can solve the problem so I don't have to do manual regression test of this.
0
Cody
Telerik team
answered on 19 Jan 2012, 09:55 PM
Hello Martin,

I would like to step in for a moment and just clarify a couple of points.

1) Yes Test Studio can simulate pressing the Enter key. Our recorder will record it automatically and add it as a non-coded test step. This can also be done in code this way:

Manager.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.Enter);

2) No Test Studio (and most UI automation tools) are not able to do anything with the keyboard or mouse input events on a locked machine. This is a Windows security limitation. When the machine is in the locked state Windows removes the "Interactive desktop" permission.

A common way to work around this is to a VNC type of product. These products act like a video card such that when you disconnect the VNC connection without logging off, Windows doesn't actually enter the "locked" state leaving UI automation tools free to run unhindered on a headless machine.

I hope that clarifies the situation we're dealing with here.

Greetings,
Cody
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Martin
Top achievements
Rank 1
answered on 20 Jan 2012, 07:21 AM
It clarifies as much as Telerik having a limitation that Selenium doesn't.

But it doesn't really help me much :(.


Do Telerik have any plan of implementing a feature similar to what Selenium does? lets just call it FakeEnter()?
0
Cody
Telerik team
answered on 20 Jan 2012, 04:19 PM
Hi,

I understand the dilemma. Is there a reason/problem preventing you from trying a VNC product?

Yes, eventually we will be implementing the ability for tests to run unhindered on a locked machine. We have already done some initial investigation on what it would take and have determined it is not a trivial change to make it work reliably across all versions of Windows.

All the best,
Cody
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Martin
Top achievements
Rank 1
answered on 20 Jan 2012, 05:46 PM
Hi,

Thanks for the response.

Regarding VNC I haven't looked into it yet, do you have a link to where I can read about it you would recommend?

Regards
Martin
0
Cody
Telerik team
answered on 20 Jan 2012, 05:52 PM
Hi,

Yes, here's the link I included on my Jan 19th response to you.
http://en.wikipedia.org/wiki/VNC 

Regards,
Cody
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Russ
Top achievements
Rank 1
answered on 20 Jan 2016, 05:52 PM
Hi Cody, we are having this issue now with running automated tests.  We are not allowed to use VNC.  Has Telerik made any progress in allowing us to run our tests headless?
0
Boyan Boev
Telerik team
answered on 22 Jan 2016, 01:30 PM
Hello Russ,

Any test that requires moving the mouse or sending key strokes still requires an unlocked desktop.

Telerik tests are not the only types affected by this Windows limitation. You will find this is a general problem with any tool that performs UI testing.

Thank you for your understandings.

Regards,
Boyan Boev
Telerik
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
Tags
General Discussions
Asked by
Martin
Top achievements
Rank 1
Answers by
Stoich
Telerik team
Martin
Top achievements
Rank 1
Cody
Telerik team
Russ
Top achievements
Rank 1
Boyan Boev
Telerik team
Share this question
or