精华内容
下载资源
问答
  • appium滑动

    2018-09-29 13:17:00
    在app应用日常使用过程中,会经常用到在屏幕滑动操作。...在Appium中模拟用户滑动操作需要使用swipe方法,该方法定义如下: def swipe(self, start_x, start_y, end_x, end_y, duration=None): """Swipe fr...

    在app应用日常使用过程中,会经常用到在屏幕滑动操作。如刷朋友圈上下滑操作、浏览图片左右滑动操作等。在自动化脚本该如何实现这些操作呢?

    在Appium中模拟用户滑动操作需要使用swipe方法,该方法定义如下:

        def swipe(self, start_x, start_y, end_x, end_y, duration=None):

            """Swipe from one point to another point, for an optional duration.

     

            :Args:

             - start_x - x-coordinate at which to start

             - start_y - y-coordinate at which to start

             - end_x - x-coordinate at which to stop

             - end_y - y-coordinate at which to stop

             - duration - (optional) time to take the swipe, in ms.

     

            :Usage:

                driver.swipe(100, 100, 100, 400)

    滑动解析

    滑动主要分为:

    1. 水平滑动
    2. 垂直滑动
    3. 任意方向滑动

     

     

    滑动轨迹图如下:

     

     

    实践应用

    测试场景

    • 安装启动考研帮,手动向水平左滑动首页引导页面。
    • 点击“立即体验”进入登录页面。

    代码实现

    swipe.py

    from time import sleep

    from find_element.capability import driver

     

    #获取屏幕尺寸

    def get_size():

        x=driver.get_window_size()['width']

        y=driver.get_window_size()['height']

        return x,y

     

    #显示屏幕尺寸(width,height

    l=get_size()

    print(l)

     

    #向左滑动

    def swipeLeft():

        l=get_size()

        x1=int(l[0]*0.9)

        y1=int(l[1]*0.5)

        x2=int(l[0]*0.1)

        driver.swipe(x1,y1,x2,y1,1000)

     

    #向左滑动2

    for i in range(2):

        swipeLeft()

        sleep(0.5)

     

    driver.find_element_by_id('com.tal.kaoyan:id/activity_splash_guidfinish').click()

     

    注意:运行前记得将capablity里面的check_skipBtn()先注释掉,否则直接跳过了无法滑动引导页面。

    课后作业

    把垂直上下滑动以及向右滑动的也封装并实践。

    • def swipeUp()
    • def swipeDown()
    • def swipeRight()

    参考答案

    def swipeUp():

        l = get_size()

        x1 = int(l[0] * 0.5)

        y1 = int(l[1] * 0.95)

        y2 = int(l[1] * 0.35)

        driver.swipe(x1, y1, x1, y2, 1000)

     

    def swipeDown():

        l=get_size()

        x1 = int(l[0] * 0.5)

        y1 = int(l[1] * 0.35)

        y2 = int(l[1] * 0.85)

        driver.swipe(x1, y1, x1, y2, 1000)

     

    def swipeRight():

        l=get_size()

        y1 = int(l[1] * 0.5)

        x1 = int(l[0] * 0.25)

        x2 = int(l[0] * 0.95)

        driver.swipe(x1, y1, x2, y1, 1000)

     

     

    转载于:https://www.cnblogs.com/xuzhongtao/p/9723217.html

    展开全文
  • appium 滑动

    2019-09-23 08:12:08
    前些日子,配置好了appium测试环境,至于环境怎么搭建,参考:http://www.cnblogs.com/tobecrazy/p/4562199.html  知乎Android客户端登陆:http://www.cnblogs.com/tobecrazy/p/4579631.html ...

    前些日子,配置好了appium测试环境,至于环境怎么搭建,参考:http://www.cnblogs.com/tobecrazy/p/4562199.html

                        知乎Android客户端登陆:http://www.cnblogs.com/tobecrazy/p/4579631.html

                                                      appium实现截图和清空EditText:http://www.cnblogs.com/tobecrazy/p/4592405.html

     

           

    Appium 处理滑动 

    appium 处理滑动的方法是  swipe(int start-x, int start-y, int end-x, int end-y, int during) - Method in class io.appium.java_client.AppiumDriver
    此方法共有5个参数,都是整形,依次是起始位置的x y坐标和终点位子的x y坐标和滑动间隔时间,单位毫秒
    坐标是指:屏幕左上角为坐标系原点(0,0),屏幕分辨率为终点坐标,比如你手机分辨率1080*1920,那么该手机坐标系的终点是(1080*1920)
    ,每个元素都在坐标系中,可以用坐标系定位元素。
              
    比如这个登陆按钮在坐标系中的位置是起始点 + 终点(32,1040) (351,1152)

    向上滑动

    向上滑动,就是从下到上,那么怎么进行从下到上的滑动呢?
    按照之前理解的坐标系,从上到下滑动,一般是垂直滑动,也就是X轴不变,Y轴从大变小的过程
    我们可以采取Y轴固定在屏幕正当中,Y轴滑动屏幕的1/2,Y轴的起始位置为屏幕的3/4,滑动终点为Y轴的1/4(尽量避免使用坐标系的起点和终点),滑动时间为1s,如果滑动时间过短,将会出现一次滑动多页。
    需要提醒的是,很多app运行的时候并不是全屏,还有系统自带工具栏和边框,一定要避免!!!
      
        driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
    
            
            // find keyword 首页 and verify it is display
            Assert.assertTrue(driver.findElement(By.name("首页")).isDisplayed());
            snapshot((TakesScreenshot) driver, "zhihu_before_swipe.png");
            int width=driver.manage().window().getSize().width;
            int height=driver.manage().window().getSize().height;  
            driver.swipe(width/2,height*3/4, width/2,height/4, 1000);
            //wait for page loading
            
            snapshot((TakesScreenshot) driver, "zhihu_after_swipe.png");

     

     可以看出 ,为了让apppium 更好的兼容不同分辨率的设备,在执行滑动前先获取屏幕的分辨率
    接下来就可以封装四个滑动的方法:
    /**
         * This Method for swipe up
         * 
         * @author Young
         * @param driver
         * @param during
         */
        public void swipeToUp(AndroidDriver driver, int during) {
            int width = driver.manage().window().getSize().width;
            int height = driver.manage().window().getSize().height;
            driver.swipe(width / 2, height * 3 / 4, width / 2, height / 4, during);
            // wait for page loading
        }
    
        /**
         * This Method for swipe down
         * 
         * @author Young
         * @param driver
         * @param during
         */
        public void swipeToDown(AndroidDriver driver, int during) {
            int width = driver.manage().window().getSize().width;
            int height = driver.manage().window().getSize().height;
            driver.swipe(width / 2, height / 4, width / 2, height * 3 / 4, during);
            // wait for page loading
        }
    
        /**
         * This Method for swipe Left
         * 
         * @author Young
         * @param driver
         * @param during
         */
        public void swipeToLeft(AndroidDriver driver, int during) {
            int width = driver.manage().window().getSize().width;
            int height = driver.manage().window().getSize().height;
            driver.swipe(width * 3 / 4, height / 2, width / 4, height / 2, during);
            // wait for page loading
        }
    
        /**
         * This Method for swipe Right
         * 
         * @author Young
         * @param driver
         * @param during
         */
        public void swipeToRight(AndroidDriver driver, int during) {
            int width = driver.manage().window().getSize().width;
            int height = driver.manage().window().getSize().height;
            driver.swipe(width / 4, height / 2, width * 3 / 4, height / 2, during);
            // wait for page loading
        }

     


     

    最后来测试一下这几个滑动方法:
    package com.dbyl.core;
    
    import org.apache.commons.io.FileUtils;
    import org.openqa.selenium.By;
    import org.openqa.selenium.NoSuchElementException;
    import org.openqa.selenium.OutputType;
    import org.openqa.selenium.TakesScreenshot;
    import org.openqa.selenium.WebElement;
    import org.openqa.selenium.remote.CapabilityType;
    import org.openqa.selenium.remote.DesiredCapabilities;
    import org.testng.Assert;
    import org.testng.annotations.AfterClass;
    import org.testng.annotations.BeforeClass;
    import org.testng.annotations.Test;
    
    import io.appium.java_client.android.AndroidDriver;
    
    import java.io.File;
    import java.io.IOException;
    import java.net.URL;
    import java.util.List;
    import java.util.concurrent.TimeUnit;
    
    public class zhiHu {
        private AndroidDriver driver;
        private boolean isInstall = false;
    
        /**
         * @author Young
         * @throws IOException
         */
        public void startRecord() throws IOException {
            Runtime rt = Runtime.getRuntime();
            // this code for record the screen of your device
            rt.exec("cmd.exe /C adb shell screenrecord /sdcard/runCase.mp4");
    
        }
    
        @BeforeClass(alwaysRun = true)
        public void setUp() throws Exception {
            // set up appium
    
            DesiredCapabilities capabilities = new DesiredCapabilities();
            capabilities.setCapability(CapabilityType.BROWSER_NAME, "");
            capabilities.setCapability("platformName", "Android");
            capabilities.setCapability("deviceName", "Android Emulator");
            capabilities.setCapability("platformVersion", "4.4");
            // if no need install don't add this
            if (isInstall) {
                File classpathRoot = new File(System.getProperty("user.dir"));
                File appDir = new File(classpathRoot, "apps");
                File app = new File(appDir, "zhihu.apk");
                capabilities.setCapability("app", app.getAbsolutePath());
            }
            capabilities.setCapability("appPackage", "com.zhihu.android");
            // support Chinese
            capabilities.setCapability("unicodeKeyboard", "True");
            capabilities.setCapability("resetKeyboard", "True");
            // no need sign
            capabilities.setCapability("noSign", "True");
            capabilities.setCapability("appActivity", ".ui.activity.GuideActivity");
            driver = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"),
                    capabilities);
            startRecord();
        }
    
        public void login() {
    
            WebElement loginButton;
            if (isLoginPresent(driver, 60)) {
                loginButton = driver.findElement(By
                        .id("com.zhihu.android:id/login"));
                loginButton.click();
            }
    
            else {
                Assert.assertTrue(false);
            }
    
            // wait for 20s
            driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);
    
            // find login userName and password editText
            List<WebElement> textFieldsList = driver
                    .findElementsByClassName("android.widget.EditText");
            textFieldsList.get(0).sendKeys("seleniumcookies@126.com");
            textFieldsList.get(1).sendKeys("cookies123");
            driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);
    
            // find ok button byName
            driver.findElementById("android:id/button1").click();
            driver.manage().timeouts().implicitlyWait(90, TimeUnit.SECONDS);
    
            // find keyword 首页 and verify it is display
            Assert.assertTrue(driver.findElement(By.name("首页")).isDisplayed());
    
        }
    
        public boolean isLoginPresent(AndroidDriver driver, int timeout) {
            boolean isPresent = new AndroidDriverWait(driver, timeout).until(
                    new ExpectedCondition<WebElement>() {
                        public WebElement apply(AndroidDriver d) {
                            return d.findElement(By
                                    .id("com.zhihu.android:id/login"));
                        }
    
                    }).isDisplayed();
            return isPresent;
        }
    
        @Test(groups = "swipeTest", priority = 1)
        public void swipe() {
    
            // find login button
            if (isInstall) {
                login();
            }
            driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
    
            // find keyword 首页 and verify it is display
            Assert.assertTrue(driver.findElement(By.name("首页")).isDisplayed());
            snapshot((TakesScreenshot) driver, "zhihu_before_swipe.png");
            swipeToUp(driver, 500);
            snapshot((TakesScreenshot) driver, "zhihu_after_swipe.png");
    
            driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
    
            swipeToDown(driver, 1000);
            driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
            List<WebElement> titles = driver
                    .findElementsById("com.zhihu.android:id/title");
            titles.get(0).click();
            driver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);
            
            //swipe to right
            swipeToRight(driver, 100);
    
            driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
            // find keyword 首页 and verify it is display
            Assert.assertTrue(driver.findElement(By.name("首页")).isDisplayed());
        }
    
        /**
         * This Method for swipe up
         * 
         * @author Young
         * @param driver
         * @param during
         */
        public void swipeToUp(AndroidDriver driver, int during) {
            int width = driver.manage().window().getSize().width;
            int height = driver.manage().window().getSize().height;
            driver.swipe(width / 2, height * 3 / 4, width / 2, height / 4, during);
            // wait for page loading
        }
    
        /**
         * This Method for swipe down
         * 
         * @author Young
         * @param driver
         * @param during
         */
        public void swipeToDown(AndroidDriver driver, int during) {
            int width = driver.manage().window().getSize().width;
            int height = driver.manage().window().getSize().height;
            driver.swipe(width / 2, height / 4, width / 2, height * 3 / 4, during);
            // wait for page loading
        }
    
        /**
         * This Method for swipe Left
         * 
         * @author Young
         * @param driver
         * @param during
         */
        public void swipeToLeft(AndroidDriver driver, int during) {
            int width = driver.manage().window().getSize().width;
            int height = driver.manage().window().getSize().height;
            driver.swipe(width * 3 / 4, height / 2, width / 4, height / 2, during);
            // wait for page loading
        }
    
        /**
         * This Method for swipe Right
         * 
         * @author Young
         * @param driver
         * @param during
         */
        public void swipeToRight(AndroidDriver driver, int during) {
            int width = driver.manage().window().getSize().width;
            int height = driver.manage().window().getSize().height;
            driver.swipe(width / 4, height / 2, width * 3 / 4, height / 2, during);
            // wait for page loading
        }
    
        @Test(groups = { "profileSetting" }, priority = 2)
        public void profileSetting() {
    
            driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
            // find keyword 首页 and verify it is display
            Assert.assertTrue(driver.findElement(By.name("首页")).isDisplayed());
    
            driver.swipe(100, 400, 100, 200, 500);
            WebElement myButton = driver.findElement(By
                    .className("android.widget.ImageButton"));
            myButton.click();
            driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
            driver.swipe(700, 500, 100, 500, 10);
            driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
            List<WebElement> textViews = driver
                    .findElementsByClassName("android.widget.TextView");
            textViews.get(0).click();
            driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
    
            driver.findElementById("com.zhihu.android:id/name").click();
            driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
    
            // wait for 60s if WebElemnt show up less than 60s , then return , until
            // 60s
    
            By by = new By.ById("com.zhihu.android:id/showcase_close");
    
            snapshot((TakesScreenshot) driver, "zhihu_showClose.png");
            if (isElementPresent(by, 30)) {
                driver.findElement(by).click();
            }
    
            Assert.assertTrue(driver
                    .findElementsByClassName("android.widget.TextView").get(0)
                    .getText().contains("selenium"));
    
            driver.findElementById("com.zhihu.android:id/menu_people_edit").click();
            driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
            WebElement intro = driver
                    .findElementById("com.zhihu.android:id/introduction");
            intro.click();
            driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
            WebElement content = driver
                    .findElementById("com.zhihu.android:id/content");
            String text = content.getAttribute("text");
            content.click();
            clearText(text);
            content.sendKeys("Appium Test. Create By Young");
    
            driver.findElementById("com.zhihu.android:id/menu_question_done")
                    .click();
    
            WebElement explanation = driver
                    .findElementById("com.zhihu.android:id/explanation");
            explanation.click();
            driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
            content = driver.findElementById("com.zhihu.android:id/content");
            text = content.getAttribute("text");
            content.click();
            clearText(text);
            content.sendKeys("Appium Test. Create By Young. This is an appium type hahahahah");
    
            driver.findElementById("com.zhihu.android:id/menu_question_done")
                    .click();
            snapshot((TakesScreenshot) driver, "zhihu.png");
    
        }
    
        /**
         * This method for delete text in textView
         * 
         * @author Young
         * @param text
         */
        public void clearText(String text) {
            driver.sendKeyEvent(123);
            for (int i = 0; i < text.length(); i++) {
                driver.sendKeyEvent(67);
            }
        }
    
        @AfterClass(alwaysRun = true)
        public void tearDown() throws Exception {
            driver.quit();
        }
    
        /**
         * This Method create for take screenshot
         * 
         * @author Young
         * @param drivername
         * @param filename
         */
        public static void snapshot(TakesScreenshot drivername, String filename) {
            // this method will take screen shot ,require two parameters ,one is
            // driver name, another is file name
    
            String currentPath = System.getProperty("user.dir"); // get current work
                                                                    // folder
            File scrFile = drivername.getScreenshotAs(OutputType.FILE);
            // Now you can do whatever you need to do with it, for example copy
            // somewhere
            try {
                System.out.println("save snapshot path is:" + currentPath + "/"
                        + filename);
                FileUtils
                        .copyFile(scrFile, new File(currentPath + "\\" + filename));
            } catch (IOException e) {
                System.out.println("Can't save screenshot");
                e.printStackTrace();
            } finally {
                System.out.println("screen shot finished, it's in " + currentPath
                        + " folder");
            }
        }
    
        /**
         * 
         * @param by
         * @param timeOut
         * @return
         */
        public boolean isElementPresent(final By by, int timeOut) {
            try {
                new AndroidDriverWait(driver, timeOut)
                        .until(new ExpectedCondition<WebElement>() {
                            public WebElement apply(AndroidDriver d) {
                                return d.findElement(by);
                            }
    
                        });
                return true;
            } catch (Exception e) {
                return false;
            }
    
        }
    }

    整个过程会按照先向下,向上,向右滑动。

    有了这个滑动方法,能不能做一些更高级的事?

    答案将在明天揭晓,swipe 

     

    转载于:https://www.cnblogs.com/tobecrazy/p/4612133.html

    展开全文
  • Appium滑动

    2016-07-22 23:31:41
    TouchAction touchAction = new TouchAction(this);...// appium converts press-wait-moveto-release to a swipe action touchAction.press(startx, starty).waitAction(duration) .moveTo(endx, endy).release();
    TouchAction touchAction = new TouchAction(this);
    
    // appium converts press-wait-moveto-release to a swipe action
    touchAction.press(startx, starty).waitAction(duration)
    .moveTo(endx, endy).release();
    touchAction.perform();
    提示:swipe 的高级用法,swipe 可以进一步封装,比如一些MobileElement需要滑动屏幕
    才能出现,这个时候就可以封装一个滚动到这些MoblieElement出现为止的方法。
    展开全文
  • Python Appium 滑动、点击等操作.pdf
  • appium滑动滑动类

    2017-04-06 14:58:59
    里面包含了上、下、左、右滑动,指定元素滑动滑动指定范围等。多种示例
  • Appium 滑动问题

    2016-06-03 11:42:05
    Appium 滑动问题 /根据方向滑动 JavascriptExecutor js = (JavascriptExecutor) driver; HashMap scrollObject = new HashMap(); scrollObject.put("direction", "left"); scrollObject.put("element", (...

    Appium 滑动问题

    /根据方向滑动
    JavascriptExecutor js = (JavascriptExecutor) driver;
    HashMap<String, String> scrollObject = new HashMap<String, String>();
    scrollObject.put("direction", "left");
    scrollObject.put("element", ((RemoteWebElement) element).getId());
    js.executeScript("mobile: scroll", scrollObject);
    //根据坐标滑动
        public void swipe() {

            try {
                Thread.sleep(2000);

            } catch (Exception e) {
                e.printStackTrace();
            }
            JavascriptExecutor js = (JavascriptExecutor) dr;
            HashMap<String, Double> swipeObj = new HashMap<String, Double>();
            swipeObj.put("startX", 420.0);
            swipeObj.put("startY", 400.00);
            swipeObj.put("endX", 30.0);
            swipeObj.put("endY", 400.0);

            swipeObj.put("duration", 0.4);
            // 4个滑动页面
            for (int i = 0; i < 3; i++) {
                try {
                    js.executeScript("mobile: swipe", swipeObj);
                } catch (WebDriverException ex) {
                    ex.printStackTrace();
                }
            }
        }

    展开全文
  • appium滑动到指定元素怎么写 self.driver.find_element(MobileBy.ANDROID_UIAUTOMATOR, 'new UiScrollable(new UiSelector().' 'scrollable(true).instance(0)).' 'scrollIntoView
  • Python Appium 滑动、点击等操作 1、手机滑动-swipe # FileName : Tmall_App.py # Author : Adil # DateTime : 2018/3/25 17:22 # SoftWare : PyCharm from appium import webdriver caps = {} ...
  • Appium 滑动界面swipe用法

    万次阅读 2015-08-26 15:40:25
    Appium 滑动API:Swipe(int start x,int start y,int end x,int y,duration) 解释:int start x-开始滑动的x坐标,  int start y -开始滑动的y坐标。  int end x -结束点x坐标,  int end y -结束点y...
  • Appium滑动引导页-swipe函数 基础函数 获取屏幕分辨率: driver.get_window_size()[‘height’] #获取屏幕的高度 driver.get_window_size()[‘width’] #获取屏幕的宽度 实现滑动屏幕的函数 swipe(int start...
  • 使用TouchAction ...详细文档 使用TouchAction().press(el0).moveTo(el1).release() 一、appium滑动界面怎么写 举例:手势滑动界面,从下向上 def test_move(self): touch=TouchAction(self.driver)
  • appium滑动操作

    千次阅读 2015-10-15 16:40:59
    目的:1.Android手机上、下、左、右滑动操作  2.判断滑动到底部。思路:多次滑动后,比较最后一个元素是否相同。如果相同,则判定滑动到底部。...使用appium(环境请自行搭建) 写在文章开头,感谢陌
  • appium滑动操作总结

    2019-10-08 10:44:59
    appium滑动实现是门艺术,实现不好就会出现事与愿违的操作,比如本来想要向上滑动,却出现了下拉的动作,这样使得我们在调试中就要花费大量时间去调试滑动操作。 以下是我在滑动操作中总结的一点经验,希望...
  • appium-java-client-7.0.0,滑动需要注意的问题 依赖: io.appium java-client 7.0.0 swipe不能使用,需要使用TouchAction进行滑动,首先我们要明确模拟器的坐标,经过我测试查看,模拟器的最左上角坐标是(0,0),...
  • Appium 滑动踩坑记

    2019-06-19 09:34:00
    对于不同java-client版本,很多的API已经产生大的变化,所以一些API大家会发现已经失效或者使用方式发生了变化,滑动就是其中一项,这篇文章对滑动在不同的java-client版本以及不同的Appium版本使用给大家介绍下,...
  • appium 滑动封装

    2018-04-18 11:31:00
    #获得机器屏幕大小x,y defgetSize(): x=dr.get_window_size()['width'] y=dr.get_window_size()['height'] return(x, y) ...#屏幕向上滑动 defswipeUp(t): l=getSize() x1=int(l[0]*0.5)...
  • Appium滑动操作

    2018-11-23 16:59:00
    - start_y - 开始滑动的y坐标 - end_x - 结束点x坐标 - end_y - 结束点y坐标 - duration - 持续时间,单位毫秒 (1秒=1000毫秒) 例: driver.swipe(100, 100, 100, 400,1000)     转载于:...
  • appium滑动操作(向上滑动、向下滑动、向左滑动、向右滑动) 测试app:今日头条apk 测试设备:夜游神模拟器 代码如下: 先用x、y获取当前的width和height def getSize(): #获取当前的width和height的x、y...
  • Appium滑动问题研究

    2017-07-03 09:55:00
    一、Appium中,经常会遇到会遇到滑动操作,但往往用各种手势操作后还是滑动不了,今天主要讲下如何正确使用appium的手势操作。系统环境为最新的iOS 7.1+ Xcode 5.1  首先讲下滑动操作的几个基本方法。  1.swipe...
  • start_x:滑动开始x轴坐标 start_y:滑动开始y轴坐标 end_x:滑动结束x轴偏移量 end_y:滑动结束y轴偏移量 duration:(可选) 执行此次滑动时间,单位毫秒 封装 参数n:滑动次数 # 向上滑动屏幕 def swipe_up(driver...
  • appium 滑动操作swipe

    2019-04-02 21:42:00
    swipe(startx, starty,...duration为滑动持续的时间。注(时间要设置稍长一点,不然就成为了点击操作) 比如,当duration=10时,则效果为在startx, starty坐标处点击了一下。 比如,当duration=1000时,则效果才...
  • Appium滑动函数:Swipe

    2017-03-21 16:43:00
    Appium处理滑动方法是swipe 滑动API:Swipe(int start x,int start y,int end x,int y,duration)解释:int start x-开始滑动的x坐标;int start y -开始滑动的y坐标 ;int end x -结束点x坐标;int end y -...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 3,137
精华内容 1,254
关键字:

appium滑动