1

I have application which has extension as .msc, I tried it with python I also ran winappdriver before executing this script. I have seen demo codes on some blogs which uses .exe file extension for the app like calculator or notepad, but nothing around .msc. And similar question around this same problem is unanswered here https://stackoverflow.com/questions/67823892/appium-winappdriver-unable-to-automate-jnlp-applications-the-specified-exec Like

import time
from appium import webdriver

desired_caps = {}
desired_caps["app"] = "C:\\Desktop\vit extended\vit.msc"
desired_caps["platformName"] = "Windows"

driver = webdriver.Remote("http://127.0.0.1:4723", desired_caps)

time.sleep(4)

Earlier I was getting below error but got rid of this when I added additional capabilities as appWorkingDir and deviceName-

Failed to locate opened application window with appId "xxx" and process "xxx"

but now stumbled upon getting this error -

The specified Executable is not a valid application for this OS Platform

1 Answer 1

0

Winappdriver can start executables (generally .exe files on Windows)

I suspect your .msc file is a management saved console? If so, your actual executable would be mmc.exe (see e.g. here: https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/mmc) and your msc file an argument passed to mmc.

I cannot test this, but I suspect something along these lines should solve your problem:

from appium import webdriver

desired_caps = {}
desired_caps["app"] = "Wherever mmc is on your system\mmc.exe"
desired_caps["appArguments"] = "C:\\Desktop\vit extended\vit.msc"
desired_caps["platformName"] = "Windows"

driver = webdriver.Remote("http://127.0.0.1:4723", desired_caps)
3
  • Tried and not working saying that, MMC is created with the later version. However I also suspect that MMC is nothing to do with this. Since my application is launching but not identifying the elements on it.
    – Dev
    Mar 10, 2022 at 9:08
  • I guess, in the end it boils down to: You have to figure out how to start your application via the command line. mmc was my best guess based on the file suffix .msc, but of course, on your system, the default executable for .msc files might be something else...
    – maaeli
    Mar 10, 2022 at 11:53
  • On my system I was not admin user, And that was the trick, I tried cmd as administrator on another system and it launches the application. and same is happening in my code the applications is getting launch but some how it is not detecting that process further.
    – Dev
    Mar 10, 2022 at 12:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.