I'm looking at using Python and WinAppDriver to automate a clickonce application. When the application starts, I get a dialog with a yes and no button on screen.
from appium import webdriver
class TestStuff(unittest.TestCase):
@classmethod
def setUpClass(self):
#set up appium
desired_caps = {}
desired_caps["app"] = r"<path to .appref-ms>"
self.driver = webdriver.Remote(command_executor='http://127.0.0.1:4723',desired_capabilities= desired_caps)
@classmethod
def tearDownClass(self):
self.driver.quit()
def test_initialize(self):
self.driver.find_element_by_name("No").click()
if __name__ == '__main__':
suite = unittest.TestLoader().loadTestsFromTestCase(TestStuff)
unittest.TextTestRunner(verbosity=2).run(suite)
Now, when I run this script, I see my application launch - but then after a few seconds, I get an error **Failed to locate opened application window with appId: < path to the appref-ms > **
Not sure if this is an issue as a dialog is launching first, rather than the application? But can anyone suggest any other way to attach to the running application?