import logging
from appium import webdriver
import time
from appium.webdriver.common.mobileby import MobileBy
from appium.webdriver.common.touch_action import TouchAction
class TestXueQiu:
def setup(self):
caps = {}
caps["platformName"] = "android"
caps["deviceName"] = "ld"
caps["appPackage"] = "com.jingdong.app.mall"
caps["appActivity"] = "com.jingdong.app.mall.main.MainActivity"
caps["chromedriverExecutable"] = r"E:\python\chromedriver.exe"
caps["noReset"] = True
caps["skipDeviceInitialization"] = True
self.driver = webdriver.Remote("http://127.0.0.1:4723/wd/hub", caps)
self.driver.implicitly_wait(20)
def test_search(self):
self.driver.find_element(MobileBy.XPATH,"//*[@content-desc='购物车