Monday 4 February 2019

Some Scriblings

Installing WinAppDriver silently

/c "misexec /i "path_to_msi.msi" /quiet /passive /l "path_to_LogFile.txt""





-Pankaj Dhapola
Let's Think on it

Tuesday 1 January 2019

Simple WinAppDriver Code for creating desktop session


I came across many situation where people want to start the application directly using WinAppDriver.
Sometimes, they come across many weird error and are stuck waiting for someone to resolve.

One of the alternative to this problem is to create a session of Windows Desktop and then finding the right Windows in your desktop session. This code is my personal favorite.


Code below

RemoteWebDriver WindowsDesktopSession;
DesiredCapabilities WindowsDesktopCapabilities;
IWebElement TargetWindow;

WindowsDesktopCapabilities = new DesiredCapabilities();
WindowsDesktopCapabilities.SetCapability("app", "Root");
WindowsDesktopCapabilities.SetCapability("deviceName", "WindowsPC");

WindowsDesktopSession= new RemoteWebDriver(new Uri("http://127.0.0.1:4723"), WindowsDesktopCapabilities);

TargetWindow = WindowsDesktopSession.FindElement(By.XPath( strTargetAppicationWindowsXPath));



There you go!

Now you have the "TargetWindow", start using this object to explore the elements present inside this Window.

-Pankaj Dhapola
Let's Think on it