In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
Editor to share with you what are the common ways to click in appium, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
First import webdriver from the appium library, and then webdriver.Remote () declares the driver object.
To use TouchAction, you must create a TouchAction object, invoke the gesture you want to perform through the object, and perform the action through perform ().
# Import TouchActionfrom appium.webdriver.common.touch_action import TouchAction1, the most common click method, click () method, driver.find_element_by_id ("com.android.settings:id/search"). Click () 2, finger tap screen operation tap () method
Tap (element,x,y) can be tapped either by element positioning or by element coordinates.
# tapping the screen el = driver.find_element_by_xpath ("/ / * [contains (@ text,'WLAN')]") TouchAction (driver) .tap (el). Perform () # perform () method to send commands to the server to perform the operation # tapping the screen by means of coordinates, element coordinates: Xue149Laoyao324TouchAction (driver) .tap (xq149PMYF324) .perform () 3, finger pressing operation press () method
Press (elemnet,x,y) can be pressed either by element positioning or by element coordinates.
The release () method ends the action by pressing the finger and leaving the screen.
# Press the screen el = driver.find_element_by_xpath ("/ / * [contains (@ text,'WLAN')]") TouchAction (driver) .press (el) .release () .perform () # by means of element positioning, element coordinate xcoordinate 149Power324TouchAction (driver) .press (147324) .release () .perform () 4, simulated finger length press long_press () method
A long press increases the amount of time it takes to press down, so an extra duration unit is millisecond.
Long_press (elemnet,x,y,duration) can also be pressed by element positioning or by element coordinates.
El = driver.find_element_by_id ("android:id/title") # long by element TouchAction (driver). Long_press (el,duration=5000). Release (). Perform () # long by element by coordinate WiredSSID coordinates: Xerox 770 discipline 667 # wait (5000) wait five seconds # add wait (with long press X effect) / do not add wait (no long press effect) TouchAction (driver). Long_press). Release (). Perform () above are all the contents of this article entitled "what are the common clicks in appium?" Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.