I am new to Appium. I have written a script but it gives invalid syntax error

20 Views Asked by At
from appium import webdriver
from appium.webdriver.common.appiumby import AppiumBy

desired_caps = {} 
desired_caps['platformName'] = 'Android' 
desired_caps['automationName'] = 'UiAutomator2' 
desired_caps['platformVersion'] = '10' 
desired_caps['deviceName'] = 'Galaxy A04e' 
desired_caps['app'] = ('C:/Users/Simplex/Downloads/Kfc(stg-1.0.64).apk') 
desired_caps['appPackage'] = 'io.bramerz.kfc'
desired_caps['appActivity'] = 'io.bramerz.kfc.MainActivity'

driver = webdriver.Remote('http://127.0.0.1:4723/wd/hub', desired_caps)

driver.find_element(AppiumBy.CLASS_NAME, "android.widget.ImageView").click()

When I run this script is VS code, It gives following error:

SyntaxError: invalid syntax
>>> & C:/Users/Simplex/AppData/Local/Programs/Python/Python312/python.exe "d:/Appium project/LaunchApp.py"
  File "<stdin>", line 1

How can i fix this?

0

There are 0 best solutions below