WinAppDriver icon indicating copy to clipboard operation
WinAppDriver copied to clipboard

What is the Windows Maximize Short Key for WinAppDriver ?

Open rajeeshmenoth opened this issue 8 years ago • 8 comments

Hi,

I am not able to find any Keyboard.PressKey for Maximize the Current Window Screen.

Eg : "Win + Up Arrow" ( Maximize )

rajeeshmenoth avatar May 23 '18 04:05 rajeeshmenoth

Does it have to be a hotkey? I believe you can call into Selenium for this. I'm not on my computer with WAP installed, but I think it should be something like Session.Manage().Window.Maximize();

PandaMagnus avatar May 23 '18 15:05 PandaMagnus

Hi @PandaMagnus ,

I am executing my Application through "WinAppDriver". Now I resolved this issue using the following short cut key. Keyboard.PressKey(Keys.Alt + Keys.Space + 'x');

But I want to know if any short cut Keys available for "Windows" or "Win" ( Win + Up Arrow ).

rajeeshmenoth avatar May 24 '18 09:05 rajeeshmenoth

@rajeeshmenoth WinAppDriver sits on top of Appium and Selenium, so there should be either a Selenium command, or an equivalent Appium command.

I just checked on my machine with WinAppDriver, and Session.Manage().Window.Maximize(); will work for a regular desktop app.

PandaMagnus avatar May 24 '18 20:05 PandaMagnus

Hi @PandaMagnus ,

I agree with your points. Do we have any Keys available instead of Session.Manage().Window.Maximize() ?

rajeeshmenoth avatar Jun 06 '18 04:06 rajeeshmenoth

You mentioned Win + Up Arrow earlier. If that doesn't work, try Alt+Enter, then the X key. Alt+Enter should open the context menu for the application with focus, and hitting the "x" key should invoke the maximize command.

PandaMagnus avatar Jun 06 '18 04:06 PandaMagnus

Hi @rajeeshmenoth,

Yes you can indeed invoke the Win + Up Arrow to maximize the application as follows:

session.Keyboard.SendKeys(Keys.Command + Keys.ArrowUp + Keys.Command);

Notice the use of Keys.Command for the Win button modifier at the end to release it. A different example of using the Win button can be found below: https://github.com/Microsoft/WinAppDriver/blob/v1.0/Tests/WebDriverAPI/SendKeys.cs#L122

timotiusmargo avatar Jun 06 '18 23:06 timotiusmargo

Hi @timotiusmargo ,

Perfect Answer ! Thank you.

rajeeshmenoth avatar Jun 08 '18 12:06 rajeeshmenoth

I am also facing the same issue, the only problem is my window is a child of the application window. Hence In my case my window object is Webelement.

I can't use session handel as it will maximize or minimize the parent window. There seems to be no way to cast webelement to windowselement cant set attribute value to an object (Window.WindowVisualState: Maximized (1))

vaib-ag avatar Mar 28 '19 04:03 vaib-ag