Winappdriver: Is that possible to run application with parameters using WinAppDriver?

Created on 27 May 2016  路  9Comments  路  Source: microsoft/WinAppDriver

Enhancement Question

Most helpful comment

Since v1.0-RC release, Windows Application Driver can now launch an application with parameters. Below is an example of launching Notepad opening MyTestFile.txt in C:\MyTestFolder\ working directory.

c# // Launch Notepad DesiredCapabilities appCapabilities = new DesiredCapabilities(); appCapabilities.SetCapability("app", @"C:\Windows\System32\notepad.exe"); appCapabilities.SetCapability("appArguments", @"MyTestFile.txt"); appCapabilities.SetCapability("appWorkingDir", @"C:\MyTestFolder\"); WindowsDriver<WindowsElement> NotepadSession = new WindowsDriver<WindowsElement>(new Uri("http://127.0.0.1:4723"), appCapabilities);

Check out the README.md for more information on other supported capabilities.

All 9 comments

@timotiusmargo, is that possible to run installer using WinAppDriver? Tried the following ways, but it doesn't work.

DesiredCapabilities appCapabilities = new DesiredCapabilities();
appCapabilities.SetCapability("app", @"C:\installer.msi");

and

DesiredCapabilities appCapabilities = new DesiredCapabilities();
appCapabilities.SetCapability("app", @"C:\Windows\System32\msiexec.exe");
appCapabilities.SetCapability("args", @"/i C:\installer.msi");

Hello @GitHubTestUser5 , we are trying to understand the scenario you want to run. Are you trying to UI test your installer or deploy your test app?

Hello @alakshmi1030, my goal is to run installer from MSI file and test its UI. When I try to do it using the ways listed in my previous comment I get "A session could not be created (33)" error.

Since v1.0-RC release, Windows Application Driver can now launch an application with parameters. Below is an example of launching Notepad opening MyTestFile.txt in C:\MyTestFolder\ working directory.

c# // Launch Notepad DesiredCapabilities appCapabilities = new DesiredCapabilities(); appCapabilities.SetCapability("app", @"C:\Windows\System32\notepad.exe"); appCapabilities.SetCapability("appArguments", @"MyTestFile.txt"); appCapabilities.SetCapability("appWorkingDir", @"C:\MyTestFolder\"); WindowsDriver<WindowsElement> NotepadSession = new WindowsDriver<WindowsElement>(new Uri("http://127.0.0.1:4723"), appCapabilities);

Check out the README.md for more information on other supported capabilities.

Hey @timotiusmargo and @alakshmi1030
Even if we are able to start the msi here, would WinAppDriver be able to overcome the Windows Smart screen filter, which blocks the entire screen and provide user with Yes/No pop up?

Hi @dhapolapankaj ,

I haven't personally tried it myself. But Windows Application Driver should be able to control (interact with) anything that is shown in the inspect.exe.

Presumably, this smart screen prompt is not part of the installer msi flow you are trying to validate. Hence, this smart screen filter can be avoided by configuring the test machine settings.

Hi @timotiusmargo,
Disabling the smart screen filter on Test Machine actually make sense!

Guyz Just an Update here.
I was able to install MSI silently by evoking cmd.exe and addig below switch command
/c "misexec /i "path_to_msi.msi" /quiet /passive /l "path_to_LogFile.txt""

Thank you very much for this

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Blank517 picture Blank517  路  4Comments

mdesousa picture mdesousa  路  4Comments

vnabokit picture vnabokit  路  3Comments

quincycs picture quincycs  路  3Comments

AmitVerma4HP picture AmitVerma4HP  路  4Comments