0

I use adb + Python + Appium to test android phones, my test works fine on one device, but when I connect two devices at once, this error comes out:

# Dow PIA VPN
subprocess.call("adb -s device install C:\\Users\\SMD\\Desktop\\SOFT\\program\\PIA.apk", shell=True)
#Open PIA VPN
driver.find_element(By.XPATH, '//android.widget.TextView[@content-desc="PIA VPN"]').click()
time.sleep(20)

ERROR


Traceback (most recent call last):
  File "C:/Users/SMD/main.py", line 31, in <module>
    elem = driver.find_element(By.XPATH, '//android.widget.TextView[@content-desc="PIA VPN"]')
  File "C:\Users\SMD\venv\lib\site-packages\appium\webdriver\webdriver.py", line 371, in find_element
    return self.execute(Remote Command.FIND_ELEMENT, {'using': by, 'value': value})['value']
  File "C:\Users\SMD\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 444, in execute
    self.error_handler.check_response(response)

Robert
  • 39,162
  • 17
  • 99
  • 152
  • Perhaps not the comment you expect as it's not based on appium, but as nobody provided a solution yet you can take a look at https://stackoverflow.com/questions/72300306/how-to-start-culebratester2-server-on-more-than-one-device which describes the connection to multiple devices using culebratester2 and to click on the icon you can use something like https://github.com/dtmilano/AndroidViewClient/blob/master/examples/helper/click-and-wait#L11. Feel free to ask another question, I don't want to hijack this one. – Diego Torres Milano Nov 16 '22 at 00:17

0 Answers0