Testing Windows Desktop Apps With Appium
One of the great things about Appium is that it can be used for far more than mobile app automation. While iOS and Android remain the most popular use case for Appium, it is too potential to use Appium to automatise a horde of other program, including Windows and Mac background applications. In this clause, we & # x27; ll take a looking at how to use Appium to automate Windows desktop apps. Automation of Windows apps is actually quite a special thing in the Appium world, since Microsoft itself supports this mechanisation via the development of a tool ringWinAppDriver. WinAppDriver is fundamentally an Appium-compatible automation interface, which Appium automatically includes if you set the appropriate desired capabilities for your test. What do you need to run automated examination of native Windows apps? Well, it goes without saying that you want a Windows PC to host and run your applications, as well as running the Appium waiter that will perform the automation. (Yourclientscript, of class, can run anywhere you like as long as it can connect to Appium lam on Windows over the network.) Here & # x27; s everything that I postulate to do to get Appium set up to automate Windows apps: 5. Run Appium (control I & # x27; m still in the Admin console!) For autonomous testing across multiple user personas, check out SUSATest — it explores your app like 10 different real users. At this point, my scheme is now ready to go, with an Appium server pass on the nonremittal porthole of 4723. All that & # x27; s left is to decide what to automate! Which potentiality are necessary for use with Windows app automation? Pretty much just the distinctive I: For an app that you haven & # x27; t created, like a built-in system app, I discovered a refined trick of open up a PowerShell window and running the following command: (The WinAppDriver medicotoo list respective other capabilities that might be useful for your purposes, so check them out too.) Ultimately, when put into Java client form, my capabilities look like: I found the Weather app to be quite well-instrumented with automation-ready IDs and labels. After I was capable to found a session expend the capableness above, I ran driver.getPageSource () to have a look at the seed XML. I plant it to be quite useful, with plenty of sections like this, that clue me into the most helpful useable attributes: This is the representation of a ListItem element which shows a particular day of the workweek along with a little weather summary. We can see that the Name attribute has most of the information I might want, including the appointment, the high and low temperature, and a conditions prognosis. I could easily observe this element via the name locator scheme, or (as I ended up perform), using xpath. Other non-dynamic component had the AutomationId attribute set, and for these elements, we can use the corresponding attribute as the selector for the handiness id locator strategy. Once we cognise how to find elements, there & # x27; s genuinely not lots more we need to know to write our test! The only wrinkle I see is that, unlike Appium & # x27; s demeanor with mobile apps, WinAppDriver does not reset the province of applications when a session starts. This is both a blessing and a swearing. It meant I could manually open the Weather app and click through all the prompting and ads, then trust that the state would remain the like when I launched an automated test. But it also entail that you can & # x27; t necessarily presume the app will always be in the like state across different system (say in a CI environment). Also, because I was bunk the test on the computer I was using, I of course had to stop employment while the test was running, so as not to trouble it (WinAppDriver slip the mouse and moves it around simply like a exploiter would). Without further ado, I present my very useless test of the Weather app, which simply finds every day which is listed in the app, detent on each one, and then publish out the conditions prognosis (along with sunrise/sunset) for that exceptional day. Again, it & # x27; s not a true & quot; test & quot; in the sense that I & # x27; m not making any verifications, but I am showcasing how leisurely it is to automate a Windows application using the Appium API. Are you already employ Windows automation efficaciously? Let us know about it in the input to this article! And as always you can assure out thefull codefor this article on GitHub. Lead, Content Marketing, HeadSpin Inc. Piali is a dynamic and results-driven Content Marketing Specialist with 8+ years of experience in crafting engaging narratives and marketing collateral across diverse industries. She surpass in collaborating with cross-functional teams to develop innovative content strategies and present compelling, unquestionable, and impactful substance that resonates with mark audiences and enhances brand authenticity. Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts needed. Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts..png)



Testing Windows Desktop Apps With Appium
AI-Powered Key Takeaways

Windows Automation Setup
npm install -g appium
appium
Windows Automation Desired Capabilities
You can find the Application Id of your covering in the generatedAppX\vs.appxrecipefile underRegisteredUserModeAppIDnode. E.g.c24c8163-548e-4b84-a466-530178fc0580_scyf5npe3hv32! Appget-StartappsDesiredCapabilities cap = new DesiredCapabilities (); caps.setCapability (`` platformName '', `` Windows ''); caps.setCapability (`` platformVersion '', `` 10 ''); caps.setCapability (`` deviceName '', `` WindowsPC ''); caps.setCapability (`` app '', `` Microsoft.BingWeather_8wekyb3d8bbwe! App ''); driver = new AppiumDriver < > (new URL (`` http: //localhost:4723/wd/hub ''), caps);Finding UI Elements In Windows Apps
Writing a Test for a Windows App
import io.appium.java_client.AppiumDriver; meaning io.appium.java_client.MobileBy; import org.junit.After; import org.junit.Before; signification org.junit.Test; importation org.openqa.selenium.By; import org.openqa.selenium.WebElement; import org.openqa.selenium.remote.DesiredCapabilities; signification org.openqa.selenium.support.ui.ExpectedConditions; import org.openqa.selenium.support.ui.WebDriverWait; import java.io.IOException; import java.net.URL; public class Edition081_Windows {private AppiumDriverPiali Mazumdar
Testing Windows Desktop Apps With Appium
4 Parts
-1280X720-Final-2.jpg)
Regression Intelligence practical guidebook for innovative user (Part 3)
-1280X720-Final-2.jpg)
Regression Intelligence hard-nosed guidebook for advanced users (Part 4)
Discover how HeadSpin can empower your business with superior testing capabilities







Discover how HeadSpin can endow your business with superior testing capabilities
Discover how HeadSpin can empower your job with superior testing capabilities
Connet Now


Automate This With SUSA
Test Your App Autonomously







.png)












