Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Desktop automation using winapp driver #1986

Open
Surekha-tfs opened this issue Mar 21, 2024 · 0 comments
Open

Desktop automation using winapp driver #1986

Surekha-tfs opened this issue Mar 21, 2024 · 0 comments

Comments

@Surekha-tfs
Copy link

HI,
I am automating my application using win App driver
i written code like this

import unittest
from appium import webdriver

class AttuneTests(unittest.TestCase):

@classmethod

def setUpClass(self):
    desired_cap = dict(
         platformName= 'Windows', 
         platformVersion = '10',
         deviceName='WindowsPC',
        app= 'C:\\Program Files\\LifeTechnologies\\AttuneNxT\\Attune.exe'
        
    )
    self.driver = webdriver.Remote(
        command_executor='http://127.0.0.1:4723',
        desired_capabilities = desired_cap)
    self.driver.implicitly_wait(30)
    self.driver.maximize_window()
    self.driver.find_element_by_name("Attune™ Acoustic Focusing Cytometer")

def test_attunelogin(self):        
    self.driver.find_element_by_accessibility_id("1962").send_keys("admin")
    self.driver.find_element_by_accessibility_id("1963").send_keys("admin1")
    self.driver.find_element_by_accessibility_id("1964").click()
   
        
@classmethod
def tearDownClass(self):
    self.driver.quit()

if name == 'main':
suite = unittest.TestLoader().loadTestsFromTestCase(AttuneTests)
unittest.TextTestRunner(verbosity=2).run(suite)

But i am facing the below issue
the application is opened but its failing to locate

ERROR

======================================================================
ERROR: setUpClass (main.AttuneTests)

Traceback (most recent call last):
File "c:\Users\Surekha.p\Downloads\Surekha study\Attune-Winapp_Ex\tasks.py", line 36, in setUpClass
self.driver = webdriver.Remote(
File "C:\ProgramData\robocorp\ht\8211519_b1f3c24_9ba66f27\lib\site-packages\appium\webdriver\webdriver.py", line 267, in init
super().init(
File "C:\ProgramData\robocorp\ht\8211519_b1f3c24_9ba66f27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 157, in init
self.start_session(capabilities, browser_profile)
File "C:\ProgramData\robocorp\ht\8211519_b1f3c24_9ba66f27\lib\site-packages\appium\webdriver\webdriver.py", line 357, in start_session
response = self.execute(RemoteCommand.NEW_SESSION, parameters)
File "C:\ProgramData\robocorp\ht\8211519_b1f3c24_9ba66f27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "C:\ProgramData\robocorp\ht\8211519_b1f3c24_9ba66f27\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: Failed to locate opened application window with appId: C:\Program Files\LifeTechnologies\AttuneNxT\Attune.exe, and processId: 32220


Ran 0 tests in 7.275s

FAILED (errors=1)
Can you help to resolve this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant