When i use touchAction in java, the Error is 'org.openqa.selenium.UnsupportedCommandException: touchFlick'. When i use touch_action in python, the Error is 'selenium.common.exceptions.WebDriverException: Message: unknown command: Cannot call non W3C standard command while in W3C mode'
this is my python code, and how can i to solution it.
mobileEmulation = {'deviceName': 'iPhone 6'}
options = webdriver.ChromeOptions()
s = Service(r"C:\Program Files\Google\Chrome\Application\chromedriver.exe")
options.add_experimental_option('mobileEmulation', mobileEmulation)
# options.add_experimental_option('w3c', False)
driver = webdriver.Chrome(options=options, service=s)
driver.get("https://chat-yanxi.jd.com/hindex.htm?entrance=10003&tenantId=10045")
action = TouchActions(driver)
WebDriverWait(driver, 5).until(EC.presence_of_element_located((By.XPATH, "//*[contains(text(), '我是您的智能咨询助理')]")))
for i in range(50):
driver.find_element(By.XPATH, "//div[@id='im-h5-input']").send_keys(i)
driver.find_element(By.XPATH, "//img[@id='im-h5-rightSend']").click()
time.sleep(1)
driver.refresh()
driver.implicitly_wait(10)
element = driver.find_element(By.XPATH, "//div[@class='message-wrapper-indicator']/div")
action.flick_element(element, 0, 200, 20).perform()
time.sleep(20)
driver.close()